nand2tetris / web-ide

A web-based IDE for https://nand2tetris.org
https://nand2tetris.github.io/web-ide
Other
38 stars 11 forks source link

[bug]: Web assembler doesn't accept dollar sign ($) as valid symbol #283

Closed bupjae closed 1 month ago

bupjae commented 1 month ago

Program

Assembler

Interface

Website (https://nand2tetris.github.io/web-ide)

Contact Details

bupjae@gmail.com

What happened?

HACK ASM program:

@12000
D=A
@$foo
M=D

Expected result: Successfully assembled to following .HACK file:

0010111011100000
1110110000010000
0000000000010000
1110001100001000

Actual result: Got error: Line 3: expected ".", a digit, "_", or a letter

According book 6.2.1, dollar sign ($) should be accepted as valid symbol.

A user-defined symbol can be any sequence of letters, digits, underscore (_), dot (.), dollar sign ($), and colon (:) that does not begin with a digit

Java version assembler 2.5 successfully assembled as expected.

Additional Comments

No response

Do you want to try to fix this bug?

Code of Conduct