Closed mbudde closed 6 months ago
@mbudde . I took my time. But this is done :) I'm also planning make semicolons inline, so they only appear during error and does not end up clouding the tree.
{ 1 }
should produce
(standalone_block [59, 0] - [59, 5]
(integer [59, 2] - [59, 3])))
map { $_*2 } (1,2)
, should produce,
(array_function [59, 0] - [59, 18]
(function_name [59, 0] - [59, 3])
(block [59, 4] - [59, 12]
(binary_expression [59, 6] - [59, 10]
variable: (special_scalar_variable [59, 6] - [59, 8])
variable: (integer [59, 9] - [59, 10])))
(array [59, 13] - [59, 18]
(integer [59, 14] - [59, 15])
(integer [59, 16] - [59, 17]))))
Basically, the last statement in block/file can end without a semicolon
In a block with a single statement leaving out the optional semicolon results in a parse error:
When there's more than one statement the parse error goes away but the parse tree seems to contain a semicolon that doesn't exist (not sure if that is intentioal):