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

Use "match ... with ..." statements in compiler and examples #699

Merged
merged 5 commits into from
Jan 26, 2025

Conversation

Akuli
Copy link
Owner

@Akuli Akuli commented Jan 26, 2025

The code is slightly longer, but much more readable.

Currently match some_byte: doesn't work, but match some_byte with bytecmp does, where bytecmp is the following function:

# TODO: should not be needed
def bytecmp(a: byte, b: byte) -> int:
    return (a as int) - (b as int)

compiler/tokenizer.jou Outdated Show resolved Hide resolved
@Akuli Akuli mentioned this pull request Jan 26, 2025
@Akuli Akuli merged commit dd896f4 into main Jan 26, 2025
38 checks passed
@Akuli Akuli deleted the use-match-with branch January 26, 2025 23:06
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