You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -59,15 +59,15 @@ foreach ($astNode->getDescendantNodes() as $descendant) {
59
59
}
60
60
```
61
61
62
-
> Note: [the API](docs/ApiDocumentation.md) is not yet finalized, so please file issues let us know what functionality you want exposed,
62
+
> Note: [the API](docs/ApiDocumentation.md) is not yet finalized, so please file issues let us know what functionality you want exposed,
63
63
and we'll see what we can do! Also please file any bugs with unexpected behavior in the parse tree. We're still
64
64
in our early stages, and any feedback you have is much appreciated :smiley:.
65
65
66
66
## Design Goals
67
67
* Error tolerant design - in IDE scenarios, code is, by definition, incomplete. In the case that invalid code is entered, the
68
-
parser should still be able to recover and produce a valid + complete tree, as well as relevant diagnostics.
68
+
parser should still be able to recover and produce a valid + complete tree, as well as relevant diagnostics.
69
69
* Fast and lightweight (should be able to parse several MB of source code per second,
70
-
to leave room for other features).
70
+
to leave room for other features).
71
71
* Memory-efficient data structures
72
72
* Allow for incremental parsing in the future
73
73
* Adheres to [PHP language spec](https://github.com/php/php-langspec),
@@ -83,34 +83,34 @@ so each language server operation should be < 50 ms to leave room for all the
83
83
confusing, really fast, so readability and debug-ability is high priority.
84
84
* Testable - the parser should produce provably valid parse trees. We achieve this by defining and continuously testing
85
85
a set of invariants about the tree.
86
-
* Friendly and descriptive API to make it easy for others to build on.
86
+
* Friendly and descriptive API to make it easy for others to build on.
87
87
* Written in PHP - make it as easy as possible for the PHP community to consume and contribute.
88
88
89
89
## Current Status and Approach
90
90
To ensure a sufficient level of correctness at every step of the way, the
91
91
parser is being developed using the following incremental approach:
92
92
93
-
*[x]**Phase 1:** Write lexer that does not support PHP grammar, but supports EOF
93
+
*[x]**Phase 1:** Write lexer that does not support PHP grammar, but supports EOF
94
94
and Unknown tokens. Write tests for all invariants.
95
95
*[x]**Phase 2:** Support PHP lexical grammar, lots of tests
96
-
*[x]**Phase 3:** Write a parser that does not support PHP grammar, but produces tree of
96
+
*[x]**Phase 3:** Write a parser that does not support PHP grammar, but produces tree of
97
97
Error Nodes. Write tests for all invariants.
98
98
*[x]**Phase 4:** Support PHP syntactic grammar, lots of tests
99
99
*[ ]**Phase 5 (in progress :running:):** Real-world validation and optimization
100
100
*[ ]_**Correctness:**_ validate that there are no errors produced on sample codebases, benchmark against other parsers (investigate any instance of disagreement), fuzz-testing
101
101
*[ ]_**Performance:**_ profile, benchmark against large PHP applications
102
-
*[ ]**Phase 6:** Finalize API to make it as easy as possible for people to consume.
102
+
*[ ]**Phase 6:** Finalize API to make it as easy as possible for people to consume.
103
103
104
104
### Additional notes
105
105
A few of the PHP grammatical constructs (namely yield-expression, and template strings)
106
106
are not yet supported and there are also other miscellaneous bugs. However, because the parser is error-tolerant,
107
107
these errors are handled gracefully, and the resulting tree is otherwise complete. To get a more holistic sense for
108
-
where we are, you can run the "validation" test suite (see [Contributing Guidelines](Contributing.md) for more info
108
+
where we are, you can run the "validation" test suite (see [Contributing Guidelines](Contributing.md) for more info
109
109
on running tests). Or simply, take a look at the current [validation test results](https://travis-ci.org/Microsoft/tolerant-php-parser).
110
110
111
-
Even though we haven't yet begun the performance optimization stage, we have seen promising results so far,
112
-
and have plenty more room for improvement. See [How It Works](docs/HowItWorks.md) for details on our current
113
-
approach, and run the [Performance Tests](Contributing.md#running-performance-tests) on your
111
+
Even though we haven't yet begun the performance optimization stage, we have seen promising results so far,
112
+
and have plenty more room for improvement. See [How It Works](docs/HowItWorks.md) for details on our current
113
+
approach, and run the [Performance Tests](Contributing.md#running-performance-tests) on your
114
114
own machine to see for yourself.
115
115
116
116
## Learn more
@@ -119,7 +119,7 @@ own machine to see for yourself.
119
119
**:book:[Documentation](docs/GettingStarted.md#getting-started)** - learn how to reference the parser from your project, and how to perform
120
120
operations on the AST to answer questions about your code.
121
121
122
-
**:eyes:[Syntax Visualizer Tool](syntax-visualizer/client#php-parser-syntax-visualizer-tool)** - get a more tangible feel for the AST. Get creative - see if you can break it!
122
+
**:eyes:[Syntax Visualizer Tool](syntax-visualizer/client#php-parser-syntax-visualizer-tool)** - get a more tangible feel for the AST. Get creative - see if you can break it!
123
123
124
124
**:chart_with_upwards_trend:[Current Status and Approach](#current-status-and-approach)** - how much of the grammar is supported? Performance? Memory? API stability?
125
125
@@ -131,10 +131,10 @@ operations on the AST to answer questions about your code.
0 commit comments