Hi, I just pushed a minor change to the lexer which adds a new twist to our Sexp syntax. We now also parse "within tokens". More specifically, identifiers can now have internal structure. Concretely, it means that when we write a.b.c it's not just the `a.b.c` identifier any more, but it's an Sexp equivalent to __\.__ (__\.__ a b) c I was very tempted to then add to types.typer __\.__ = inductive-cons so we could write List.cons instead of inductive-cons List cons but of course inductive-cons is neither a function nor a macro, so such bindings don't work. We can/should/will fix that, but instead we could define __\.__ as a macro which constructs an (inductive-cons A B) Sexp. Later on, we will want to extend this macro so as to overload the meaning of "." depending on its LHS. Stefan PS: The code really performs a kind of parsing and can handle several "inner" operators rather than only the ".". But the kind of parsing done there is even more restrictive than what we do in general: it's a plain precedence parser, with no distinction of left-precedence and right-precedence, and where all operators are binary and left-associative (and made of a single char, ASCII only).
Afficher les réponses par date
participants (1)
-
Stefan Monnier