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: 🐛 syntax error on multiline class constant with comment #1152

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

shufo
Copy link

@shufo shufo commented Jan 14, 2025

Context

Problem

Solution

Skip comments and whitespace when peeking as peek() is just peeking next token without consider comment. I don't know this is proper solution but it works as expected in my environment.

shufo added 4 commits January 14, 2025 04:27

Verified

This commit was signed with the committer’s verified signature.
pentschev Peter Andreas Entschev
Closes: glayzzle#1151

Verified

This commit was signed with the committer’s verified signature.
pentschev Peter Andreas Entschev

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@shufo
Copy link
Author

shufo commented Jan 15, 2025

Tests has passed but seems benchmark failed. I don't know it's ok to failed.

Run python cachegrind.py node test/benchmark2.js > output.txt
==2711== Cachegrind, a high-precision tracing profiler
==2711== Copyright (C) 2002-2017, and GNU GPL'd, by Nicholas Nethercote et al.
==2711== Using Valgrind-3.22.0 and LibVEX; rerun with -h for copyright info
==2711== Command: node test/benchmark2.js
==2711== 
==2711== 
==2711== I refs:        237,39[5](https://github.com/glayzzle/php-parser/actions/runs/12772711343/job/35611721161?pr=1152#step:7:6),387
Traceback (most recent call last):
  File "/home/runner/work/php-parser/php-parser/cachegrind.py", line 137, in <module>
    print(github_action_benchmark_json(combined_instruction_estimate(get_counts(run_with_cachegrind(sys.argv[1:])))))
                                                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/php-parser/php-parser/cachegrind.py", line [10](https://github.com/glayzzle/php-parser/actions/runs/12772711343/job/35611721161?pr=1152#step:7:11)0, in get_counts
    ram_hits = d["DLmr"] + d["DLmw"] + d["ILmr"]
               ~^^^^^^^^
KeyError: 'DLmr'

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.

Syntax Error on multilined class constant with comment
1 participant