From 01e43dfba06cbf960736cb1fd9e5d6c388a47730 Mon Sep 17 00:00:00 2001 From: Felix Martin Date: Sun, 15 Nov 2020 16:12:10 -0500 Subject: [PATCH] Jack compiler now supports underscores in identifier --- .gitignore | 1 + jack_compiler/src/tokenizer.rs | 2 +- tools/bin/Virtual Machine Emulator.dat | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 tools/bin/Virtual Machine Emulator.dat diff --git a/.gitignore b/.gitignore index 40f21f1..b7bf307 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # ---> N2T tools/bin/Hardware Simulator.dat tools/bin/CPU Emulator.dat +tools/bin/Virtual Machine Emulator.dat # ---> Python # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/jack_compiler/src/tokenizer.rs b/jack_compiler/src/tokenizer.rs index e957188..67ef8d6 100644 --- a/jack_compiler/src/tokenizer.rs +++ b/jack_compiler/src/tokenizer.rs @@ -359,7 +359,7 @@ fn parse_keyword_or_identifier(chars: &Vec, tokens: &mut Vec, 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; } diff --git a/tools/bin/Virtual Machine Emulator.dat b/tools/bin/Virtual Machine Emulator.dat deleted file mode 100644 index a92f610..0000000 --- a/tools/bin/Virtual Machine Emulator.dat +++ /dev/null @@ -1 +0,0 @@ -C:\Users\Eytan\Desktop\New folder\nand2tetris\projects\08\FunctionCalls\NestedCall