Commit Graph

142 Commits

Author SHA1 Message Date
Tyler Christensen
5baa28bb27 php8: resolve attributes in NamespaceResolver 2023-07-18 15:32:28 +02:00
Tyler Christensen
6d1eee5a79 php8: resolve enums in NamespaceResolver 2023-07-18 15:32:28 +02:00
Laytan Laats
6b3673ece4 feat: expose the lexer to be used by users 2023-04-11 22:38:29 +02:00
Laytan Laats
f98b59a5f0 fix: print a newline after a doc comment, these are trimmed when parsing and cause the output to look bad 2023-04-10 02:18:02 +02:00
Laytan Laats
6a5a06a206 fix: add some boundary checks so the formatter panics less often 2023-04-10 02:17:36 +02:00
Laytan Laats
68ac672368 build: replace VKCOM import with laytan import 2023-03-31 16:50:08 +02:00
Laytan Laats
92d341cbb5 feat: generate ast.Type "enum" 2023-03-30 02:20:12 +02:00
Laytan Laats
7c12f73974 feat: add start column and end column to position struct 2023-03-26 01:54:00 +01:00
Laytan Laats
92019441d0 fix: use go:build tools instead of ignore so go mod tidy doesn't remove deps 2023-03-26 01:33:03 +01:00
Laytan Laats
25877adda4 feat: add enter and leave checks for traversers
- Improved performance (can short circuit/not continue when done)
- Backwards compatible because added interfaces
- Now generating the implementation for easier updates
2023-03-25 22:03:02 +01:00
Laytan Laats
b934f01c67 refactor: remove unused and confusing function implementations 2023-03-25 21:54:47 +01:00
Laytan Laats
3ba9118676 refactor: generate node functions instead of manual
Easier to update now, also more reliable (nothing to forget)
2023-03-25 21:53:52 +01:00
Laytan Laats
702cadceab feat: bump supported version range up to 8.2 2023-03-25 16:14:23 +01:00
Laytan Laats
66cc411e7c refactor: change makefile to reflect drop of php5 and run make 2023-03-25 15:29:51 +01:00
Laytan Laats
74a8771740 refactor: move php7 scanner into php7 package 2023-03-25 15:02:34 +01:00
Laytan Laats
a97686125d refactor!: drop php5 support 2023-03-25 15:00:17 +01:00
Laytan Laats
86c10ca380 perf: reduce memory usage by reducing amt of position's created
The positions created were taking GB's of memory and were not being
GC'ed.
2022-09-09 00:40:11 +02:00
Makhnev Petr
e16671724e
php8.1: added intersection types support (#29) 2022-06-26 03:31:29 +03:00
Makhnev Petr
50ed139750
php8.1: added first class callable syntax (#18) 2021-07-31 23:50:59 +03:00
Makhnev Petr
b256331d90
php8.1: added final modifier for constants in class (#15)
This case is already covered by the existing grammar, so no changes are required.
2021-07-31 22:20:36 +03:00
Makhnev Petr
af394e9eb0
php8.1: added enum (#12) 2021-07-31 19:44:09 +03:00
Makhnev Petr
44bbff6073
php8.1: added new octal numbers syntax (#10)
Also fixed a bug where `0X...` and `0B...` were not recognized as valid numbers.
2021-07-31 18:37:01 +03:00
Makhnev Petr
8df80651e0
php8.1: added never type (#8) 2021-07-31 18:06:46 +03:00
Makhnev Petr
8c35b0aef1
php8.1: added readonly modifier (#6) 2021-07-31 18:00:21 +03:00
Makhnev Petr
72cd222aeb
all: renamed github.com/z7zmey/php-parser with github.com/VKCOM/php-parser 2021-07-30 21:01:34 +03:00
Makhnev Petr
049ce7ddc6
PHP 8 (#1)
PHP 8 Update

- nullsafe operator (?->)
- Remove (real) cast
- Named arguments
- Remove (unset) cast
- Remove {} access
- match expression
- Union types in type hints and static typehint
- Block catch without variable
- Trailing comma in parameter lists
- throw can be used as an expression
- Concatenation precedence
- Declaring properties in the constructor
- Attributes
- Names in the namespace are treated as a single token
- Trailing comma in closure use list
- Check that ::class on object works
- Deferencable changes and arbitrary expressions in new/instanceof
2021-07-30 20:53:27 +03:00
Vadym Slizov
367eff9de6
rename package cfg to conf 2021-02-13 23:54:34 +02:00
Vadym Slizov
9d12f1d162
fix formatting 2021-02-13 23:51:08 +02:00
Vadym Slizov
d9bd1df2a2
[#120] move dog.go from root folder 2021-02-13 22:06:52 +02:00
Vadym Slizov
e3b133f3de
refactoring: update api 2020-12-29 21:23:22 +02:00
Vadym Slizov
cb4b4e69c4
refactoring: fix naming 2020-12-28 23:01:02 +02:00
Vadym Slizov
07f49a4d21
refactoring: move internal nodes 2020-12-28 21:31:24 +02:00
Vadym Slizov
bd479007be
refactoring: update traverser 2020-12-28 21:13:08 +02:00
Vadym Slizov
c0465f9605
refactoring: remove "StmtTraitMethodRef" node 2020-12-28 10:47:09 +02:00
Vadym Slizov
c29e8ec0e0
refactoring: update ast structure of "Class", "Interface" and "Trait" nodes 2020-12-28 10:10:24 +02:00
Vadym Slizov
2990f0cc2d
refactoring: create "ScalarEncapsedStringBrackets" node 2020-12-28 00:53:48 +02:00
Vadym Slizov
38141ce97f
refactoring: create "ScalarEncapsedStringVar" node 2020-12-28 00:38:39 +02:00
Vadym Slizov
e4321b5e90
refactoring: create "ExprBrackets" node 2020-12-28 00:02:14 +02:00
Vadym Slizov
ad884c99df
refactoring: update ast structure of "StaticCall" node 2020-12-27 23:19:49 +02:00
Vadym Slizov
0f2341bfa9
refactoring: update ast structure of "MethodCall" and "PropertyFetch" nodes 2020-12-27 23:04:09 +02:00
Vadym Slizov
2c09138600
refactoring: update ast structure of "Variable" node 2020-12-27 21:55:36 +02:00
Vadym Slizov
69919594fd
refactoring: short int cast 2020-12-26 22:48:02 +02:00
Vadym Slizov
115d481a57
refactoring: update ast structure of "IncludeOnce" node 2020-12-26 22:44:14 +02:00
Vadym Slizov
616fd4448e
refactoring: rename DieTkn to ExitTkn 2020-12-26 22:41:25 +02:00
Vadym Slizov
a593760569
refactoring: remove ExprReference node 2020-12-26 22:38:35 +02:00
Vadym Slizov
0f5f5e7dc7
refactoring: update ast structure of "ArrayItem" node 2020-12-26 20:13:50 +02:00
Vadym Slizov
8bf1fa822d
refactoring: update ast structure of "Foreach" node 2020-12-26 19:38:45 +02:00
Vadym Slizov
b85bae2ec1
refactoring: update ast structure of "Closure" and "ClosureUse" nodes 2020-12-26 18:20:10 +02:00
Vadym Slizov
03c7979ccd
refactoring: remove StmtTraitAdaptationList node 2020-12-20 23:04:23 +02:00
Vadym Slizov
74b0949255
refactoring: test variable formatter 2020-12-20 22:11:16 +02:00