on master help sign in
use ES.String when parsing patterns
commit06e8ede22429ea730712ec6b784cbe3be262344a authorEvan Czaplicki <evancz@users.noreply.github.com> dateMon 3 Jun 2019, 11:51 (7 years ago) parent33d1a20
1 file changed+6−6
compiler/src/Parse/Pattern.hs+6−6
compiler/src/Parse/Pattern.hs+6−6
@@ -16,7 +16,7 @@ import qualified AST.Source as Src
1616import qualified Parse.Keyword as Keyword
1717import qualified Parse.Number as Number
1818import qualified Parse.Space as Space
19−import qualified Parse.Utf8 as Utf8
19+import qualified Parse.String as String
2020import qualified Parse.Variable as Var
2121import qualified Parse.Primitives as P
2222import Parse.Primitives (Parser, addLocation, addEnd, getPosition, inContext, oneOf, oneOfWithFallback, word1, word2)
@@ -67,16 +67,16 @@ termHelp start =
6767 return (A.at start end (Src.PInt int))
6868
6969 Number.Float float ->
70− P.Parser $ \(P.State _ _ _ row col) _ _ cerr _ ->
70+ P.Parser $ \(P.State _ _ _ _ row col) _ _ cerr _ ->
7171 let
7272 width = fromIntegral (Utf8.size float)
7373 in
7474 cerr row (col - width) (E.PFloat width)
7575 ,
76− do str <- Utf8.string E.PStart E.PString
76+ do str <- String.string E.PStart E.PString
7777 addEnd start (Src.PStr str)
7878 ,
79− do chr <- Utf8.character E.PStart E.PChar
79+ do chr <- String.character E.PStart E.PChar
8080 addEnd start (Src.PChr chr)
8181 ]
8282
@@ -87,7 +87,7 @@ termHelp start =
8787
8888wildcard :: Parser E.Pattern ()
8989wildcard =
90− P.Parser $ \(P.State pos end indent row col) cok _ cerr eerr ->
90+ P.Parser $ \(P.State src pos end indent row col) cok _ cerr eerr ->
9191 if pos == end || P.unsafeIndex pos /= 0x5F {- _ -} then
9292 eerr row col E.PStart
9393 else
@@ -99,7 +99,7 @@ wildcard =
9999 let (# badPos, badCol #) = Var.chompInnerChars newPos end newCol in
100100 cerr row col (E.PWildcardNotVar (Name.fromPtr pos badPos) (fromIntegral (badCol - col)))
101101 else
102− let !newState = P.State newPos end indent row newCol in
102+ let !newState = P.State src newPos end indent row newCol in
103103 cok () newState
104104
105105