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

Parser change #15

Merged
merged 6 commits into from
Mar 11, 2024
Merged

Parser change #15

merged 6 commits into from
Mar 11, 2024

Conversation

jClugstor
Copy link
Collaborator

@jClugstor jClugstor commented Mar 11, 2024

Checklist

  • [x ] Appropriate tests were added
  • [x ] Any code changes were done in a way that does not break public API
  • [x ] All documentation related to code changes were updated
  • [x ] The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • [x ] Any new documentation only uses public API

Additional context

This switches the parser library used to ParserCombinator.jl instead of Automa.jl.
Automa.jl does not support backtracking, which requires the regex machine it compiles to be unambiguous, or ambiguity errors can happen during the parsing. This makes it difficult to translate the grammar of Base Modelica to something it can use.

ParserCombinators is able to backtrack, which makes it easier to put the whole grammar in, even if it's ambiguous at points.

This should add all of the grammar found in the Base Modelica proposal.

This should make it actually feasible to add most of the more advanced Base Modelica things that need to be supported. Records, custom types, if statements, when equations etc. should be able to be parsed, but do not have Julia representations yet. But this makes it possible to implement them in the future.

Adresses #10

Copy link

codecov bot commented Mar 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.38%. Comparing base (08ca171) to head (e981e01).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##            main      #15       +/-   ##
==========================================
+ Coverage   1.58%   94.38%   +92.79%     
==========================================
  Files          4        4               
  Lines         63       89       +26     
==========================================
+ Hits           1       84       +83     
+ Misses        62        5       -57     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ChrisRackauckas ChrisRackauckas merged commit f376fd6 into SciML:main Mar 11, 2024
8 of 12 checks passed
@jClugstor jClugstor deleted the parser_change branch March 12, 2024 13:18
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