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

v0.10.0-alpha.1 #267

Merged
merged 55 commits into from
Aug 2, 2022
Merged

v0.10.0-alpha.1 #267

merged 55 commits into from
Aug 2, 2022

Conversation

Luna-Klatzer
Copy link
Member

What type of change does this PR perform?

  • New feature (Non-breaking change which adds functionality)

Summary

New development version v0.10.0-alpha.1, which implements a new type system and semantic analysis algorithm with a new error recovery system. This allows the compiler to recover from most errors and handle issues so that the compiler doesn't abort on the first error it encounters.

Summary of Changes

  • Updated semantic analysis behaviour of CompilableASTNode.
  • Implemented error recovery behaviour as described in [Feature] Implement error recovery for the Kipper compiler #198 to allow multiple errors to be reported, without the compiler failing on the first error it encounters.
  • Implemented new type system using the new semantics type TypeData and generic argument TypeSemantics in all AST nodes. This new system migrates all type-related data from the primarySemanticAnalysis() to semanticTypeChecking().
  • Added new CompileConfig options recover and abortOnFirstError.
  • Added new flag --log-timestamp, --recover and --abort-on-first-error to commands compile and run.

Does this PR create new warnings?

No.

Detailed Changelog

Added

  • New generic parameter TypeSemantics to ASTNode, which defines the type data that the AST Node should evaluate during type checking.
  • New CLI flags for commands run and compile:
    • --log-timestamp, which enables timestamps for the log messages.
    • --recover, which enables error recovery for the Kipper compiler.
    • --abort-on-first-error, which aborts the compilation on the first compiler error that is encountered.
  • New classes:
    • KipperWarning, which is a subclass of KipperError that is used to indicate a warning.
      This replaces the use of KipperError for warnings.
  • New functions:
    • ASTNode.getTypeSemantics, which returns the type semantics if they are defined, otherwise throws an UndefinedSemanticsError.
    • CompilableASTNode.semanticTypeChecking, which performs type checking for the AST node and its children nodes. This is called in the function RootASTNode.semanticAnalysis after CompilableASTNode.semanticAnalysis().
    • CompilableASTNode.wrapUpSemanticAnalysis, which performs wrap-up semantic analysis for the target of the AST node. This is called in the function RootASTNode.semanticAnalysis after CompilableASTNode.semanticTypeChecking().
  • New types:
    • TypeData, which represents the type data of an ASTNode.
    • NoTypeSemantics, which hints that an ASTNode has no type semantic data.
  • New fields/properties:
    • CompileConfig.recover, which if set enables compiler error recovery.
    • CompileConfig.abortOnFirstError, which changes the compiler error handling behaviour and makes it
      abort on the first error encountered. This overwrites recover per default.
    • ASTNode.typeSemantics, which contains the type data for an ASTNode that was evaluated during type checking.
    • ScopeFunctionDeclaration.typeData, which returns the type data of the function AST node.
    • ScopeVariableDeclaration.typeData, which returns the type data of the variable AST node.

Changed

  • Updated behaviour of the Compiler semantic analysis and implemented a basic error recovery system. (#198)
  • Updated behaviour of Kipper Compiler semantic analysis and separated primary semantic analysis, type checking and target-specific semantic analysis into their own processing steps. (E.g. First, all AST nodes are semantically analysed, then type checked and semantically analysed for the target language)
  • Renamed:
    • UnableToDetermineMetadataError to UndefinedSemanticsError.

Removed

  • KipperError.isWarning, which has been replaced by the new class KipperWarning.

Linked other issues or PRs

Luna-Klatzer and others added 30 commits July 28, 2022 13:04
…very-for-the-kipper-compiler' into 198-feature-implement-error-recovery-for-the-kipper-compiler
…very-for-the-kipper-compiler' into 198-feature-implement-error-recovery-for-the-kipper-compiler

# Conflicts:
#	CHANGELOG.md
…very-for-the-kipper-compiler' into 198-feature-implement-error-recovery-for-the-kipper-compiler
@Luna-Klatzer Luna-Klatzer added release New release of the Kipper module. skip changelog Do not include in the changelog when a new release is drafted labels Aug 2, 2022
@Luna-Klatzer Luna-Klatzer added this to the Stable Kipper Release milestone Aug 2, 2022
@Luna-Klatzer Luna-Klatzer self-assigned this Aug 2, 2022
@Luna-Klatzer Luna-Klatzer marked this pull request as ready for review August 2, 2022 12:53
@codecov
Copy link

codecov bot commented Aug 2, 2022

Codecov Report

Merging #267 (6427027) into main (865722f) will increase coverage by 0.14%.
The diff coverage is 86.47%.

@@            Coverage Diff             @@
##             main     #267      +/-   ##
==========================================
+ Coverage   86.25%   86.40%   +0.14%     
==========================================
  Files          55       55              
  Lines        3325     3442     +117     
  Branches      207      212       +5     
==========================================
+ Hits         2868     2974     +106     
- Misses        384      390       +6     
- Partials       73       78       +5     
Impacted Files Coverage Δ
kipper/cli/src/errors.ts 54.54% <0.00%> (ø)
.../src/compiler/semantics/semantics-error-handler.ts 83.33% <ø> (ø)
...src/compiler/semantics/target-semantic-analyser.ts 100.00% <ø> (ø)
...er/core/src/compiler/translation/code-generator.ts 100.00% <ø> (ø)
kipper/cli/src/commands/run.ts 40.00% <36.36%> (-1.67%) ⬇️
kipper/cli/src/logger.ts 66.66% <50.00%> (+3.03%) ⬆️
kipper/core/src/logger.ts 74.28% <50.00%> (-2.86%) ⬇️
kipper/core/src/errors.ts 76.41% <60.00%> (-0.95%) ⬇️
kipper/cli/src/commands/compile.ts 79.31% <69.23%> (-7.36%) ⬇️
kipper/cli/src/compile.ts 88.88% <71.42%> (-6.12%) ⬇️
... and 22 more

Help us with your feedback. Take ten seconds to tell us how you rate us.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 2, 2022

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
./kipper/core/kipper-standalone.min.js 115.83 KB (+0.59% 🔺) 2.4 s (+0.59% 🔺) 153 ms (+58.21% 🔺) 2.5 s
./kipper/core/kipper-standalone.js 115.88 KB (+0.58% 🔺) 2.4 s (+0.58% 🔺) 124 ms (-12.5% 🔽) 2.5 s

@Luna-Klatzer Luna-Klatzer merged commit 176e75a into main Aug 2, 2022
@Luna-Klatzer Luna-Klatzer added this to the v0.10.0 milestone Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release New release of the Kipper module. skip changelog Do not include in the changelog when a new release is drafted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant