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

feature: support for PHP 7.4 (typehint, return types) #2566

Merged
merged 11 commits into from Oct 13, 2020

Conversation

TomPavelec
Copy link
Contributor

fix: Foo::bar Foo matched as class name
fix: new self self matched as keyword instead of class name
fix: use function is matched as package

Copy link
Member

@RunDevelopment RunDevelopment left a comment

Choose a reason for hiding this comment

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

Thank you for improving the PHP language definition @TomPavelec!

There are a few things that have to be improved but it looks ok overall.

components/prism-php.js Outdated Show resolved Hide resolved
components/prism-php.js Outdated Show resolved Hide resolved
components/prism-php.js Outdated Show resolved Hide resolved
components/prism-php.js Outdated Show resolved Hide resolved
components/prism-php.js Outdated Show resolved Hide resolved
components/prism-php.js Outdated Show resolved Hide resolved
components/prism-php.js Outdated Show resolved Hide resolved
tests/languages/php/class-name_feature.test Outdated Show resolved Hide resolved
Copy link
Member

@RunDevelopment RunDevelopment left a comment

Choose a reason for hiding this comment

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

Wow. Better number, operator, and punctuation patterns and even more PHP features (execution operators). I really want to get this merged now but before that, we still have fix some issues.

components/prism-php.js Outdated Show resolved Hide resolved
components/prism-php.js Outdated Show resolved Hide resolved
components/prism-php.js Outdated Show resolved Hide resolved
components/prism-php.js Outdated Show resolved Hide resolved
components/prism-php.js Outdated Show resolved Hide resolved
components/prism-php.js Outdated Show resolved Hide resolved
components/prism-php.js Outdated Show resolved Hide resolved
tests/pattern-tests.js Outdated Show resolved Hide resolved
components/prism-php.js Outdated Show resolved Hide resolved
components/prism-php.js Outdated Show resolved Hide resolved
@TomPavelec TomPavelec force-pushed the feature/support_for_php_7_4 branch 12 times, most recently from f375187 to a7f885c Compare October 5, 2020 10:30
Copy link
Member

@RunDevelopment RunDevelopment left a comment

Choose a reason for hiding this comment

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

@TomPavelec Again, sorry for the delay.

I reviewed it again and I think that it's almost ready to merge. We still have to decide what to do with your alias test implementation and I also left you some comments.

The conflicts resulting from #2574 also have to be resolved.

If you want to, then I'll make you a PR resolving some of my comments.

tests/languages/php/class-name_feature.test Outdated Show resolved Hide resolved
components/prism-php.js Outdated Show resolved Hide resolved
components/prism-php.js Outdated Show resolved Hide resolved
components/prism-php.js Outdated Show resolved Hide resolved
components/prism-php.js Outdated Show resolved Hide resolved
fix: `Foo::bar` Foo matched as class name
fix: `new self` self matched as keyword instead of class name
fix: `use function` is matched as package
feature: class name / namespace (package) can not begin with number
feature: added binary and underscore number format
feature: added operators `::`, `->`, `=>`, `<=>`, `...`, and some assignment operators
fix: moved `.` from punctuation to operators (concatenation operator)
feature: for `type` added subtypes `type-casting`, `type-hint`, `return-type`
feature: added backtick string quoted string (shell exec)
feature: for keywords `parent`, `self` and `static` added subtype `static-context` when a static prop/const/method accessed on them
feature: for class name added subtype `class-name-fully-qualified` when class name is fully qualified
feature: for class name added subtype `static-context` when a static prop/const/method accessed on it
fix: use single quotes for token names
fix: removed A-Z in case insensitive patterns
removed: alias shell-comment
fix: types handled as keywords
This was referenced Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants