Coda compiler update

Thanks for all the feedback guys! I've worked for a bit on refactoring the parser, and I also missed a chunk of the lexer out by accident lol. I've added a pretty printer for the lexer output and the parser output. Currently, it's able to parse this program:

```

module simple;

include std::io;

include std::string;

@extern

fn int[] *? *? mut* main(@extern mut char mut*? e, mut int *foo, char mut*?mut*?mut*? beans);

```

into this (pretty) AST:

```

=== Module ===

Name: simple

Includes (total 2):

Include:

Path: std::io

Include:

Path: std::string

Declarations (total 1):

- Decl 0: kind=0

Function: main

@extern

Return type: * mut opt: * opt: * opt: slice: int

Parameters:

- Param 0: e: * mut opt: char mut

@extern

- Param 1: foo: *: int mut

- Param 2: beans: * mut opt: * mut opt: * mut opt: char

Body:

<no body>

=== End Module ===

```

I am currently working on statement parsing, then I'll do expressions and finally function bodies (at the moment it only parses function signatures)

As always, the code can be found [here](https://github.com/gingrspacecadet/coda). All contributions are welcome!

If you have any questions I'm up for answering them :3

Posted Feb 16, 2026, 8:32 PM UTC

12
Loading comments…