Skip to content

Commit

Permalink
fix: Multiline string locs (#482)
Browse files Browse the repository at this point in the history
  • Loading branch information
ospencer committed Dec 17, 2020
1 parent 37ba683 commit d3eccee
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions compiler/src/parsing/lexer.mll
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,7 @@ and read_str buf =
| "\\\"" { Buffer.add_char buf '"'; read_str buf lexbuf }
| "\\\\" { Buffer.add_char buf '\\'; read_str buf lexbuf }
| num_esc { add_code_point buf (lexeme lexbuf) (lexbuf_loc lexbuf); read_str buf lexbuf }
| [^ '"' '\\']+ { Buffer.add_string buf (lexeme lexbuf);
read_str buf lexbuf }
| [^ '"' '\\']+ { process_newlines lexbuf; Buffer.add_string buf (lexeme lexbuf); read_str buf lexbuf }
| '"' { STRING (Buffer.contents buf) }
| _ { raise (Error(lexbuf_loc lexbuf, IllegalStringCharacter(lexeme lexbuf))) }

Expand Down

0 comments on commit d3eccee

Please sign in to comment.