Closed fnands closed 1 month ago
I think I've narrowed it down to the fact that Mojo has parameters as well as functions. So where a python function might look like:
def python_func(arg1, arg2):
pass
a Mojo function could also have parameters in square brackets:
def mojo_func[param1, param2](arg1, arg2):
pass
and the regexes don't deal with the parameters yet.
This is a (first draft) of a lexer for the Mojo programming language.
In principle, Mojo aims to be a superset of Python, so the Mojo lexer inherits from the Python lexer (thanks to @jneen for the suggestion).
I've never written a line of Ruby in my life, so if anything below looks suspect, that's why.
Currently a little stuck on regexes (trying to get to match outer square brackets in function definitions). Any pointers appreciated.