feat: add hexadecimal number literal parsing to wren compiler

Remove the TOKEN_HEXADECIMAL token type and isHexDigit helper, replacing them with a readHexDigit function and readHexNumber parser that directly converts hex literals to numeric values during lexing. Add a `number` field to the Parser struct to hold the parsed value, and include a test for invalid hex literal error handling.
This commit is contained in:
Gavin Schulz
2015-01-25 21:02:44 +00:00
parent b2c6dfce8d
commit 992a2aeb96
2 changed files with 66 additions and 74 deletions
+1
View File
@@ -0,0 +1 @@
var x = 2xFF // expect error: Error at 'xFF': Expect end of file.