Commit Graph

1078 Commits

Author SHA1 Message Date
Tristan B. Velloza Kildaire 53b38e2e58 Compiler (unittests)
- Added tests `source/tlang/testing/complex_structs.t` and `source/tlang/testing/simple_structs.t`
2023-08-27 13:42:58 +02:00
Tristan B. Velloza Kildaire 8ab56bc519 Merge branch 'vardec_varass_dependency' into feature/structs 2023-08-27 13:03:19 +02:00
Tristan B. Velloza Kildaire e1d034cbe0
🐞️ Bugfix: Module-level static members may cause consecutive compilation errors (#30)
* Compiler

- Re-enabled compilation tests (partially)

* Dependency

- Fixed comment
- Implemented `clearFuncDefs()`

* TypeChecker

- Clear the `FunctionData[string]` table after a batch of typechecking/codegen such that we don't have lingering data from previous compilations which gets reliniearzed resulting in an exception being thrown as it was marked as linearized from its first time from a previous compilation

* Compiler

- Re-enabled unit tests for compilation
- Added TODO relating to adding failing test cases as well

* Compiler

- Added unit test for failing tests

* TypeCheck

- Use a scopre guard to call `clearFuncDefs()` such that it is called even when exceptions are thrown during depgen, typecheck/codegen ensuring we have it cleared for the next run

* Compiler

- Added `gibeFileData(string)` to easily read the source text
- Added all `typecheck` (good and bad) tests

* Pipelines

- Updated name

* Compiler (unittests)

- Re-ordered the test cases
- Commented them out

* Compiler

- Added documentation for `gibFileData(string)`
- Made `gibFileData(string)` private

* Compiler (unit tests)

- Documented unit test

* Compiler

- Cleaned up imports

* Compiler (unit tests)

- Added TODO
- Added spacing
2023-08-27 12:53:18 +02:00
Tristan B. Velloza Kildaire 16caf6ebec
Update d.yml 2023-08-21 14:57:12 +02:00
Tristan B. Velloza Kildaire f62ec5667f
Update README.md 2023-08-21 14:41:22 +02:00
Tristan B. Velloza Kildaire 8831ea51de
Update d.yml 2023-08-21 14:38:19 +02:00
Tristan B. Velloza Kildaire a60ce2a66f
Update d.yml 2023-08-21 14:36:07 +02:00
Tristan B. Velloza Kildaire e66b7750ab
Update d.yml 2023-08-21 14:33:58 +02:00
Tristan B. Velloza Kildaire ef9a461de2
Update d.yml 2023-08-21 14:33:12 +02:00
Tristan B. Velloza Kildaire 706d5053db
Update d.yml 2023-08-21 14:30:20 +02:00
Tristan B. Velloza Kildaire a8e3dae81f
Update d.yml 2023-08-21 14:25:38 +02:00
Tristan B. Velloza Kildaire 1b9b688337
Update d.yml 2023-08-21 14:23:20 +02:00
Tristan B. Velloza Kildaire 8201718774
Update d.yml 2023-08-21 14:22:04 +02:00
Tristan B. Velloza Kildaire 2417a5afe8
Update d.yml 2023-08-21 14:20:15 +02:00
Tristan B. Velloza Kildaire 3cf280d128
Update d.yml 2023-08-21 14:18:19 +02:00
Tristan B. Velloza Kildaire d226cdf761
Update d.yml 2023-08-21 14:17:03 +02:00
Tristan B. Velloza Kildaire caaf5ff4c4
Update d.yml 2023-08-21 14:14:55 +02:00
Tristan B. Velloza Kildaire 02fe3347eb
Update d.yml 2023-08-21 14:12:32 +02:00
Tristan B. Velloza Kildaire f7a8631729
Update d.yml 2023-08-21 14:10:50 +02:00
Tristan B. Velloza Kildaire 6f9498a355 Merge branch 'vardec_varass_dependency' into feature/structs 2023-08-20 15:41:52 +02:00
Tristan B. Velloza Kildaire c1da2e6296 DGen
- Removed now-completed NOTE comment
- Print out the C compiler being used
2023-08-20 15:28:05 +02:00
Tristan B. Velloza Kildaire 12daee5c44 DGen
- Lookup the value of `dgen:compiler` from the config and use that as the C compiler

Configuration

- Set default value of `dgen:compiler` to `"clang"`

Commands

- Added a command to specify the C compile to use
- Transfer `-cccompiler`/`-cc` over to a config entry
2023-08-20 15:26:54 +02:00
Tristan B. Velloza Kildaire ef0c817217 DGen
- Instead of returning the generated C emit code, set it in a local scope but at the highest scope variable `emmmmit`
2023-08-17 08:46:59 +02:00
Tristan B. Velloza Kildaire 54913483d0 Merge branches 'feature/behavec_preinline' and 'feature/structs' of github.com:tbklang/tlang into feature/structs 2023-08-16 20:05:28 +02:00
Tristan B. Velloza Kildaire 9e154e7269 DGen
- Use `tackon(string)` in `FunctionCall` instruction
- Added `isStatementLevel(Instruction)`
- In the exit scope guard call `yankPreinliner()` if `isStatementLevel(Instruction)` is `true`
2023-08-16 20:01:22 +02:00
Tristan B. Velloza Kildaire 7cf11a2e55 DGen
- WIP: Added depth counter to name
2023-08-16 16:53:58 +02:00
Tristan B. Velloza Kildaire dd30e4bdee DGen
- Added `tackonPreinline(emit) and `yankPreinline()`
- Now generates, albeit broken, preinline (needs global)
2023-08-16 16:38:58 +02:00
Tristan B. Velloza Kildaire f31b0af2a0 DGen
- Began work on adding pre-inling support for function calls
2023-08-16 16:20:08 +02:00
Tristan B. Velloza Kildaire fd31024a07 Compiler
- Now lookup `dgen:mapper` instead of `emit:mapper`

Configuration

- Now set `dgen:mapper` to `hashmapper` instead of `emit:mapper`
- Added `dgen_preinline_args` and set it to `false`

Commands

- Updated description for `symbol-mapper`/`sm` flag
- The `symbol-mapper`/`sm` flag now affects the `dgen:mapper` entry instead of the `emit:mapper` entry
- Transfer the flag value of `preinlineArguments`/`pia` to the `dgen:preinline_args` entry
2023-08-16 15:51:53 +02:00
Tristan B. Velloza Kildaire 1f2c1624df Merge branch 'vardec_varass_dependency' into feature/structs 2023-08-16 11:10:42 +02:00
Tristan B. Velloza Kildaire e5b0f4e0a1 Resolution
- Removed swear words
2023-08-16 11:10:02 +02:00
Tristan B. Velloza Kildaire 2ed7e9f490 Dependency
- Removed debug print as this is done
2023-08-16 11:09:03 +02:00
Tristan B. Velloza Kildaire a4c9a6cc27 Dependency
- Removed swear words
2023-08-16 11:08:20 +02:00
Tristan B. Velloza Kildaire 148f5d888e Merge branch 'vardec_varass_dependency' into feature/structs 2023-08-16 10:56:27 +02:00
Tristan B. Velloza Kildaire d7b9a89552
🧹🧼 Hotfix: VariableExpression dependency node generaiton (#26)
* Dependency

- Removed crap for `VariableExpression` dependency node generation
- This is a work-in-progress clean up

* Dependency

- Added some comments

* Dependency

- Avoid path hopping by making this beanch constantly `true`

* Dependency

- Cleaned up some more, added link to issue regarding context sets

* Dependency

- Don't fetch-and-set context for `bruh` (the entity being referenced)

* Dependency

- Removed path-hopper code

* Dependency

- Checking iets

* Dependency

- Undid checking-iets

* Dependency

- Checking iets (fr)

* Revert "Dependency"

This reverts commit 5ddab9dd3d.

* Dependency

- No need to set it here if set above

* Dependency

- Removed no-op branch

* Dependency

- Cleaned up some more

* Dependency

- Refactored code

* Dependency

- Cleaned up
2023-08-16 10:50:57 +02:00
Tristan B. Velloza Kildaire e2975d4fb9 Test cases
- Renamed module name to `complex_structs` for test case `complex_structs.t`
- Added testing code
2023-08-16 09:50:43 +02:00
Tristan B. Velloza Kildaire fc2ecda695 MetaProcessor
- Switch to `TypedEntity` and support both `Variable` and `StructVariableInstance` when applying cloning process
- Added some debug prints along with this too
2023-08-15 20:54:10 +02:00
Tristan B. Velloza Kildaire e8814159a1 Dependency
- Change the `DNode`'s name generated from `StructVariableInstance`'s `generalPass()` such that we can identify it more easily in the tree
2023-08-15 20:52:46 +02:00
Tristan B. Velloza Kildaire 887672df9c TypeChecker
- Switched to using `StorageDeclaration`
- WHen processing a `StaticVariableDeclaration`-kind of `DNode` apply special rule for `VariableDeclaration` (despite parser most likely finding this error before we do at this later stage)
2023-08-15 20:50:44 +02:00
Tristan B. Velloza Kildaire e61498de49 DGen
- Allow symbol mapping to be based on whether the `symbolMapping` variable is `true` or `false` when processing a `StructInstantiateInstruction`
- When processing a `StructTypeDeclareInstruction` use the `StorageDeclaration` instead of `VariableDeclaration` now
2023-08-15 20:47:37 +02:00
Tristan B. Velloza Kildaire d601296a91 StructVariableInstance
- Now use `TypedEntity` instead of `Variable` for the members array so that we can also store not only `Variable`-based members but also `StructInstance`-based members
- Implemented `MCloneable` (cloneability) support
2023-08-15 20:44:49 +02:00
Tristan B. Velloza Kildaire 7c7b1455d7 StructInstantiateInstruction
- Now use `StorageDeclaration` instead of `VariableDeclaration`

StructTypeDeclareInstruction

- Now use `StorageDeclaration` instead of `VariableDeclaration`
2023-08-15 20:43:26 +02:00
Tristan B. Velloza Kildaire 8a81db0a82 CI/CD
- Added `complex_structs.t` to pipeline
2023-08-15 08:32:23 +02:00
Tristan B. Velloza Kildaire 8fb81e40c1 CI/CD
- Added `simple_structs.t` to pipeline
2023-08-15 08:32:02 +02:00
Tristan B. Velloza Kildaire e4e060e209 Test cases
- Added BROKEN tst case `complex_structs.t`
2023-08-15 08:31:07 +02:00
Tristan B. Velloza Kildaire 8f8f046c3b Merge branch 'vardec_varass_dependency' into feature/structs 2023-08-14 22:37:28 +02:00
Tristan B. Velloza Kildaire 3d9bf28f3b Merge branch 'vardec_varass_dependency' of github.com:tbklang/tlang into vardec_varass_dependency 2023-08-14 22:30:26 +02:00
Tristan B. Velloza Kildaire 5e4049ffee
Hotfix/jcli upgrade fix (#25)
* Dub

- Upgraded `jcli` to version `0.25.0-beta.2`

* Dub

- Upgtraded package `jcli` to version `0.25.0-beta.3`

* - Try using latest version of `dmd`
2023-08-14 22:29:52 +02:00
Tristan B. Velloza Kildaire ef29cf018d - Try using latest version of `dmd` 2023-08-14 22:21:46 +02:00
Tristan B. Velloza Kildaire 330d0a2d96 Dub
- Upgtraded package `jcli` to version `0.25.0-beta.3`
2023-08-14 22:12:28 +02:00