Skip to content

Do not recognize docstrings in the tokenizer #312

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

Merged
merged 1 commit into from
Apr 2, 2022

Conversation

certik
Copy link
Contributor

@certik certik commented Apr 2, 2022

In Python, docstrings seem to be the first item in the body of a
function. They are not specifically recognized in the parser, and not in
the tokenizer either. Thus we should follow the same approach.

Tests were updated.

This also fixed the warning:

+ re2c -W -b tokenizer.re -o tokenizer.cpp
tokenizer.re:684:20: warning: unreachable rule (shadowed by rule at line 677) [-Wunreachable-rules]

In Python, docstrings seem to be the first item in the body of a
function. They are not specifically recognized in the parser, and not in
the tokenizer either. Thus we should follow the same approach.

Tests were updated.

This also fixed the warning:

    + re2c -W -b tokenizer.re -o tokenizer.cpp
    tokenizer.re:684:20: warning: unreachable rule (shadowed by rule at line 677) [-Wunreachable-rules]
@certik certik merged commit 5cfc162 into lcompilers:main Apr 2, 2022
@certik certik deleted the docstring branch April 2, 2022 21:43
@certik
Copy link
Contributor Author

certik commented Apr 2, 2022

I am going to merge it, I think this is the correct fix.

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.

1 participant