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

Parse fun in lambdas and fun in function references as different tokens #1002

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

kvakvs
Copy link
Collaborator

@kvakvs kvakvs commented Jan 14, 2023

Fixes #990

Description

  • Split BNF definitions for lambda fun() -> ...; () -> ... end, and fun mod:func/arity reference (just for clarity)
  • Split ERL_FUN="fun" token into two: "fun" followed by a "(" for regular function definitions, and ERL_FUN2 = "fun" followed by a letter for function reference expressions: fun mod:func/arity.
  • Modify the highlighting to color ERL_FUN2 as a keyword
  • Ensure parser, highlighter and formatter tests handle this change well

TODO Checklist

  • PSI/parser integrity tests failing
  • Inline variable test failing
  • Formatting tests
  • SDK-specific tests failing on Windows (retest on Linux or Mac)

Demo

Cursor standing in the inner fun is not showing as paired with end
image

Cursor in outer fun is paired with end
image

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

Successfully merging this pull request may close these issues.

Incorrect end highlighted for "fun Mod:Name/Arity"
1 participant