Source/Packages

Compiler.IntegerLiteral

packages/compiler/src/Compiler/IntegerLiteral.alpha

903 lines95 declarations31.8 KiBSHA-256 578f5c4899f4

def · lines 556–584

integerLiteralSeparatorStep

Full file
556def integerLiteralSeparatorStep =
557  (lambda unrestricted radix : (family IntegerLiteralRadix) .
558    (lambda unrestricted head : Byte .
559      (lambda unrestricted tail : Bytes .
560        (lambda unrestricted continue : (pi unrestricted previousWasDigit : Nat . (family IntegerLiteralSyntaxResult)) .
561          (lambda unrestricted previousWasDigit : Nat .
562            (integerLiteralChooseSyntax
563              (byte-equal head (byte 95))
564              (lambda unrestricted ignored : Nat .
565                (integerLiteralChooseSyntax
566                  (stdFlagAnd previousWasDigit (integerLiteralDigitValid radix (bytes-head tail)))
567                  (lambda unrestricted ignored : Nat . (continue zero))
568                  (lambda unrestricted ignored : Nat .
569                    (constructor
570                      IntegerLiteralSyntaxResult
571                      IntegerLiteralSyntaxFailed
572                      (constructor IntegerLiteralFailure IntegerLiteralBadSeparator)))))
573              (lambda unrestricted ignored : Nat .
574                (eliminate
575                  IntegerLiteralDigitResult
576                  (lambda unrestricted current : (family IntegerLiteralDigitResult) .
577                    (family IntegerLiteralSyntaxResult))
578                  (integerLiteralDecodeDigit radix head)
579                  (branch IntegerLiteralDigitValue digit . (continue (succ zero)))
580                  (branch
581                    IntegerLiteralDigitFailed
582                    failure
583                    .
584                    (constructor IntegerLiteralSyntaxResult IntegerLiteralSyntaxFailed failure))))))))))

The compiler supplied declaration spans and resolved links from this source snapshot. This page does not assert that this file belongs to a checked closure.