Commit Graph

24 Commits

Author SHA1 Message Date
df8d9689d1 lang: add null pointer check to arith_parse_left_paren
this fixes a crash that occurred when the call-operator was used on a lone ident in an expression.
2025-04-03 10:48:56 +01:00
78b2eb23c3 lang: ast: implement () operator parsing
the () operator can be used to call lambdas in a more functional way than the standard
message-send syntax

for example, with a lambda stored in variable `x`:

	x(a:2 b:6).

is equivalent to

	x call(a:2 b:6).
2025-03-26 21:10:12 +00:00
8b8a97c9a6 lang: ast: implement parsing of subscript operator 2024-12-08 17:08:29 +00:00
753afd7d87 lang: ast: implement parsing of tuples 2024-12-08 12:28:47 +00:00
e8c30b65b5 lang: ast: implement support for multiple expression terminator tokens 2024-12-07 21:28:25 +00:00
209c47da68 lang: ast: implement parsing of static and dynamic package initialisers 2024-12-07 20:56:57 +00:00
504fea6d9e lang: ast: fix expr type not being set when parsing a lambda 2024-12-06 22:46:24 +00:00
dba4f123d6 lang: ast: implement parsing of lambdas 2024-12-06 22:26:06 +00:00
1f7319458e lang: ast: implement parsing of properties 2024-12-06 19:47:27 +00:00
94c10dfbb2 lang: ast: implement parsing of f-strings 2024-12-06 13:46:58 +00:00
2bd3e96427 lang: ast: implement parsing of atoms 2024-12-06 13:46:41 +00:00
d3813dc514 lang: ast: treat bang (!) as an unconsumed expression terminator 2024-12-06 13:22:33 +00:00
d88d58be70 lang: ast: implement for-loop parsing 2024-12-06 10:02:31 +00:00
f3cd89c72a lang: ast: implement caret (return) parsing 2024-12-06 10:01:56 +00:00
d1855afc05 lang: add missing includes; misc formatting cleanup 2024-12-06 09:59:57 +00:00
9a4b074381 lang: ast: suppress debug output by default 2024-12-05 19:37:58 +00:00
e23cd801c9 lang: ast: fix keyword arg parser not inheriting subexpr depth correctly 2024-12-05 16:55:53 +00:00
fc0a943ae8 lang: ast: improve cascade operator recipient resolution
the cascade operator now uses the precedence of the last message parsed
to determine the recipient of the subsequent messages, reducing the need
for parentheses and making the semantics of the operator more
predictable.

all messages in a cascade now inherit the precedence of the first
message in the cascade.
2024-12-05 16:53:59 +00:00
7acf80f930 lang: ast: implement parsing of match statements 2024-12-04 22:22:25 +00:00
a34b9c3710 lang: ast: fix expr_finalise not consuming the right-paren of a parenthesised expression 2024-12-04 20:18:40 +00:00
84f3704db0 lang: ast: fix expr_finalise not handling complex message terminator 2024-12-04 16:41:18 +00:00
c23523ce14 lang: ast: implement parsing of inline and standalone if-else statements 2024-12-04 16:35:19 +00:00
051cb1d2c2 lang: ast: implement cascade operator parsing 2024-12-03 21:57:44 +00:00
16ab13d738 lang: ast: re-factor expression parser into multiple files 2024-12-03 13:26:55 +00:00