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

core: Remove last uses of the tokenizer #1073

Merged
merged 6 commits into from Jun 6, 2023
Merged

Conversation

math-fehr
Copy link
Collaborator

This removes parse_char, which can use parse_characters instead.
parse_characters now use a similar error naming scheme than the other methods.

@math-fehr math-fehr added the core xDSL core (ir, textual format, ...) label Jun 4, 2023
@codecov
Copy link

codecov bot commented Jun 4, 2023

Codecov Report

Patch coverage: 57.69% and project coverage change: -0.11 ⚠️

Comparison is base (0e73c8f) 86.85% compared to head (16d9f5a) 86.75%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1073      +/-   ##
==========================================
- Coverage   86.85%   86.75%   -0.11%     
==========================================
  Files         130      130              
  Lines       20474    20470       -4     
  Branches     3095     3098       +3     
==========================================
- Hits        17783    17758      -25     
- Misses       2182     2204      +22     
+ Partials      509      508       -1     
Impacted Files Coverage Δ
xdsl/dialects/experimental/dmp.py 49.27% <0.00%> (ø)
xdsl/dialects/experimental/fir.py 84.24% <0.00%> (-0.26%) ⬇️
tests/test_printer.py 98.22% <40.00%> (-0.02%) ⬇️
xdsl/dialects/llvm.py 87.79% <70.58%> (+0.18%) ⬆️
xdsl/dialects/func.py 94.61% <71.42%> (-1.15%) ⬇️
xdsl/dialects/gpu.py 98.36% <75.00%> (-0.01%) ⬇️
xdsl/parser.py 83.61% <90.32%> (-1.54%) ⬇️
xdsl/dialects/arith.py 96.00% <100.00%> (ø)
xdsl/dialects/experimental/stencil.py 95.08% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

xdsl/dialects/gpu.py Outdated Show resolved Hide resolved
Base automatically changed from fehr/move-parse-bare-id to main June 5, 2023 09:28
@@ -71,37 +71,31 @@ class _GPUAttr(ParametrizedAttribute, Generic[T]):
def parse_parameters(parser: Parser) -> list[Attribute]:
parser.parse_characters(
"<",
f"Expected <. gpu attributes currently have the #gpu<name value> syntax.",
": gpu attributes currently have the #gpu<name value> syntax.",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is the colon necessary here? Shouldn't that be added on the other side of the string format?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I guess it's a style choice we can change.
Currently, parser methods with a context_msg option are printed like this: "error-msg" + context_msg, like in MLIR.
So, we can have error messages like '<' expected in attribute parameters for instance, making it a bit more concise and readable I think.

@math-fehr math-fehr merged commit 31de8ad into main Jun 6, 2023
12 checks passed
@math-fehr math-fehr deleted the fehr/parse-characters branch June 6, 2023 15:24
cigarichard pushed a commit to cigarichard/xdsl that referenced this pull request Jun 17, 2023
This removes `parse_char`, which can use `parse_characters` instead.
`parse_characters` now use a similar error naming scheme than the other
methods.

---------

Co-authored-by: Sasha Lopoukhine <superlopuh@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core xDSL core (ir, textual format, ...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants