6 Commits

Author SHA1 Message Date
Aryadev Chavali
4ecd184759 lerr_type_t::UNKNOWN_CHAR -> UNKNOWN_LEXEME 2024-04-16 15:41:01 +06:30
Aryadev Chavali
a2d98142d5 lerr_t is now a struct with constructors
Similar principle to pp_err_t in that a structure provides the
opportunity for more information about the error such as location.
2024-04-15 16:29:37 +06:30
Aryadev Chavali
f01d64b5f4 lexer now produces a vector of heap allocated tokens
This removes the problem of possibly expensive copies occurring due to
working with tokens produced from the lexer (that C++ just... does):
now we hold pointers where the copy operator is a lot easier to use.

I want expensive stuff to be done by me and for a reason: I want to
be holding the shotgun.
2024-04-15 04:42:24 +06:30
Aryadev Chavali
86e9d51ab0 enum -> enum class in lexer
This makes enum elements scoped which is actually quite useful as I
prefer the namespacing that enum's give in C++.
2024-04-14 17:17:51 +06:30
Aryadev Chavali
a8f605c89b Implemented tokenise_buffer
Note that this is basically the same as the previous version,
excluding the fact that it uses C++ idioms more and does a bit better
in error checking.
2024-04-14 17:04:15 +06:30
Aryadev Chavali
e7a09c0de4 Wrote a new lexer API in C++
Essentially a refactor of the C formed lexer into C++ style.  I can
already see some benefits from doing this, in particular speed of
prototyping.
2024-04-14 16:52:58 +06:30