Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of change does this PR perform?
Summary
Merges the full v0.7.0 update into main.
Changes
KipperTypeChecker
responsible for handling type checking in Kipper code.KipperSemanticChecker
responsible for handling general semantic analysis, and integrity and cohesion checks.-s/--stringCode
for using the CLI.Does this PR create new warnings?
No.
Changelog
Added
(#26).
AssignmentExpression
andVariableDeclaration
.call print(identifier)
identifier + identifier
oridentifier + 5
-s/--stringCode
, which can be used as a replacement for the argumentfile
.(#100). This flag is available for
kipper analyse
,kipper compile
andkipper run
)VariableDeclarationSemantics.value
, which represents the expression that was assigned in the definition.This field is
undefined
ifVariableDeclarationSemantics.isDefined
isfalse
.CompileAssert.validAssignment()
, which asserts that an assignment expression is valid.abstract CompilableParseToken.semanticTypeChecking()
, which must be implemented by every child and should serveas a separate semantic type checking step outside of
primarySemanticAnalysis()
.KipperAsserter
, which is an abstract base class that represents a class that can be used to assert certain truthsand handle/throw compile errors.
KipperTypeChecker
andKipperSemanticChecker
, which perform specialised semantic checking and verify logicalintegrity and cohesion. These two classes replace
CompileAssert
.InvalidAssignmentError
, which is thrown when an invalid assignment is used.KipperInvalidInputError
, which is thrown when passing invalid input to the Kipper cli.Changed
standard expressions a lot faster from no on.
type of string additive expressions causing invalid type errors when used with other expressions.
Lexer, when reading files using the
utf16le
encoding.files using the
utf16le
encoding. From now on a buffer will be created using the proper encoding (also forascii
andutf8
) that should be properly writable to a file.expressions with the same operator (
N + N + N
) resulting in incomplete TypeScript code.return type of string expressions.
compiler
folder structure of the core package:compiler/parser
from now on contains everything parser and lexer-related.compiler/parser/antlr
from now on contains the Antlr4 generated parser and lexer files.compiler/semantics
from now on contains everything semantics related, such as the file listener, the Kippertokens, logical constants etc.
compiler/translation
from now on contains the classes and tools used for translating Kipper code into anotherlanguage.
compiler/targets
from now on contains the existing targets for Kipper, such astypescript
.compiler/lib
from now on contains the standard library and built-ins for Kipper.compiler/lib/import
from now on contains the default importable libraries for Kipper.InvalidTypeError
toTypeError
.KipperProgramContext.addNewGlobalScopeEntry
toaddGlobalVariable()
.CompoundStatement.addNewLocalVariable
toaddLocalVariable()
.Removed
#110.
may be used.)
only be overwritten or modified, but not re-declared. This should help make Kipper have a similar behaviour to
TypeScript.
Linked other issues or PRs
KipperSemanticChecker
andKipperTypeChecker
#125KipperSemanticChecker
andKipperTypeChecker
as a replacement forCompileAssert
#124@kipper/core
package #123num
#111utf16le
encoding #114-c
) #113--stringCode
to CLI commandscompile
,run
andanalyse
to allow the use of Kipper code strings as command line arguments #112--stringCode
to commandscompile
,run
andanalyse
to allow the use of code as a cmd argument #100InvalidArithmeticOperationError
thrown when using"4" + 4;
#104