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

Fix verbatim parsing to be unambiguous #385

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

mgehre-amd
Copy link
Collaborator

With the previous parsing, it would interpret

    emitc.verbatim "#endif // PL_USE_XRT"
    %4 = "emitc.constant"() <{value = 1 : i32}> : () -> i32

as if

    emitc.verbatim "#endif // PL_USE_XRT" %4
    = "emitc.constant"() <{value = 1 : i32}> : () -> i32

and then complain that it expected a : after the %4.

Fix this by introducing a args keyword to distinguish the case where the veratim has args from the case where the next operation starts.

With the previous parsing, it would interpret
```
    emitc.verbatim "#endif // PL_USE_XRT"
    %4 = "emitc.constant"() <{value = 1 : i32}> : () -> i32
```
as if
```
    emitc.verbatim "#endif // PL_USE_XRT" %4
    = "emitc.constant"() <{value = 1 : i32}> : () -> i32
```
and then complain that it expected a `:` after the `%4`.

Fix this by introducing a `args` keyword to distinguish the case where the veratim has args
from the case where the next operation starts.
Copy link

@TinaAMD TinaAMD left a comment

Choose a reason for hiding this comment

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

LGTM

@mgehre-amd mgehre-amd merged commit b04eab8 into feature/fused-ops Oct 10, 2024
5 checks passed
@mgehre-amd mgehre-amd deleted the matthias.fix_verbatim_parsing branch October 10, 2024 13:23
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.

2 participants