- When generating `extern ...` statements for a given `Module` only tack on the `extern` to the emit if it is NOT `isExternal()` (if it is not a TLang externed variable/function). This is because those would already have them via the call to the signature generation function. This updates the `emitxterns(Module, File)` method.
- When generating signatures for `Variable`(s) ensure that ones which have `isExternal()` return `true` have `extern ...` added to the front og the generated signature. This updates the `generateSignature_Variable(Variable var)` method.
- Added `generateSignature_Variable(Variable var)` which generates JUST a variable signature (with symbol mapping)
- `emitExterns(File modOut, Module mod)` now also generates extern statements for global variables
* Dependency
- Added `varRefCounts` which maps a given `Variable` to its reference count. This includes the declaration thereof.
- Added `touch(Variable variable)` which Increments the given variable's reference count
* Dependency
- When handling a standalone assignment to a variable increment it's reference count
- This was updated in the handling of `VariableAssignmentStdAlone`
* Dependency
- Make variable declaration count as the first reference
* Dependency
- VAriables that appear in expressions must increase the ref count
* Dependency
- Added `getUnusedVariables()` which returns all variables which were declared but not used
* TypeChecker
- Moved the reference counting mechanism into the `TypeChecker` to avoid problem of seperate `DNodeGenerator` instances having their own seperate counts
- We now check the reference count values after function definition processing so as to get a proper count
Dependency
- Use the reference counting from `TypeChecker`
- Removed reference counting code
Test cases
- Added a positive case in the form of `unused_vars.t`
- Added a negative case in the form of `unused_vars_none.t`
* Commands
- Added commands to `TypeCheckerBase!()` mixin template
- Added `TypeCheckerInit(Compiler compiler)`
- Use the template in both `compile` command and the`typecheck` command
* TypeChecker
- We now respect the `typecheck:warnUnusedVars` option
* TypeChecker
- Added `doPostChecks()`
- Moved the reference counting code to `doPostChecks()`
* Configuration
- `defaultConfig()` now adds an entry for `typecheck:warnUnusedVars` set to `true`
* TypeChecker
- Use `getName()` on the `Variable` when printing out the names of unused variables
* Compiler
- Made `gibFileData(string sourceFile)` public
- Added `getTypeChecker()` to the `Compiler` class
* TypeChecker (unittests)
- Added a positive test case unittest for the unused variables detection mechanism
* TypeChecker (unittests)
- Check the variable is equal to the one we are looking for (`j`)
* TypeChecker (unittests)
- Added a negative test case for the unused variables detection mechanism
* Pipelines
- Added tests for `unused_vars.t` and `unused_vars_none.t`
* TypeChecker
- Fixed message which prints out when an unused variable is detected
* Merge branch 'vardec_varass_dependency' into feature/unused_vars_detection
- Added `ParseBase` mixin template, this contains the support for `--paths` command-line option
- `compileCommand` now mixes in `ParseBase` and `TypeCheckerBase` and initializes the `ParseBaseInit()` as well
- `parseCommand` now mixes in `ParseBase` and initializes the `ParseBaseInit()` as well
- `typecheckCommand` now mixes in `ParseBase` and `TypeCheckerBase` and initializes the `ParseBaseInit()` as well
- Fixed bug in `findAllTFilesShallow(string directory)` whereby we would never check `directory` to be a valid path nor even a path (if valid) to a directory - which is required in order to run `dirEntries(...)` on it
- Neatened up
- Removed check for `statement !is null` from `resolveWithin(..., ...)` because that should honestly never be the case. In the case it ever is stuff would still work, but it won't
- Formatted code
- Added docs