on master help sign in
Fix bug in computing row/col for keyword and symbol parsers
06e7d8fEvan Czaplicki
src/Parse/Primitives/Keyword.hs+1−1
@@ -43,7 +43,7 @@ keyword kwd@(B.PS kwdFp kwdOffset kwdLength) =
43 then
43 then
44 let
44 let
45 !newState =
45 !newState =
46− State fp (offset + kwdLength) terminal indent (row + kwdLength) col ctx
46+ State fp (offset + kwdLength) terminal indent row (col + kwdLength) ctx
47 in
47 in
48 cok () newState noError
48 cok () newState noError
49
49
src/Parse/Primitives/Symbol.hs+1−1
@@ -125,7 +125,7 @@ symbol sym@(B.PS symFp symOffset symLength) =
125 in
125 in
126 Parser $ \(State fp offset terminal indent row col ctx) cok _ _ eerr ->
126 Parser $ \(State fp offset terminal indent row col ctx) cok _ _ eerr ->
127 if I.isSubstring symFp symOffset symLength fp offset terminal then
127 if I.isSubstring symFp symOffset symLength fp offset terminal then
128− let !newState = State fp (offset + symLength) terminal indent (row + symLength) col ctx in
128+ let !newState = State fp (offset + symLength) terminal indent row (col + symLength) ctx in
129 cok () newState noError
129 cok () newState noError
130
130
131 else
131 else