Teach the tokenizer to report escaped newlines

Add fields and flags so that escaped newlines can be reported, for the
benefit of fish_indent.
This commit is contained in:
ridiculousfish
2018-05-07 15:22:09 -07:00
parent 678fd86107
commit 6f57fef8f8
4 changed files with 44 additions and 24 deletions

View File

@@ -82,6 +82,9 @@ struct tok_t {
// If an error, this is the error code.
tokenizer_error *error { TOK_ERROR_NONE };
// Whether the token was preceded by an escaped newline.
bool preceding_escaped_nl{false};
// If an error, this is the offset of the error within the token. A value of 0 means it occurred
// at 'offset'.
size_t error_offset{size_t(-1)};