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

Cleanup and fix operator predicates #272

Merged
merged 5 commits into from
May 11, 2023
Merged

Conversation

c42f
Copy link
Member

@c42f c42f commented May 11, 2023

Remove big lists of operator kinds and inscrutable hardcoded unicode
ranges in predicates. Instead, generate all this code directly from the
table of operator kinds.

This makes new operators much easier to add in a single place in the
code, thereby fixing a few bugs/inconsistencies which have crept in over
time as new operators were added.

Also fix several bugs in the tokenizer where is_operator_start_char()
was used, but the check should have been restricted to dottable
operators.

c42f added 4 commits May 12, 2023 06:18
Remove big lists of operator kinds and inscrutable hardcoded unicode
ranges in predicates. Instead, generate all this code directly from the
table of operator kinds.

This makes new operators much easier to add in a single place in the
code, thereby fixing a few bugs/inconsistencies which have crept in over
time as new operators were added.

Also fix several bugs in the tokenizer where `is_operator_start_char()`
was used, but the check should have been restricted to dottable
operators.
Now that this code is much cleaner and shorter it makes sense to have
the whole lexer in one file.
@codecov
Copy link

codecov bot commented May 11, 2023

Codecov Report

Merging #272 (cddc197) into main (8f8ba0d) will increase coverage by 0.08%.
The diff coverage is 97.64%.

@@            Coverage Diff             @@
##             main     #272      +/-   ##
==========================================
+ Coverage   96.57%   96.65%   +0.08%     
==========================================
  Files          15       14       -1     
  Lines        3999     4005       +6     
==========================================
+ Hits         3862     3871       +9     
+ Misses        137      134       -3     
Impacted Files Coverage Δ
src/kinds.jl 80.59% <90.90%> (ø)
src/literal_parsing.jl 97.55% <100.00%> (ø)
src/tokenize.jl 98.88% <100.00%> (+0.53%) ⬆️

@c42f c42f merged commit d79b9e9 into main May 11, 2023
@c42f c42f deleted the c42f/operator-predicate-rewrite branch May 11, 2023 22:51
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