Skip to content

Commit

Permalink
Merge pull request #510 from Kipper-Lang/435-451-491-bug-fixes-sync-t…
Browse files Browse the repository at this point in the history
…o-v0-11

Sync bug fixes for issues #435, #451 & #491 to `v0.11`
  • Loading branch information
Luna-Klatzer authored Oct 21, 2023
2 parents 7458beb + 096f221 commit 1fc86d4
Show file tree
Hide file tree
Showing 76 changed files with 4,085 additions and 3,441 deletions.
62 changes: 43 additions & 19 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,83 @@
<!--
Please read through the given
Comments are marked by arrows, like in lines 1 and 5. They will not be visible in the final pull request!
-->

## What type of change does this PR perform?

<!-- Add an x in the checkbox to mark it -->
<!-- Please put an X in the box of the line that applies -->
<!-- If you are unsure if your code is a breaking change, read this: https://nordicapis.com/what-are-breaking-changes-and-how-do-you-avoid-them -->

- [ ] Info or documentation change (Non-breaking change that updates dependencies, info files or online documentation)
- [ ] Website feature update or docs development changes (Change that changes the design or functionality of the websites or docs)
- [ ] Maintenance (Non-breaking change that updates dependencies)
- [ ] Info or documentation change (Non-breaking change that updates repo info files (e.g. README.md, CONTRIBUTING.md, etc.) or online documentation)
- [ ] Website feature update or docs development changes (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 to not work as expected.)
- [ ] 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

<!-- If you are unsure if your code is a breaking change, read this: https://nordicapis.com/what-are-breaking-changes-and-how-do-you-avoid-them -->

## Summary

<!-- Explain the reason for this pr, changes and solution briefly. -->
<!-- Explain the reason for this pr, changes, and solution briefly. -->

<!-- Write here -->
<!-- REPLACE ME -->

Closes # <!-- Remove this if this is not related to an issue -->
<!-- Uncomment if this closes an issue:
Closes #INSERT_NR
-->

## Summary of Changes
## List of Changes

<!-- Please explain the changes in this PR and their influence. If this fixes an issue, describe what fixed the issue. -->

<!-- Write here -->
<!-- Create for every essential change a list item (Link any issues, discussions or PRs if needed!) -->

- Change Nr. 1
- Change Nr. 2
- ...

## Does this PR create new warnings?

<!-- Add any new warnings or possible issues that could occur with this PR. -->

- Eslint reported ...
- CodeQL returned ...
- Warning Nr. 1
- Warning Nr. 2
- ...

<!-- Remove example text! -->
<!-- Just write none if they are no warnings, like this:
None.
-->

## Detailed Changelog

_Not present for website/docs changes_

<!-- Detailed changelog that may be copied from `CHANGELOG.md` (Only add the items you've added and remove any header with no item.). -->

<!-- ### Added -->
<!-- ### Changed -->
<!-- ### Removed -->
### Added

### Changed

### Fixed

### Deprecated

<!-- Default: -->
### Removed

<!-- Just write none if they are no changelog entries (although you should definitely do some if they change source code), like this:
None.
-->

## Linked issues or PRs

<!-- Include other issues and PRs related to this if any exist. Use this format: - [ ] #ISSUE_OR_PR -->

<!-- Default: -->
- [ ] #ISSUE_PR_OR_DISCUSSION_TAG
- [ ] #ISSUE_PR_OR_DISCUSSION_TAG
- [ ] ...

<!-- Just write the following if there are no linked issues:
No linked issues.
-->
2 changes: 1 addition & 1 deletion .github/workflows/cov-badge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
node-version: ${{ matrix.node-version }}
- uses: pnpm/[email protected]
with:
version: 7.x.x
version: 8.x.x
run_install: false
- run: pnpm install --frozen-lockfile
- run: pnpm test
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/nodejs-cli-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
node-version: [16.x, 18.x]

steps:
- uses: actions/checkout@v3
Expand All @@ -22,7 +22,7 @@ jobs:
node-version: ${{ matrix.node-version }}
- uses: pnpm/[email protected]
with:
version: 7.x.x
version: 8.x.x
run_install: false
- run: pnpm install --frozen-lockfile
- run: pnpm build
Expand All @@ -34,7 +34,7 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
node-version: [16.x, 18.x]

steps:
- uses: actions/checkout@v3
Expand All @@ -44,7 +44,7 @@ jobs:
node-version: ${{ matrix.node-version }}
- uses: pnpm/[email protected]
with:
version: 7.x.x
version: 8.x.x
run_install: false
- run: pnpm install
- run: pnpm build
Expand All @@ -56,7 +56,7 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
node-version: [16.x, 18.x]

steps:
- uses: actions/checkout@v3
Expand All @@ -66,7 +66,7 @@ jobs:
node-version: ${{ matrix.node-version }}
- uses: pnpm/[email protected]
with:
version: 7.x.x
version: 8.x.x
run_install: false
- run: pnpm install --frozen-lockfile
- run: pnpm build
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/nodejs-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
node-version: [16.x, 18.x]

steps:
- uses: actions/checkout@v3
Expand All @@ -19,7 +19,7 @@ jobs:
node-version: ${{ matrix.node-version }}
- uses: pnpm/[email protected]
with:
version: 7.x.x
version: 8.x.x
run_install: false
- run: pnpm install --frozen-lockfile
- run: pnpm test
Expand All @@ -30,7 +30,7 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
node-version: [16.x, 18.x]

steps:
- uses: actions/checkout@v3
Expand All @@ -40,7 +40,7 @@ jobs:
node-version: ${{ matrix.node-version }}
- uses: pnpm/[email protected]
with:
version: 7.x.x
version: 8.x.x
run_install: false
- run: pnpm i
- run: pnpm test
24 changes: 16 additions & 8 deletions .github/workflows/size-limit.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
name: "Size Limit"
on: pull_request
jobs:
size:
size-limit:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
env:
CI_JOB_NUMBER: 1
steps:
- uses: actions/checkout@v3
- uses: pnpm/[email protected]
- name: Checkout repository
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
version: 7.0.0
node-version: ${{ matrix.node-version }}
- name: Install PNPM & dev dependencies
uses: pnpm/[email protected]
with:
version: 8.x.x
run_install: |
- recursive: true
- name: Build project
- name: Build project to allow for browserify to run
run: pnpm build
- name: Setup size-limit
run: pnpm i
- uses: andresz1/[email protected]
- name: Run size-limit
uses: andresz1/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
script: pnpm exec size-limit --json
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ kipper-standalone.min.js
kipper/web/src/
*.yaml
*.json
CITATION.cff
80 changes: 77 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ To use development versions of Kipper download the

### Changed

- Standardised error output for the CLI as described in [#435](https://github.com/Luna-Klatzer/Kipper/issues/435).
(This is the same change as in `0.10.3`, but was only added to the dev branch with the release of `0.11.0-alpha.1`
i.e. `0.11.0-alpha.0` does _not_ have this change).
- Made `VoidOrNullOrUndefinedPrimaryExpression` a constant expression and inherit from the `ConstantExpression` class.
This means it's AST kind number is now also added to the `ASTConstantExpressionKind` type and its context class is
also part of the `ParserConstantExpressionContext` type.
Expand Down Expand Up @@ -123,13 +126,81 @@ To use development versions of Kipper download the
of an error being thrown the failed result was returned (As defined in the `recover` behaviour, which is incorrect).
- Bug of invalid underline indent in error traceback.
([#434](https://github.com/Luna-Klatzer/Kipper/issues/434)).
- CLI bug where the `-t` shortcut flag was incorrectly shown for the command `help compile`.
([#451](https://github.com/Luna-Klatzer/Kipper/issues/451)) (This is the same fix as in `0.10.3`, but was only
added to the dev branch with the release of `0.11.0-alpha.1` i.e. `0.11.0-alpha.0` still has this bug).
- CLI error handling bug as described in [#491](https://github.com/Luna-Klatzer/Kipper/issues/491). This includes
multiple bugs where errors were reported as "Unexpected CLI Error". (This is the same fix as in `0.10.4`, but with one
additional edge-case covered. This fix was only added to the dev branch with the release of `0.11.0-alpha.1` i.e.
`0.11.0-alpha.0` still has this bug).

### Deprecated

### Removed

</details>

## [0.10.4] - 2023-08-15

### Changed

- Moved function `executeKipperProgram` to `Run` as a private function.
- Moved class `KipperCompileResult` to new file `compile-result.ts` in the same directory.
- Field `KipperCompileResult.programCtx` can now be also `undefined`, due to the changed behaviour that now
a `KipperCompileResult` is also returned for syntax errors (where it has no value).

### Fixed

- CLI error handling bug as described in [#491](https://github.com/Luna-Klatzer/Kipper/issues/491). This includes
multiple bugs where errors were reported as "Unexpected CLI Error".

### Deprecated

- CLI flag `--abort-on-first-error` in favour of `--no-recover`. [#501](https://github.com/Luna-Klatzer/Kipper/issues/501).

## [0.10.3] - 2023-07-22

### Added

- New modules in `@kipper/cli`:
- `input`, which contains all input-related handling functions and classes.
- `output`, which contains the output-related handling functions and classes.
- New decorator `prettifiedErrors` in `@kipper/cli`, which applies standardised error formatting to any thrown error.

### Changed

- Standardised error output for the CLI as described in [#435](https://github.com/Luna-Klatzer/Kipper/issues/435).
- Error message of `KipperInternalError`, which does not have " - Report this bug to the developer using the traceback!"
as a suffix anymore.
- Changed success message of the `kipper analyse` command `Finished code analysis in ...` to `Done in ...`.
- Renamed `getFile` to `getParseStream`.

### Fixed

- CLI bug where the `-t` shortcut flag was incorrectly shown for the command `help compile`.
([#451](https://github.com/Luna-Klatzer/Kipper/issues/451))

## [0.10.2] - 2023-06-16

### Added

- New field:
- `KipperError.programCtx`, which contains, if `KipperError.tracebackData.errorNode` is not undefined, the program
context of the error.
- New function:
- `ensureScopeDeclarationAvailableIfNeeded`, which ensures that a scope declaration is available if needed. This
is used during the semantic analysis/type checking of a declaration statement, which may need the scope
declaration object during the processing.

### Fixed

- Redeclaration bug causing an `InternalError` after calling the compiler
([#462](https://github.com/Luna-Klatzer/Kipper/issues/462)).
- Compiler argument bug in `KipperCompiler`, where `abortOnFirstError` didn't precede `recover`, meaning that instead
of an error being thrown the failed result was returned (As defined in the `recover` behaviour, which is incorrect).
- Bug of invalid underline indent in error traceback.
([#434](https://github.com/Luna-Klatzer/Kipper/issues/434)).

## [0.10.1] - 2023-02-21

### Fixed
Expand Down Expand Up @@ -329,7 +400,7 @@ To use development versions of Kipper download the
- `ConstructableASTDeclaration`, which is a union type of all possible `Declaration` AST node instances.
- `ConstructableASTNode`, which is a union type of all possible `ASTNode` AST node instances.
- `ASTKind`, which represents a union of all AST node kind values that can be used to map a KipperParser rule context
to an AST node. This is the type representing all values from `ParseRuleKindMapping`.
to an AST node. This is the type representing all values from `ParserASTMapping`.
- `ConstructableASTKind`, which is the same as `ASTKind`, but removes any kind value that does not have a
corresponding AST node class.
- `KipperReferenceableFunction`, which represents a function that can be referenced by a `FunctionCallExpression`.
Expand Down Expand Up @@ -375,7 +446,7 @@ To use development versions of Kipper download the
- New constants:
- `kipperNullType`, which represents the Kipper null type.
- `kipperUndefinedType`, which represents the Kipper undefined type.
- `ParseRuleKindMapping`, which is a special mapping object used to get the AST kind number for a `KipperParser` rule ctx
- `ParserASTMapping`, which is a special mapping object used to get the AST kind number for a `KipperParser` rule ctx
instance.
- `kipperRuntimeBuiltInVariables`, which contains the built-in variables of the Kipper runtime.

Expand Down Expand Up @@ -1258,7 +1329,10 @@ To use development versions of Kipper download the

- Updated file structure to separate `commands` (for `oclif`) and `compiler` (for the compiler source-code)

[unreleased]: https://github.com/Luna-Klatzer/Kipper/compare/v0.10.1...HEAD
[unreleased]: https://github.com/Luna-Klatzer/Kipper/compare/v0.10.4...HEAD
[0.10.4]: https://github.com/Luna-Klatzer/Kipper/compare/v0.10.3...v0.10.4
[0.10.3]: https://github.com/Luna-Klatzer/Kipper/compare/v0.10.2...v0.10.3
[0.10.2]: https://github.com/Luna-Klatzer/Kipper/compare/v0.10.1...v0.10.2
[0.10.1]: https://github.com/Luna-Klatzer/Kipper/compare/v0.10.0...v0.10.1
[0.10.0]: https://github.com/Luna-Klatzer/Kipper/compare/v0.9.2...v0.10.0
[0.9.2]: https://github.com/Luna-Klatzer/Kipper/compare/v0.9.1...v0.9.2
Expand Down
Loading

0 comments on commit 1fc86d4

Please sign in to comment.