diff options
| author | Miquel Sabaté Solà <mikisabate@gmail.com> | 2025-01-15 16:00:58 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <mikisabate@gmail.com> | 2025-01-15 16:02:38 +0100 |
| commit | 88213ce95acf88a82cd446500dc7de730f4dd669 (patch) | |
| tree | 68b5226a6936336d88050b0cf0b97d73b3c24104 /lib/xixanta/src/parser.rs | |
| parent | a11fd7b8fb7b1590defb692dcb17d9d7272aebe7 (diff) | |
| download | tools.nes-88213ce95acf88a82cd446500dc7de730f4dd669.tar.gz tools.nes-88213ce95acf88a82cd446500dc7de730f4dd669.zip | |
Move check for ASCII-only strings into the parser
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'lib/xixanta/src/parser.rs')
| -rw-r--r-- | lib/xixanta/src/parser.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/xixanta/src/parser.rs b/lib/xixanta/src/parser.rs index d42ff12..524f7c2 100644 --- a/lib/xixanta/src/parser.rs +++ b/lib/xixanta/src/parser.rs @@ -902,6 +902,10 @@ impl Parser { // character (unless it was escaped through '\'). let mut prev = '"'; for ch in line.get(self.offset..).unwrap_or("").chars() { + if !ch.is_ascii() { + return Err(self.parser_error("using non-ASCII characters in a string")); + } + if ch == '"' && prev != '\\' { self.next(); |
