Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Refactor] Move parsing of {, } and : symbols to the Block syntax module #482

Open
Ph0enixKM opened this issue Sep 16, 2024 · 0 comments
Open
Labels
compiler enhancement New feature or request good first issue Good for newcomers

Comments

@Ph0enixKM
Copy link
Member

Ph0enixKM commented Sep 16, 2024

EBNF explanation

Right now when parsing let's say if loop we perform the following EBNF:

block = { statement } ;
if_cond = 'if', condition, (':' | '{'), block, {'}'} ;
(* ... *)

Let's change this to:

block_multi = ':', statement ;
block_single = '{', { statement }, '}' ;
block = block_multi | block_single ;
if_cond = 'if', condition, block;
(* ... *)

Non-EBNF explanation

Basically let's handle parsing of tokens like {, } and : in Block syntax module so that when we use it later we remember to handle the both syntaxes { .. } and : as well.

@github-project-automation github-project-automation bot moved this to 🆕 New in Amber Project Sep 16, 2024
@Ph0enixKM Ph0enixKM added this to the Amber 0.3.6-alpha milestone Oct 4, 2024
@Ph0enixKM Ph0enixKM added enhancement New feature or request good first issue Good for newcomers compiler labels Oct 6, 2024
@Ph0enixKM Ph0enixKM removed this from the Amber 0.3.6-alpha milestone Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant