41 Commits (main)
 

Author SHA1 Message Date
anna 54a21f9121
vim: add gaybuild syntax file
This is sort of half-finished and probably full
of bugs, but it works for the most part.
At least it's nicer to look at than blank text.
2 years ago
anna de42513728
lex: fix incorrect cursor position tracking
It works.  Finally.  This also fixes a stupid
off-by-one error that made the first token
disappear.
2 years ago
anna ec8c8916b7
ast: allow definitions in loop head
This is a rather bad hack, but it makes parsing a
lot easier, so i'll allow it for now.
2 years ago
anna 57e74ab52a
require explicit variable declarations 2 years ago
anna cb32a2c7e2
ast: remove unnecessary qualifier 2 years ago
anna 311059449a
rt: prevent deadlock in recursive functions 2 years ago
anna 192edca1a1
rt: add initial runtime implementation
Alright, so this is ugly.  I'm really not happy
with how it turned out for the most part, but
that's what refactoring is for.  For now, though,
i will sleep because i'm seriously tired.
2 years ago
anna 6c83d52053
ast: cargo fmt 2 years ago
anna f5f29ed1e2
ast: save node positions 2 years ago
anna bdb5f9ad4b
add dot operator for member access 2 years ago
anna d9df6df402
add loops 2 years ago
anna a86c2ec584
lex: fix single 0 recognition 2 years ago
anna 620be5dba1
add functions 2 years ago
anna 6d5e7cb406
lex: fix erroneous keyword recognition
I tried to parse a function called
"fn_with_callback" for the upcoming function
support and realized that the lexer mistook the
first two letters for the respective keyword.
So that is fixed now, i guess.
2 years ago
anna dbcdee1c33
ast: unify function param and array parsing 2 years ago
anna e932590bca
shit 2 years ago
anna 8bd25a3c6b
add true and false keywords 2 years ago
anna 0620ce0468
lex: remove ** operator
I don't think this would be useful, and it would
only complicate parsing due to its right
associativity, so it has to go
2 years ago
anna cb98c78b37
add support for if statements 2 years ago
anna 05e73aeb21
ast: refactor and add production rule docs
As usual, this is nowhere near finished, but it's
a good start.
2 years ago
anna 40ea7598ae
ast: support parenthesized subexpressions 2 years ago
anna e33c2022c5
ast: add expression support
This adds the basic set of expressions:
assignments, binary/unary expressions, function
calls, and array accesses.  Binary operator
precedence is also taken into account.  What's
still missing are parenthesized expressions, but
those should be easy to do.
2 years ago
anna f71684bc38
lex: fix yet another token position bug
When skipping whitespace, the token position must
be updated accordingly.  Additionally, the token
position is now updated when creating a new one.
It still doesn't work because something with the
cursor is broken.
2 years ago
anna 50754ed26d
token: add helper functions 2 years ago
anna 10ca36535f
lex: add a couple more operators 2 years ago
anna 7b7cd933d3
rename module to target
To avoid potential confusion with Rust modules,
gaybuild's modules are now called targets.
2 years ago
anna 30273b7902
ast: add abstract syntax tree parser
This is nowhere near finished, but it's a good
start for now.
2 years ago
anna b0e2e405d7
lex: fix buggy history 2 years ago
anna 8a0d22fbf0
test: add explanatory comments 2 years ago
anna a8130c864d
cursor: break line after \n
Up to now, the cursor broke the line *before* the
\n and made that character the 0th one in the new
line.  I don't know why i did this, but at least
it's fixed now.
2 years ago
anna 7b715a2cfb
lex: fix incorrect keyword recognition 2 years ago
anna c7e4244972
cursor: refactor to only work on strings 2 years ago
anna c7fc83f844
error: refactor into unified error type
This is probably a bad idea.  Every stage in the
compiler pipeline will use the same type for
emitting errors now (good), but it's doing so
using a bunch of wrappers (bad, i think).
2 years ago
anna 8710d08a19
add IntelliJ config stuff 2 years ago
anna ba5c561c0e
improve error system
There is a generic error interface now that will
be used throughout the codebase.
2 years ago
anna 73d1e8aede
lex: fix errors and cleanup 2 years ago
anna 50b6da41dd
lex: ignore comments
This is a cheap hack to just omit comments from
the token stream for now.  I doubt they will ever
be used at all, so their existence would just mean
extra work for the parser.
2 years ago
anna 68254757a3
lex: support backwards seeking and more tokens
The lexer now records every token it encounters
internally such that peeking and other useful
stuff is possible.  Will come in handy for the
parser.  Also, while i was at it, i also added
more primitive tokens like + - * / because i'm
probably gonna need it later anyway.
2 years ago
anna 8ae3bb2f57
add lexer and test file
There are most likely gonna be a lot of changes
until we reach the final syntax, but this is a
good start i think.
2 years ago
anna 0557369397
add cursor for lexer
This is a little helper for the lexer so it can
read a stream forwards and backwards.  It will
also keep track of line and column numbers for
better error output.
2 years ago
anna 991cf6caf0
initial commit uwu 2 years ago