- Added a TODO about a possible refactor to make things split out more
- Implemented `setCursor(ulong)` so that we can update the position of the token pointer
- Any attempt to dereference an entity of which is not a pointer type will now throw a `TypeCheckerException` instead of a failing assertion with a print-out
- On processing of binary operations, if there is a type mismatch now a `TypeMismatchException` will be thrown instead of a print0out followed by an `assert(false)`
- Corrected casted variable, was `literalInstr` but is meant to be `operandInstr`
- Added support for coercing signed literals in ranges for `byte`, `short`, `int` and `long`
- Added initial support for signed-literal coercion (e.g. `-1`)
- Set type for `UnaryOpInstr` (when doing `ADD` or `SUB` to the type of the embedded instruction (of type `Value` - this is soon to change in certain cases
Test cases
- Updated test case `simple_literals4.t`
- Updated test case `simple_literals5.t`
- Fixed module naming; autocomplete now works
Typing
- Added a TODO/NOTE comment
Parser
- Implemented range-based literal type encoding for integer literals
Check
- Switched from directly calling `isNumeric(string)` to our own `isNumericLiteral(string)` to check if a token is a `SymbolType.NUMBER_LITERAL`
Test cases
- Added new test case `simple_literals3.t`
- Updated `ParserException` to have a sub-error type `ParserErrorType`
- Updated `SyntaxError` to overwrite the exception's `msg` field
- Added literal encoding for integer support to parser
Typechecker
- Removed exception check which is now redundant seeing as literal overflows would be checked within the parser (way before typechecking begins)
- Added conversion support (type transfers) for the `LiteralValue` instruction codegen
- Removed uneeded sub-error type in `TypeCheckerException`'s `TypecheckError` (rempved `TypecheckError.LITERAL_OVERFLOW`)
- Corrected enum for error sub-type from `TypeheckError` to `TypecheckError`
- Added new sub-type error `TypecheckError.LITERAL_OVERFLOW`
- If the literal value is too big then throw a `TypeCheckerException`
- `TypeCheckerException` now inherits from `TError`
- `TypeCheckerException` now produces a neat error message using an enum `TypecheckError`
- Added new sub-class `TypeMismatchException` to be used when two types do not match
TypeChecker
- Hoisted out the coercion code into two methods, `isCoercibleRange` and `attemptCoercion`
- Make both variabel declarations (with assignments) and standlaone variable assignments call the `attemptCoercion()` method when the call to `isSameType(Type t1, Type t2)` returns `false`
Test cases
- Added new test case `simple_literals2.t`
- Made the `data` field `private` and now accessible through a call to `string getLiteralValue()`
UnaryOpInstr
- Use `Value` instead of `Instruction` for unary operator instructions
DGen
- Switched to using `getLiteralValue()` where required due to the aforementioned reasons
- Enable pretty code generation on the command-line by default
- Explicitly make the `SymbolMappingTechnique.HASHMAPPER` the default symbol translation technique
- Removed the `varDecWantsConsumeVarAss` as it is not used anymore
- The transformation of the `VariableAssignmentInstr` instruction (which is generated by a corresponding `VariableStdAloneAss` parser node) does not check for `varDecWantsConsumeVarAss` anymore and will directly `transform(varAss.data)` (the embedded `Value` instruction in the `VariableAssignmentInstr`
- If a `VariableDeclaration` instruction has an assignment then we extract the `Value` instruction from it and perform a `transform(Value)` - no longer do we have an intermediary `VariableAssignmentInstr`
Instruction
- `VariableDeclaration` now uses a `Value`-based instruction rather than a `VariableAssignmentInstr` as the embedded `varAssInstr`
Dependency
- The creation of a `StaticVariableDeclaration` DNode for `Variable`-declarations that happen to have assignments will now process such assignments by pooling the expression being assigned (via `expressionPass()` and then make the `VarDecNode` depend on it, therefore removing the intermediary `VariableAssignmentNode` dependency-node
Typechecker/Codegen
- When processing a variable declaration (a `StaticVariableDeclaration` dependency-node) we now pop an instruction which would be directly the `Value`-based instruction that we `need()`'d in the dependency generation (this links up with the changes made to the dependency generation for variable declarations)
- Set `context` field to `private` - enforcing usage of `setContext(Context)`/`getContext()`
CastedValueInstruction
- Removed field `castToType`, we may as well use the inherited field `type` for that seeing as the type we shall be after the cast is the `castToType`
- Ensured that the constructor copies over the parameter `castToType` to `this.type`
- Ensured that `getCastToType()` now returns `this.type`
TypeChecker
- Switched to using `setContext(Context)` in cases where `instr.context = <context...>` was being used