Open ZedThree opened 1 year ago
I think dropping the call expression makes sense based on your reasoning. I’m less concerned about argument_list since it’s sort of an accurate description but your final example output seems the cleanest. I don’t think we need another node?
I think the extra node here would actually be useful in order to have the (size)
node be a child.
For example:
integer :: a(n), b
gets parsed as:
(variable_declaration
(intrinsic_type)
(identifier)
(size (identifier))
(identifier))
Here the variable names and size nodes are at the same level, which I think will make parsing the tree awkward.
Instead, I think this would be better:
(variable_declaration
(intrinsic_type)
(variable
name: (identifier)
(size (identifier)))
(variable
name: (identifier)))
Then it's clearer which size goes with which identifier.
Currently variable declarations like the following:
get parsed like as:
I'm not keen on the
call_expression
there as I think we should be able to always distinguish between declarations and function calls in this context.A small tweak to the grammar can give:
I'm not completely convinced by this -- maybe it would be better to have another node? And/or drop the
argument_list
node?