Skip to content

create multiple errors when lexing a string value #319

@lrlna

Description

@lrlna

When lexing a String Value we can have three different error types:

  • unterminated string
  • unexpected escape character
  • unexpected line terminator

If there is a unexpected escape character or unexpected line terminator and also the string value is unterminated, we only get the unterminated string error message, as the errors get overridden.

For example:

let gql = "\"\n hello"
let lexer = Lexer::new(gql);

produces only ERROR@0:7 "unterminated string value" "hello error, where it would be really helpful for users to also have the unexpected line terminator error as well.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions