Skip to content

Rewrite parser #43

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

Closed
wants to merge 3 commits into from
Closed

Rewrite parser #43

wants to merge 3 commits into from

Conversation

jepler
Copy link
Contributor

@jepler jepler commented Apr 26, 2022

Re-implement pioasm

This passes all tests, with many error messages improved. Most errors now show their context, such as

adafruit_pioasm.ParseError: Line 1, column 5: Jump to undefined label undef
    jmp undef
        ^
adafruit_pioasm.ParseError: Line 1, column 5: Expected 'pins', 'x', 'y', None, 'exec', 'pc', 'isr', 'osr'
    mov hello
        ^

This should set the stage for adding expression parsing and supporting ".define".

Closes #40

jepler added 3 commits April 24, 2022 20:06
Closes: adafruit#30 (though I don't know what octal syntax is accepted by
official pioasm, we will accept python-style 0o567 not C-style 0567)
This passes all tests, with many error messages improved. Most errors
now show their context, such as
```
adafruit_pioasm.ParseError: Line 1, column 5: Jump to undefined label undef
    jmp undef
        ^
adafruit_pioasm.ParseError: Line 1, column 5: Expected 'pins', 'x', 'y', None, 'exec', 'pc', 'isr', 'osr'
    mov hello
        ^
```

debuginfo is not supported.

This should set the stage for adding expression parsing and
supporting ".define".

Closes #405
@jepler
Copy link
Contributor Author

jepler commented Apr 26, 2022

This incarnation sort of mashes together tokenization & recursive-descent parsing without lookahead. Implementing operator precedence becomes a bit puzzling in this design, so maybe another design needs to be tried.

@jepler
Copy link
Contributor Author

jepler commented Sep 15, 2022

I don't have plans to work on this at the moment, so closing it up.

@jepler jepler closed this Sep 15, 2022
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.

"set pins, ~ 0" is accepted, but should not be(?)
1 participant