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

Added support for compiler behaviour modifying pragma comments #595

Conversation

ByteWolf-dev
Copy link
Contributor

@ByteWolf-dev ByteWolf-dev commented Jul 4, 2024

What type of change does this PR perform?

  • Info or documentation change (Non-breaking change that updates repo info files (e.g. README.md, CONTRIBUTING.md, etc.) or online documentation)
  • Website (Change that changes the design or functionality of the websites or docs)
  • Development or internal changes (These changes do not add new features or fix bugs, but update the code in other ways)
  • Bug fix (Non-breaking change which fixes an issue)
  • New feature (Non-breaking change which adds functionality)
  • Breaking change (Major bug fix or feature that would cause existing functionality not to work as expected.)
  • Requires a documentation update, as it changes language or compiler behaviour

Summary

Added ability to process FileScoped Pragmas.

Closes #480

Detailed Changelog

Added

  • New constants:
    • DEFAULT_TOKEN_CHANNEL, which is the channel id of the default channel storing all the parser-relevant tokens that
      the Lexer lexed.
    • HIDDEN, which is the channel id of the channel storing all whitespaces and newlines that the Lexer lexed.
    • COMMENT, which is the channel id of the channel storing all the comments that the Lexer lexed.
    • PRAGMA, which is the channel id of the channel storing all pragma comments that the Lexer lexed.
  • New fields:
    • LexerParserData.channels, which stores the channels generated by the Lexer.
  • Implemented Processing for File Scoped Pragmas (#480)
  • PragmaProcessor which handles the processing of all possible Pragmas.
  • PragmaProcessor.processSingleLine(), which changes the compiler options according to the pragmas found in the file.
  • New functions:
    • PragmaProcessor.processSingleLine(), which changes the compiler options according to the pragmas found in the file.

Changed

  • Renamed:
    • Module compiler/parser to lexer-parser.
    • File kipper/core/compiler/parser/parser-ast-mapping.ts to parse-rule-kind-mappings.ts.
    • Class KipperParseStream to KipperFileStream including its file to file-stream.ts.
    • CLI Class KipperParseFile to KipperInputFile including its file to input-file.ts.
    • Interface ParseData to LexerParserData.
    • Field FStringPrimaryExpressionSemantics.items to atoms.
    • Field LexerParserData.parseStream to fileStream.

Does this PR create new warnings?

None.

Linked issues or PRs

@ByteWolf-dev ByteWolf-dev linked an issue Jul 4, 2024 that may be closed by this pull request
5 tasks
@ByteWolf-dev ByteWolf-dev self-assigned this Jul 4, 2024
Copy link
Contributor

github-actions bot commented Jul 4, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
./kipper/web/kipper-standalone.min.js 140.8 KB (+0.2% 🔺) 2.9 s (+0.2% 🔺) 3.5 s (+12.59% 🔺) 6.3 s
./kipper/web/kipper-standalone.js 140.84 KB (+0.2% 🔺) 2.9 s (+0.2% 🔺) 3.2 s (+12.13% 🔺) 6 s

Copy link

codecov bot commented Jul 4, 2024

Codecov Report

Attention: Patch coverage is 98.05825% with 2 lines in your changes missing coverage. Please review.

Project coverage is 83.66%. Comparing base (94f91f9) to head (fa3f1d1).

Files Patch % Lines
kipper/cli/src/input/input-file.ts 87.50% 1 Missing ⚠️
kipper/core/src/compiler/pragma-processor.ts 92.30% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           dev-next     #595      +/-   ##
============================================
+ Coverage     83.35%   83.66%   +0.31%     
============================================
  Files           217      219       +2     
  Lines          3820     3850      +30     
  Branches        426      428       +2     
============================================
+ Hits           3184     3221      +37     
+ Misses          453      447       -6     
+ Partials        183      182       -1     

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

@Luna-Klatzer Luna-Klatzer changed the title 480 feature add support for compiler behaviour modifying pragma comments Added support for compiler behaviour modifying pragma comments Jul 4, 2024
@Luna-Klatzer Luna-Klatzer changed the base branch from main to dev-next July 4, 2024 08:51
@Luna-Klatzer Luna-Klatzer added the feature New feature or enhancement label Jul 4, 2024
@Luna-Klatzer Luna-Klatzer added this to the v0.11.0 milestone Jul 4, 2024
@Luna-Klatzer Luna-Klatzer merged commit 9a4dd5c into dev-next Jul 4, 2024
37 checks passed
@Luna-Klatzer Luna-Klatzer deleted the 480-feature-add-support-for-compiler-behaviour-modifying-pragma-comments branch July 4, 2024 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or enhancement
Projects
Development

Successfully merging this pull request may close these issues.

[Feature] Add support for compiler-behaviour-modifying pragma comments
2 participants