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

Bug/abnf-circuit-grammar #903

Merged
merged 7 commits into from
May 6, 2021
Merged

Bug/abnf-circuit-grammar #903

merged 7 commits into from
May 6, 2021

Conversation

gluax
Copy link
Contributor

@gluax gluax commented Apr 29, 2021

Resolves #842 and resolves #892.
Member variables are now required to be before member functions.
They also support a trailing command and semi-colon.
There's also a hacky fix to allow an optional comma at the end of the last member variable.
Do note you can mix and match semi-colons and commas at the moment. If this concerns people I can change it to allow only one approach at a time.

I changed all our tests(asides parser tests) to use semi-colons after member-variables. This way if people look at the tests they see semi-colons.

@gluax gluax added bug Something isn't working documentation Improvements or additions to documentation abnf labels Apr 29, 2021
@gluax gluax requested review from acoglio and collinc97 April 29, 2021 19:27
@gluax gluax self-assigned this Apr 29, 2021
@codecov
Copy link

codecov bot commented Apr 29, 2021

Codecov Report

Merging #903 (c063200) into master (7e83de8) will decrease coverage by 0.06%.
The diff coverage is 92.59%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #903      +/-   ##
==========================================
- Coverage   76.97%   76.91%   -0.07%     
==========================================
  Files         467      467              
  Lines       20211    20252      +41     
==========================================
+ Hits        15558    15576      +18     
- Misses       4653     4676      +23     
Impacted Files Coverage Δ
asg/tests/pass/form_ast.rs 100.00% <ø> (ø)
parser/src/parser/file.rs 86.68% <91.48%> (+0.58%) ⬆️
parser/src/errors/syntax.rs 69.64% <100.00%> (+2.33%) ⬆️
parser/src/parser/context.rs 93.49% <100.00%> (+0.11%) ⬆️
compiler/src/expression/arithmetic/mul.rs 0.00% <0.00%> (-41.67%) ⬇️
compiler/src/value/integer/integer.rs 77.08% <0.00%> (-4.87%) ⬇️
compiler/tests/integers/int_macro.rs 92.15% <0.00%> (-2.95%) ⬇️
compiler/src/expression/expression.rs 92.68% <0.00%> (-1.22%) ⬇️
package/src/inputs/pairs.rs 84.61% <0.00%> (+5.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7e83de8...c063200. Read the comment docs.

Copy link
Collaborator

@acoglio acoglio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. In the ABNF grammar, would you be willing to rename the nonterminal member-variable-declaration to member-variable-declarations since it consists of all the member variable declarations (with commas/semicolons/nothing)? (Nitpicking, I know...)

@gluax gluax requested a review from acoglio April 30, 2021 16:07
Copy link
Collaborator

@acoglio acoglio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@acoglio acoglio requested a review from Protryon May 4, 2021 01:49
@collinc97
Copy link
Collaborator

@gluax how easy is it to detect that users are using both , and ;?

I don't think we want people to do that and we should emit an error if possible.

Regardless, we should emit a warning of deprecated syntax whenever someone uses a , after a circuit member variable.

@gluax
Copy link
Contributor Author

gluax commented May 5, 2021

Should be fairly straightforward to emit an error if both are used @collinc97.

@collinc97 collinc97 mentioned this pull request May 5, 2021
3 tasks
@acoglio acoglio merged commit 2ddb474 into master May 6, 2021
@acoglio acoglio deleted the bug/abnf-circuit-grammar branch May 6, 2021 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
3 participants