- 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
- Made the `toString()` method non-final
- Implemented `produceToStrEnclose(string)` which will create the wrapper `[Instruction: <classNameHere>: <addInfo>]` where `<addinfo>` is the string parameter passed in
LiteralValue
- Implemented custom `toString()` - this will fix the whole updating opf types issue
- Removed now-completed TODO
Value
- Made the `type` field private and added a comment explaining it
- Implemented `setInstrType(Type)` and `Type getInstrType()`
TypeChecker
- Switched to using `getInstrType()` and `setInstrType()`
DGen
TypeChecker
- Switched to using `getInstrType()`
- Disabled all calls to `popType()`, `addType()`, etc.
- Disabled `StringExpression` processing for now
- Binary operator type selection is now done through the if-statement
- Removed purposeful assertion for handling `VariableAssignmentStdAlone` (for now)
- Added a note to fix the way we do standalone variable assignments, we should embed them in a way similiar to that of `VariableDeclaration`'s (with assignments enabled)
TypeChecker/Codegen
- Initial work on handling `IntegerLiteral` parser node types added
VariableAssignmentNode
- Push the type onto the typestack and make it the type fo what was popped (relates to the embedded instruction)
StaticVariableDeclaration
- Initial work on type coercion begun
VariableAssignmentStdAlone
- Make handling of this fail now till we do the dependency node fix up for this
DGen
- Added debug prints which until they stop segfaulting we will know if everything is okay
- Added a second parameter to the constructor for `IntegerLiteral`, this takes in the encoding of type `IntegerLiteralEncoding`
Parser
- Updated the `SymbolType.NUMBER_LITERAL` handling code to handle the new constructor for `IntegerLiteral`
- All `Value` instructions are to have a `Type` field named `type`
- Removed the `len` field in `LiteralValue`
- Replaced the `data` field of typr `ulong` with a `data` field of type `string` in `LiteralValue`
- Replaced the `data` field of typr `ulong` with a `data` field of type `string` in `LiteralValueFloat`
- Split `NumberLiteral` into an abstract class with two sub-classes for `IntegerLiteral` and `FloatingLiteral` (floating-point literals)
Parser
- Use new `IntegerLiteral` and `FloatingLiteral` based on the type of token (whether a `.` is present or not)
TypeChecker/Codegen
- Updated code to check for `NumberLiteral` sub-type
Test cases
- Added `simple_literals.t` for testing `literal_encodings` branch
- Added enum type `NumberLiteralEncoding` mimicking that of D's integer literals encoding variations
- Added an instance of `NumberLiteralEncoding` to `NumberLiteral` along with a `getEncoding()` method to fetch said field
Parser
- Added TODO
- Corrected import path for `compiler.lexer` -> `compiler.lexer.core`
Parser
- Corrected import path for `compiler.lexer` -> `compiler.lexer.core`
TypeChecker
- Corrected import path for `compiler.lexer` -> `compiler.lexer.core`
Compiler
- Moved configuration code outside of it
- Renamed to `compiler.core`
DGen
- Check for any object files to link in, if so append them to the `cc` call
Lexer
- Moved from `compiler.lexer` to `compiler.lexer.core`
Configuration
- Overhauled configuration system
Mapper
- Added definition to `SymbolMappingTechnique`
Command-line
- Migrated to new configuration system
- Migrated `SymbolMappingTechnique` to Mapper module
- Added support for specifying object fils to link in using the `-ll` flag`
Tests
- Added `file_io.c` for testing `simple_extern.t` with `extern_test.sh`
- Added `extern_test.sh` for testing `simple_extern.t`
- Upgraded to jcli 0.25.1-beta
- Added aggregate command-line arguments `library-link` to support future library linking
- Added stub mixin template `TypeCheckerBase`
- Made verbosity an optional flag
- Compiler flag name change
- Comment formatting
Compiler
- Implemented `getConfig()` in order to return the `Compiler` object's `CompilerConfiguration` instance
- Updated a configuration parameters name in the `defaultConfig()`
- Added some work-in-progress data structures `ConfigObject` and `ConfigList`
Command-line
- Added a plethorah of new flags and re-worked a lot of the common flags across the multiple commands to use mixins to avoid code duplication and enforce code re-use
- The compilation command now uses the `Compiler` object
- You can now control the symbol mapper used
- You can now set the verbosity level (no-oped currently)
- You can set the output filename
- You can set whether pretty code is to be used or not
- You can set whether or not to generate the entrypoint testing code during emit