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

Allow identifiers with trailing ? or ! in more places #88

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nobodywasishere
Copy link
Member

No description provided.

@nobodywasishere nobodywasishere force-pushed the nobody/ident-trailing-qe branch from 08ec53f to a9621dd Compare January 6, 2025 05:18
not equals call without spaces
==============================

# should be `(foo) != (true)` but is `(foo!) = (true)`
Copy link
Member Author

Choose a reason for hiding this comment

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

Will need some scanner stuff to get this working

@nobodywasishere
Copy link
Member Author

While this syntax wasn't intentional (see crystal-lang/crystal#10917), it may be used by some programs so we should support it.

Copy link
Collaborator

@keidax keidax left a comment

Choose a reason for hiding this comment

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

I'm hesitant about this change, considering:

[
$.identifier_method_call,
$.identifier,
],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this necessary?

grammar.js Show resolved Hide resolved
@nobodywasishere nobodywasishere marked this pull request as draft January 6, 2025 22:28
@nobodywasishere nobodywasishere marked this pull request as ready for review January 6, 2025 22:29
@nobodywasishere
Copy link
Member Author

That's valid. I'll leave this as a draft for now in case that doesn't go forward and the current behavior stays as-is

@nobodywasishere nobodywasishere marked this pull request as draft January 6, 2025 22:31
@@ -1227,7 +1243,19 @@ module.exports = grammar({
),

c_struct_fields: $ => {
const names = seq($.identifier, repeat(seq(',', $.identifier)))
const names = seq(
Copy link
Member Author

Choose a reason for hiding this comment

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

Outside of params, this and type declaration I don't expect to change. What are your thoughts on just adding these?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think I understand, which ones specifically?

Copy link
Member Author

Choose a reason for hiding this comment

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

type declaration names and c struct / union fields

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