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

Semantic validation #201

Merged
merged 10 commits into from
Aug 18, 2021
Merged

Semantic validation #201

merged 10 commits into from
Aug 18, 2021

Conversation

riederm
Copy link
Collaborator

@riederm riederm commented Jul 20, 2021

  • adds validation.rs that implements a visitor
  • adds example validators (pou, variable)
  • adds location support for DataTypeDeclaration

Things to discuss:

  • shall we code the visitor by hand or do we switch to a more generic AST-representation? (I think manual is work, but its doable)
  • how much state do we need for the specific validators? or should they be pure functions without &self?
  • ...

@codecov
Copy link

codecov bot commented Jul 20, 2021

Codecov Report

Merging #201 (6c9086c) into master (18f2db2) will increase coverage by 0.10%.
The diff coverage is 90.15%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #201      +/-   ##
==========================================
+ Coverage   95.10%   95.20%   +0.10%     
==========================================
  Files          35       39       +4     
  Lines        9987    10539     +552     
==========================================
+ Hits         9498    10034     +536     
- Misses        489      505      +16     
Impacted Files Coverage Δ
src/parser/control_parser.rs 96.15% <0.00%> (ø)
src/typesystem.rs 95.91% <ø> (+0.54%) ⬆️
src/parser/expressions_parser.rs 96.96% <41.66%> (-0.53%) ⬇️
src/validation.rs 80.43% <80.43%> (ø)
src/lexer.rs 95.55% <83.33%> (+0.10%) ⬆️
src/index.rs 94.54% <88.00%> (+0.99%) ⬆️
src/lib.rs 95.93% <88.09%> (+5.65%) ⬆️
src/index/visitor.rs 95.91% <88.88%> (-0.29%) ⬇️
src/ast.rs 90.95% <93.93%> (+0.29%) ⬆️
src/parser.rs 97.81% <95.83%> (+0.08%) ⬆️
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 18f2db2...6c9086c. Read the comment docs.

@riederm riederm force-pushed the semantic_validation branch from 7fbcb0a to 31c0994 Compare July 25, 2021 20:27
_ adds validation.rs that implements a visitor
_ adds example validators (pou, variable)
_ adds location support for DataTypeDeclaration
also added location information for type-declaration
(explicit and inline)
AST gets now annotated with with additional information indicating
whether this element resolves to a variable, an expression (a value),
a Program, a Function or a Type (Struct, FB, etc.)
@riederm riederm force-pushed the semantic_validation branch from ee1ca1d to 268a9ec Compare August 16, 2021 20:14
@riederm riederm changed the title Semantic validation (first attempt - WIP) Semantic validation Aug 17, 2021
@riederm riederm requested a review from ghaith August 17, 2021 20:25
@riederm riederm marked this pull request as ready for review August 17, 2021 20:25
@riederm riederm merged commit f1069ea into master Aug 18, 2021
@riederm riederm deleted the semantic_validation branch August 18, 2021 06: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.

3 participants