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

feat: allow enums to use double quoted strings and here/nowdocs #199

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

calebdw
Copy link
Collaborator

@calebdw calebdw commented Jan 2, 2024

Checklist

  • All tests pass in CI
  • There are enough tests for the new fix/feature
  • Grammar rules have not been renamed unless absolutely necessary (x rules renamed)
  • The conflicts section hasn't grown too much (x new conflicts)
  • The parser size hasn't grown too much (master: STATE_COUNT, PR: STATE_COUNT)
    (check the value of STATE_COUNT in src/parser.c)

Fixes #195 (note this was branched off of #192).

Apparently using heredocs/nowdocs in an enum is valid PHP:

enum Suit: string
{
  case Hearts = 'H';
  case Diamonds;
  case Clubs = "C";
  case Spades = <<<TXT
      S
      TXT;
}

@cfroystad
Copy link
Collaborator

Nice work! This looks correct. I'll have another look and merge after #192 has landed

@calebdw calebdw changed the title Allow enums to use double quoted strings and here/nowdocs feat: allow enums to use double quoted strings and here/nowdocs Jan 5, 2024
@cfroystad cfroystad merged commit faf0947 into tree-sitter:master Jan 11, 2024
4 checks passed
@calebdw calebdw deleted the enum-double-strings branch January 11, 2024 11:52
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.

String backed enums are not recognized
2 participants