forked from dylan-lang/opendylan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dfmc-reader: better warning for Tab in string literals
This changes the lexer transitions for strings (standard, raw, multi-line, and symbols) to ALLOW tabs so that in the post-processing of the token we can signal a more helpful message. Because all of those ^^ kinds of strings are ultimately processed by decode-string the tab checking only needs to happen in one place. The checking piggy-backs on the string splitter method, find-line-break, since that's already looking at every character in the string. This also renames `<invalid-multi-line-string-literal>` to just `<invalid-string-literal>` because that condition was potentially being signaled for both multi-line and one-line strings due to the fact that all string literals pass through the decode-string function. I didn't see a need for two condition classes for invalid string literals. Error message before: `Invalid token beginning """ encountered.` and after: `Invalid string literal: tab character at index 1; use \t or spaces instead` Fixes dylan-lang#425
- Loading branch information
Showing
5 changed files
with
39 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters