Skip to content

Fix parser key ordering and PHVOLT_T_ASSIGN opcode to match C implementation#68

Closed
niden wants to merge 2 commits intophalcon:masterfrom
niden-code:fix/parser-key-ordering-and-assign-opcode
Closed

Fix parser key ordering and PHVOLT_T_ASSIGN opcode to match C implementation#68
niden wants to merge 2 commits intophalcon:masterfrom
niden-code:fix/parser-key-ordering-and-assign-opcode

Conversation

@niden
Copy link
Copy Markdown
Member

@niden niden commented Apr 11, 2026

Summary

  • PHVOLT_T_ASSIGN was incorrectly set to 64 in Compiler.php; the C scanner defines it as '=' (ASCII 61), so the op field in set-statement assignments was producing the wrong value
  • phvolt_ret_for_statement was inserting the key field after file/line and if_expr after file/line; the C implementation inserts key before expr, and if_expr before block_statements
  • phvolt_ret_macro_call_statement was inserting file/line before arguments/caller; the C implementation adds them last

Test plan

  • All Volt parser unit tests pass (SetTest, ForTest, CallTest)
  • No regressions in the broader test suite

niden added 2 commits April 10, 2026 20:44
…ntation

- Correct PHVOLT_T_ASSIGN from 64 to 61 (ASCII '=') to match the C
  scanner.h definition used by the cphalcon extension
- Fix phvolt_ret_for_statement to insert 'key' before 'expr', and
  'if_expr' before 'block_statements', matching the C add_assoc_* order
- Fix phvolt_ret_macro_call_statement to add 'file'/'line' after
  'arguments'/'caller', matching the C implementation
@niden niden requested a review from Jeckerson April 11, 2026 03:22
@niden niden self-assigned this Apr 11, 2026
@niden niden added the bug Something isn't working label Apr 11, 2026
@niden niden added this to Phalcon v6 Apr 11, 2026
@github-project-automation github-project-automation bot moved this to In progress in Phalcon v6 Apr 11, 2026
@niden niden marked this pull request as ready for review April 11, 2026 03:22
@niden
Copy link
Copy Markdown
Member Author

niden commented Apr 14, 2026

Already addressed

@niden niden closed this Apr 14, 2026
@niden niden moved this from In progress to Duplicate / Won't fix in Phalcon v6 Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Duplicate / Won't fix

Development

Successfully merging this pull request may close these issues.

2 participants