155 Commits

Author SHA1 Message Date
Ryan Chandler
c2ffd0cd59
parser: add missing reserved keyword tokens to list of accepted
Closes #50
2022-11-27 02:20:23 +00:00
Ryan Chandler
4501905705
interpreter: do enough to get recursive fib working 2022-11-24 01:43:52 +00:00
Evan Shaw
50ecea182a lexer: Handle floats with sign after e 2022-09-23 22:03:12 +12:00
Ryan Chandler
d0914caffb
parser: shorthand declare 2022-09-22 20:54:23 +01:00
Ryan Chandler
1d377936e0
parser: shorthand switch 2022-09-22 20:38:53 +01:00
Ryan Chandler
af915e4575
parser: shorthand for 2022-09-22 20:32:11 +01:00
Ryan Chandler
b534d2c9d4
parser: support shorthand while 2022-09-22 20:20:56 +01:00
Evan Shaw
d6af5b8c0b Handle uppercase letters for int literals 2022-09-21 22:44:54 +12:00
Evan Shaw
05a50d3eb8 Lexer: handle all types of numeric literals 2022-09-20 21:56:49 +12:00
Ryan Chandler
2492a82bcc
parser: support short foreach statement 2022-09-19 11:24:45 +01:00
Evan Shaw
21d600f5c1 lexer: string interpolation mostly implemented 2022-09-17 22:28:34 +12:00
Evan Shaw
f36ed99344 lexer: push and pop state when braces are encountered 2022-09-17 22:26:22 +12:00
Evan Shaw
be0d206c93 lexer: turn state into a stack 2022-09-17 22:26:22 +12:00
Ryan Chandler
425a5e12af
parser: support a basic shorthand if 2022-09-16 23:40:32 +01:00
Ryan Chandler
afa88ee664
parser: support all forms of yield/yield from 2022-09-16 23:18:31 +01:00
Ryan Chandler
27d5705f85
parser/lexer: implement all assignment ops 2022-09-16 16:16:14 +01:00
Ryan Chandler
79bf633fac
chore: format 2022-09-16 15:20:49 +01:00
Ryan Chandler
e2065bf029
parser: support logical and, or, xor op 2022-09-16 15:20:16 +01:00
Ryan Chandler
a6388b3c57
parser: support <=> op 2022-09-16 15:16:23 +01:00
Ryan Chandler
a7d74e6b2d
parser/lexer: support <> op 2022-09-16 15:14:46 +01:00
Ryan Chandler
d99d931107
parser: support bitwise xor 2022-09-16 15:11:54 +01:00
Ryan Chandler
fb8ebd2484
parser: support % op 2022-09-16 15:07:41 +01:00
Ryan Chandler
d4c9db4203
parser: support print expressions 2022-09-16 14:59:44 +01:00
Ryan Chandler
33a481f13a
parser/lexer: support unary bitwise not 2022-09-16 14:47:06 +01:00
Ryan Chandler
dee9eb7f23
parser/lexer: support all types of prefix cast 2022-09-16 14:37:06 +01:00
Ryan Chandler
59ebb1ed2d
parser: add test case for call inside braced var 2022-09-16 10:21:37 +01:00
Ryan Chandler
9353c8fab1
lexer: produce single dollar tokens 2022-09-16 10:09:29 +01:00
Evan Shaw
1918f80799 lexer: implement binary strings 2022-09-16 16:48:09 +12:00
Evan Shaw
366004c30b lexer: implement octal, hex, and unicode string escapes 2022-09-16 09:13:10 +12:00
Evan Shaw
f8c0928cf7 lexer: handle double-quote whitespace escape sequences 2022-09-16 09:13:09 +12:00
Evan Shaw
446b984376 lexer: error on unterminated strings 2022-09-16 07:27:31 +12:00
Evan Shaw
353412a85a lexer: fully qualified identifier test 2022-09-15 22:12:02 +12:00
Evan Shaw
0e5499ebc8 lexer: re-work position tracking
Now span refers to the start of a token and position is tracked inside
the next method.
2022-09-15 22:07:50 +12:00
Ryan Chandler
1f0cd664da
parser/lexer: add support for goto statements 2022-09-15 01:15:52 +01:00
Ryan Chandler
7e7fd8a24d
parser/lexer: support __halt_compiler token 2022-09-14 23:55:42 +01:00
Evan Shaw
4cb19078c4 lexer: rename peek to peek_buf 2022-09-15 09:45:13 +12:00
Evan Shaw
ebd3798a24 lexer: remove char variable from tokenize 2022-09-15 09:45:05 +12:00
Evan Shaw
cbed61165f lexer: Rework lookahead 2022-09-15 09:45:00 +12:00
Evan Shaw
fd118ea0da lexer: simplify try_read 2022-09-15 07:57:45 +12:00
Evan Shaw
b6de94cd1e lexer: move larger match cases to separate methods 2022-09-15 07:57:45 +12:00
Ryan Chandler
ee253d510e
parser: move expression method over to Precedence logic 2022-09-13 15:20:40 +01:00
Ryan Chandler
9b3fbd12a4
parser: map some operators to new precedence 2022-09-13 14:10:48 +01:00
Ryan Chandler
067bac959a
parser: support backed enums with cases that have no backing value 2022-09-13 12:15:29 +01:00
Ryan Chandler
e63fe36008
all: clippy 2022-09-13 12:11:33 +01:00
Ryan Chandler
5e91a16175
parser: support readonly classes 2022-09-13 12:02:20 +01:00
Evan Shaw
d803e53a0a Remove serde dependency 2022-09-13 22:24:31 +12:00
Evan Shaw
447b1be197 Use ByteString through lexer and parser 2022-09-13 22:03:09 +12:00
Evan Shaw
843a00c523 Add ByteString type 2022-09-13 22:03:09 +12:00
Evan Shaw
f0fc4f190d Add a test case for non-UTF-8 variable name 2022-09-13 20:22:11 +12:00
Evan Shaw
f345389c32 Allow lexer to accept bytes as input 2022-09-13 17:19:47 +12:00