Skip to content

Allow macro_identifier everywhere an identifier is#26

Merged
d-alonso merged 1 commit into
codeefrom
feature/macroIdentifier
Mar 4, 2026
Merged

Allow macro_identifier everywhere an identifier is#26
d-alonso merged 1 commit into
codeefrom
feature/macroIdentifier

Conversation

@d-alonso

@d-alonso d-alonso commented Mar 3, 2026

Copy link
Copy Markdown

As you might be aware, I can't test this in this repo because it involves setting an env var to communicate with the external scanner.

This substitutes everywhere an $.identifier was with a new hidden rule that admits a $.macro_identifier as well. This fixes a parsing ambiguity when parsing this code:

subroutine parse_dict()
  allocate(GridEntity :: new_entity)
end subroutine parse_dict

When setting GridEntity as a macro identifier, the parser would first assume that it is an allocate statement without the optional type part, and that GridEntity is the name of the allocation place, and then end in ERROR due to the unexpected :: part after.

It also hopefully ends other possible ambiguities that were not discovered yet

@d-alonso d-alonso self-assigned this Mar 3, 2026
@d-alonso d-alonso requested review from a team, igarcia0 and jgonzac and removed request for a team March 4, 2026 08:58
@d-alonso d-alonso merged commit 12d0238 into codee Mar 4, 2026
1 of 2 checks passed
@d-alonso d-alonso deleted the feature/macroIdentifier branch April 6, 2026 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants