parser: Unescaped [WIP]

Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
2023-09-04 15:33:46 +00:00
parent 7968b06d7e
commit b76b9044bf
2 changed files with 69 additions and 21 deletions
+9
View File
@@ -48,3 +48,12 @@ func newErrIncomplete(p *TextParser, hint string) *lexer.Error {
return NewError(pos, s, hint, fs.ErrInvalid)
}
func NewErrInvalidEscapeSequence(p *TextParser, seq string) *lexer.Error {
pos, s := p.Position(), p.String()
s = s[:len(s)-len(seq)]
pos.Add(GetPositionalLength(s))
return NewError(pos, seq, "invalid escape character", fs.ErrInvalid)
}