forked from microsoft/tolerant-php-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unify the parsing of all class-like member declarations
Using a class-like member in the wrong class-like is a compile-time error, not a parsing error. Tolerate it and parse the current/remaining statements and leave it to the applications to warn about using unexpected members in classes, traits, interfaces, or enums. (Or to tolerate them for stubs for editors/IDEs) Related to microsoft#395
- Loading branch information
1 parent
3ccba97
commit 049aa8d
Showing
5 changed files
with
112 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
class X { | ||
// Cases are only allowed in enums. But this is a compile-time error, not a parse error | ||
case F = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |
Oops, something went wrong.