-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lexical syntax of names #201
Comments
Regarding syntax: Following the Rust conventions, I would advocate for allowing underscores everywhere, and encourage (but maybe not enforce) |
I agree that the parser should be permissive in general, but there are a few things that we should distinguish early in order to make our life easier later on. For example, I don't want the parser to allow qualified names in binding positions of both names and variables. E.g. I would expect the parser to reject:
Here The other thing is whether we want to enforce all module names to be lower case and all type names to be upper case.
|
Yeah we should enforce lowercase module names but it may be easier to allow for multiple error messages in lowering/name resolution than making parse errors recoverable. It would certainly be more fine-grained. |
Previously we just had one single declaration in
lang/parser/src/cst/exp.rs
.This definition was used for variables, constructors, destructors, type constructors, etc.
This is no longer tenable if we want to introduce modules and qualified names. We need more structure.
I propose something like the following:
I propose that for typeconstructors, constructors and codefinitions we may only use
UIdName
, and for destructors and and definitions onlyLIdName
. This would also allow to distinguish variables from calls with no arguments in the parser, i.e.x
vsNil
.The text was updated successfully, but these errors were encountered: