Jack compiler now supports underscores in identifier

This commit is contained in:
2020-11-15 16:12:10 -05:00
parent fb224f31ed
commit 01e43dfba0
3 changed files with 2 additions and 2 deletions

View File

@@ -359,7 +359,7 @@ fn parse_keyword_or_identifier(chars: &Vec<char>, tokens: &mut Vec<Token>, index
token_string.push(chars[index]);
index += 1;
while chars[index].is_alphanumeric() {
while chars[index].is_alphanumeric() || chars[index] == '_' {
token_string.push(chars[index]);
index += 1;
}