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

Rewrite PHP lexer to support use statements, function declarations and type declarations #1489

Merged
merged 32 commits into from
Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9e4a27e
Remove tailing whitespace from PHP visual sample
pyrmont Apr 7, 2020
10c644e
Add traits usage to PHP visual sample
pyrmont Apr 8, 2020
b74d3f7
Improve support for use keyword with traits
pyrmont Apr 8, 2020
b1e3509
Add example of use to import multiple namespaces
pyrmont Apr 8, 2020
321ef99
Collate trait and use examples
pyrmont Apr 9, 2020
86f9f17
Simplify rules and improve coverage
pyrmont Apr 9, 2020
8fc769a
Improve logical separation of rules
pyrmont Apr 9, 2020
fe2639c
Fix regression in comment rule
pyrmont Apr 9, 2020
04334e0
Fix tokens relating to class keyword
pyrmont Apr 9, 2020
95c91f4
Reset expected token after assertions
pyrmont Apr 9, 2020
32f67b9
Change variable name for next token
pyrmont Apr 9, 2020
9062084
Treat function keywords separately
pyrmont Apr 9, 2020
7242aa9
Add anonymous function examples
pyrmont Apr 9, 2020
2260ec4
Update tokens in PHP lexer spec
pyrmont Apr 9, 2020
3ab60d5
Improve coverage of tokens further
pyrmont Apr 9, 2020
367179c
Add abstract function example
pyrmont Apr 9, 2020
a564e88
Implement MagicToken to 'predict' next token
pyrmont Apr 9, 2020
854d84d
Rationalise visual sample
pyrmont Jul 7, 2020
610b108
Rewrite PHP lexer
pyrmont Jul 7, 2020
ae35ded
Update Hack lexer to match new structure
pyrmont Jul 7, 2020
d33ef44
Update specs
pyrmont Jul 7, 2020
4491110
Update spec
pyrmont Jul 7, 2020
8a85cca
Use :names state consistently
pyrmont Jul 7, 2020
04ce3cb
Better support use in anonymous functions
pyrmont Jul 7, 2020
8a6324c
Support functions and arrays in assignments
pyrmont Jul 7, 2020
4a5be71
Support arrow functions
pyrmont Jul 7, 2020
60422a2
Support typed properties
pyrmont Jul 7, 2020
55905e7
Rationalise function definition rules
pyrmont Jul 7, 2020
c42decd
Tidy up comments
pyrmont Jul 7, 2020
11b41aa
Remove namespace and declaration states
pyrmont Jul 7, 2020
7a88718
Remove broken assertion
pyrmont Jul 7, 2020
79cb3d6
Rationalise rules
pyrmont Jul 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/rouge/lexers/hack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def self.keywords
)
end

prepend :template do
prepend :root do
rule %r/<\?hh(\s*\/\/\s*(strict|decl|partial))?$/, Comment::Preproc, :php
end

Expand Down
Loading