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

fix: single types being incorrectly parsed as a union_type #206

Closed
wants to merge 1 commit into from

Conversation

calebdw
Copy link
Collaborator

@calebdw calebdw commented Jan 5, 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)

Hello!

I noticed that single types were being incorrectly parsed as a union_type, this PR fixes that issue so they are correctly parsed as a singular type (note this was branched from #192):

<?php
function a(): int {}

---

(program
  (php_tag)
  (function_definition
    (name) (formal_parameters)
-    (union_type (primitive_type))
+    (primitive_type)
    (compound_statement))

Thanks!

@calebdw calebdw changed the title fix: fix single types being incorrectly parsed as a union_type fix: single types being incorrectly parsed as a union_type Jan 5, 2024
@calebdw calebdw force-pushed the fix_union_types branch 2 times, most recently from 80cd024 to 60d322e Compare January 13, 2024 05:12
@calebdw calebdw force-pushed the fix_union_types branch 3 times, most recently from 5108ebe to 57517be Compare January 24, 2024 13:58
@calebdw
Copy link
Collaborator Author

calebdw commented Jan 26, 2024

See #214

@calebdw calebdw closed this Jan 26, 2024
@calebdw calebdw deleted the fix_union_types branch January 26, 2024 06:14
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.

1 participant