Commit Graph

10 Commits

Author SHA1 Message Date
anna c7e4244972
cursor: refactor to only work on strings 2022-07-23 20:51:15 +02:00
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).
2022-07-14 13:38:02 +02:00
anna 8710d08a19
add IntelliJ config stuff 2022-07-14 13:05:15 +02:00
anna ba5c561c0e
improve error system
There is a generic error interface now that will
be used throughout the codebase.
2022-07-14 13:01:39 +02:00
anna 73d1e8aede
lex: fix errors and cleanup 2022-07-14 12:33:04 +02:00
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.
2022-07-11 16:08:11 +02:00
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.
2022-07-11 15:57:01 +02:00
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.
2022-07-10 21:56:00 +02:00
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.
2022-07-10 17:00:47 +02:00
anna 991cf6caf0
initial commit uwu 2022-07-10 16:56:42 +02:00