Official Tristan Language project compiler
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Go to file
Tristan B. V. Kildaire b8e4d34393
️ Feature: Mixins and embeddings (#69)
* LexerInterface

- Added two new methods

* BasicLexer

- Using `Array` from `std.container.Array` now as it will allow for manipulation more easily

* LexerInterface

- Should take in a `Token` rather

* ArrLexer

- Added required overrides

* BasicLexer

- Added initial implementation for the `removeToken(ulong)` and `insertToken(Token, ulong)` methods
- Added unittests to test the insertion and removal methods

* BasicLexer

- Added check in `insertToken(Token, ulong)` to ensure that we (the `cursor` argument) are inbounds when inserting

* BasicLexer

- Updated unittest to check for out-of-bounds when doing an insertion

* BasicLexer

- `removeToken(ulong)` now does an out-of-bounds check
- Updated unittest to check for out-of-bounds when doing a removal

* LexerInterface

- Marked certain methods as nothrow

* BasicLexer

- These need not be marked with `override`

* BasicLexer

- Just use `currentTokens` directly, renamed it to `tokens` as well

* BasicLexer

- Calling `getTokens()` now returns a copy of the internal state

* BasicLexer

- Cleaned up

* Test cases

- Added `mixins/str.t`

* Test cases

- Added `mixins/file.txt`

* Test cases

- Added `decl.txt`
- Changed the file path for the embedding in `file.t`

* Compiler

- Added two positive test cases for `mixins/str.t` and `mixins/file.t`

* Check

- Added forward and bakwards mappings in for new `mixin` and `embed` keywords

* Parser

- Added `getLexerFor(string)`
- Implemented `mixin` and `embed` keywords for statement-level usage

* Parser

- Expect the terminating symbol but do not consume it

Test cases

- Updated `mixins/decl.txt` and `mixins/str.t`

* Parser

- Don't expect ANYTHING after we chow `mixin/embed`, `(`, `strLit` and `)`, parsing that happens after the caller is returned to will care about that

* Test cases

- Test expression usage

* Test cases

- Added expression test for `mixins/file.t` by using another embedding of the file `mixins/file.t`

* Parser

- `getLExerFor(string)` now wraps exception in a `ParserException`

* ArrLexer

- Removing this as it isn't even used

* Pipelines

- Updated
2 months ago
.github/workflows ️ Feature: Mixins and embeddings (#69) 2 months ago
branding Array support (#1) 2 years ago
rando Fuck this is complicated (2/2) 4 years ago
scratch Feature: Multi-module support (#31) 1 year ago
source/tlang ️ Feature: Mixins and embeddings (#69) 2 months ago
.gitignore .gitignore 5 months ago
README.md Update README.md 2 years ago
dub.json Feature: Compiler config: Migrate to niknaks (#66) 7 months ago
extern_test.sh Feature: Multi-module support (#31) 1 year ago
macro_ast_replacemenet.png 🧠 Feature: Meta-programming engine (#10) 2 years ago
macro_ast_replacemenet.xcf 🧠 Feature: Meta-programming engine (#10) 2 years ago
macro_ast_replacement_sizeof_example.png 🧠 Feature: Meta-programming engine (#10) 2 years ago
macro_ast_replacement_sizeof_example.xcf 🧠 Feature: Meta-programming engine (#10) 2 years ago
malloc_test.sh Pointer support (#2) 2 years ago
small_doc_Resolver.md Feature: Multi-module support (#31) 1 year ago
small_doc_modules.md Feature: Multi-module support (#31) 1 year ago
small_doc_parser_modules.md Feature: Multi-module support (#31) 1 year ago
tets.d Added testing files 4 years ago
texterned.c - Added `texterned.c` for later extern testing 2 years ago
todo1.md I wonder if that worked 4 years ago
wip.txt Array support (#1) 2 years ago

README.md

tlang

D Coverage Status

Official Tristan Language project compiler

Documentation

Docs are available here.

Building

To build you will need dmd and dub installed. You can then run the following:

dub test --coverage
dub build

The first command is optional but you want to make sure the compiler is working so you may as well run all the unit tests - it won't take too long.

Usage

A list of all commands can be found by typing in the following:

./tlang