Source/Packages

Compiler.Parser

packages/compiler/src/Compiler/Parser.alpha

5,902 lines337 declarations199.2 KiBSHA-256 6d135c41813d

def · lines 1051–1103

parserQuotedSourceByte

Full file
Both quote modes reject source newlines; an escape never hides CR/LF.
1051def parserQuotedSourceByte =
1052  (lambda unrestricted offset : Nat .
1053    (lambda unrestricted head : Byte .
1054      (lambda unrestricted quoteState : Nat .
1055        (lambda unrestricted stripState : Nat .
1056          (lambda unrestricted continue : (pi unrestricted quoteState : Nat . (pi unrestricted stripState : Nat . (family StreamingStructuralState))) .
1057            (parserChooseStreamingState
1058              (byte-equal head (byte 13))
1059              (lambda unrestricted force : Nat .
1060                (constructor
1061                  StreamingStructuralState
1062                  StreamingStructuralFailed
1063                  (byte-to-nat (byte 96))
1064                  (constructor SyntaxOrigin SyntaxOriginRange offset (succ offset))
1065                  (bytes-cons head b"")
1066                  (constructor SyntaxOrigin SyntaxOriginRange offset (succ offset))))
1067              (lambda unrestricted force : Nat .
1068                (parserChooseStreamingState
1069                  (byte-equal head (byte 10))
1070                  (lambda unrestricted force : Nat .
1071                    (constructor
1072                      StreamingStructuralState
1073                      StreamingStructuralFailed
1074                      (byte-to-nat (byte 96))
1075                      (constructor SyntaxOrigin SyntaxOriginRange offset (succ offset))
1076                      (bytes-cons head b"")
1077                      (constructor SyntaxOrigin SyntaxOriginRange offset (succ offset))))
1078                  (lambda unrestricted force : Nat .
1079                    (parserChooseStreamingState
1080                      (parserQuoteIsEscaped quoteState)
1081                      (lambda unrestricted force : Nat .
1082                        (parserPrependLocatedByte offset head (continue (succ zero) stripState)))
1083                      (lambda unrestricted force : Nat .
1084                        (parserChooseStreamingState
1085                          (byte-equal head (byte 34))
1086                          (lambda unrestricted force : Nat .
1087                            (parserPrependLocatedByte
1088                              offset
1089                              head
1090                              (flushStreamingAtom (continue zero parserStripStateBetween))))
1091                          (lambda unrestricted force : Nat .
1092                            (parserChooseStreamingState
1093                              (byte-equal head (byte 92))
1094                              (lambda unrestricted force : Nat .
1095                                (parserPrependLocatedByte
1096                                  offset
1097                                  head
1098                                  (continue (succ (succ zero)) stripState)))
1099                              (lambda unrestricted force : Nat .
1100                                (parserPrependLocatedByte
1101                                  offset
1102                                  head
1103                                  (continue (succ zero) stripState)))))))))))))))))

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.