Skip to content
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

Implement an immediate_identifier rule #92

Open
savq opened this issue Jan 19, 2023 · 0 comments
Open

Implement an immediate_identifier rule #92

savq opened this issue Jan 19, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@savq
Copy link
Collaborator

savq commented Jan 19, 2023

Many of the context-sensitive rules of the Julia grammar need to know whether a rule starts with an identifier.

For example, juxtaposition (implicit multiplication) work if the LHS is a number or if the RHS starts with an identifier:

2x         # Ok
2(x + 1)   # Ok. LHS is number
f()g()     # Ok. RHS starts with identifier
(n - 1) n  # Err. there's a space between the parenthesis and `n`
f(x).+(y)  # Ok. Not a juxtaposition of function calls, but a binary expression

Another example are quotations:

:foo  # Ok
: bar # Err

Currently, the scanner implements rules to check if there's an immediate opening brace/bracket/parenthesis. There's should be an similar rule for identifers and operators.

This requires being able to check unicode categories in the scanner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant