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

Add additional identification guards to Sourceror.Identifier #108

Merged
merged 5 commits into from
Sep 16, 2023

Conversation

zachallaun
Copy link
Contributor

Implements the lower-level parts of #105.

This PR adds the following guards:

  • is_call/1
  • is_unqualified_call/1
  • is_qualified_call/1
  • is_identifier/1
  • is_atomic_literal/1

Additional changes/fixes:

  • Add the power operator (**) to the list of binary ops for Elixir 1.13+
  • Refactor SourcerorTest.Support.Corpus somewhat to make its use a bit more ergonomic
  • Remove a bit of leftover tree-sitter syntax from test/corpus/term/alias.ex (it wasn't erroring because S-expressions are also valid Elixir)

While working on this, I realized that these lower-level primitives might prove sufficient for the vast majority of cases. The higher-level things discussed in #105 are likely still useful, but I'd kind of like to kick the tires on these changes before introducing additional new API.

Copy link
Owner

@doorgan doorgan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! The changes look great 💜

While working on this, I realized that these lower-level primitives might prove sufficient for the vast majority of cases. The higher-level things discussed in #105 are likely still useful, but I'd kind of like to kick the tires on these changes before introducing additional new API.

Agreed! I'm a fan of building bottom up, so let's see how these changes work before adding more on top 😄

@doorgan doorgan merged commit b0ec3cc into doorgan:main Sep 16, 2023
7 checks passed
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.

2 participants