Skip to content

Commit 2c91523

Browse files
committed
Link to build status of fork
1 parent 163cf0d commit 2c91523

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Tolerant PHP Parser
2-
[![Build Status](https://travis-ci.org/Microsoft/tolerant-php-parser.svg?branch=master)](https://travis-ci.org/Microsoft/tolerant-php-parser)
2+
[![Build Status](https://travis-ci.org/TysonAndre/tolerant-php-parser.svg?branch=master)](https://travis-ci.org/TysonAndre/tolerant-php-parser) (For Fork)
33

44
This is an early-stage PHP parser designed, from the beginning, for IDE usage scenarios (see [Design Goals](#design-goals) for more details). There is
5-
still a ton of work to be done, so at this point, this repo mostly serves as
5+
still a ton of work to be done, so at this point, this repo mostly serves as
66
an experiment and the start of a conversation.
77

88
![image](https://cloud.githubusercontent.com/assets/762848/19023070/4ab01c92-889a-11e6-9bb5-ec1a6816aba2.png)
99

1010
## Get Started
11-
After you've [configured your machine](docs/GettingStarted.md), you can use the parser to generate and work
11+
After you've [configured your machine](docs/GettingStarted.md), you can use the parser to generate and work
1212
with the Abstract Syntax Tree (AST) via a friendly API.
1313
```php
1414
<?php
@@ -38,17 +38,17 @@ foreach ($astNode->getDescendantNodes() as $descendant) {
3838
// All Nodes link back to their parents, so it's easy to navigate the tree.
3939
$grandParent = $descendant->getParent()->getParent();
4040
var_dump($grandParent->getNodeKindName());
41-
41+
4242
// The AST is fully-representative, and round-trippable to the original source.
4343
// This enables consumers to build reliable formatting and refactoring tools.
4444
var_dump($grandParent->getLeadingCommentAndWhitespaceText());
4545
}
46-
46+
4747
// In addition to retrieving all children or descendants of a Node,
4848
// Nodes expose properties specific to the Node type.
4949
if ($descendant instanceof Node\Expression\EchoExpression) {
5050
$echoKeywordStartPosition = $descendant->echoKeyword->getStartPosition();
51-
// To cut down on memory consumption, positions are represented as a single integer
51+
// To cut down on memory consumption, positions are represented as a single integer
5252
// index into the document, but their line and character positions are easily retrieved.
5353
$lineCharacterPosition = PositionUtilities::getLineCharacterPositionFromPosition(
5454
$echoKeywordStartPosition,
@@ -59,15 +59,15 @@ foreach ($astNode->getDescendantNodes() as $descendant) {
5959
}
6060
```
6161

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,
6363
and we'll see what we can do! Also please file any bugs with unexpected behavior in the parse tree. We're still
6464
in our early stages, and any feedback you have is much appreciated :smiley:.
6565

6666
## Design Goals
6767
* 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.
6969
* 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).
7171
* Memory-efficient data structures
7272
* Allow for incremental parsing in the future
7373
* 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
8383
confusing, really fast, so readability and debug-ability is high priority.
8484
* Testable - the parser should produce provably valid parse trees. We achieve this by defining and continuously testing
8585
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.
8787
* Written in PHP - make it as easy as possible for the PHP community to consume and contribute.
8888

8989
## Current Status and Approach
9090
To ensure a sufficient level of correctness at every step of the way, the
9191
parser is being developed using the following incremental approach:
9292

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
9494
and Unknown tokens. Write tests for all invariants.
9595
* [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
9797
Error Nodes. Write tests for all invariants.
9898
* [x] **Phase 4:** Support PHP syntactic grammar, lots of tests
9999
* [ ] **Phase 5 (in progress :running:):** Real-world validation and optimization
100100
* [ ] _**Correctness:**_ validate that there are no errors produced on sample codebases, benchmark against other parsers (investigate any instance of disagreement), fuzz-testing
101101
* [ ] _**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.
103103

104104
### Additional notes
105105
A few of the PHP grammatical constructs (namely yield-expression, and template strings)
106106
are not yet supported and there are also other miscellaneous bugs. However, because the parser is error-tolerant,
107107
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
109109
on running tests). Or simply, take a look at the current [validation test results](https://travis-ci.org/Microsoft/tolerant-php-parser).
110110

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
114114
own machine to see for yourself.
115115

116116
## Learn more
@@ -119,7 +119,7 @@ own machine to see for yourself.
119119
**:book: [Documentation](docs/GettingStarted.md#getting-started)** - learn how to reference the parser from your project, and how to perform
120120
operations on the AST to answer questions about your code.
121121

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!
123123

124124
**:chart_with_upwards_trend: [Current Status and Approach](#current-status-and-approach)** - how much of the grammar is supported? Performance? Memory? API stability?
125125

@@ -131,10 +131,10 @@ operations on the AST to answer questions about your code.
131131
* [Validation Strategy](docs/HowItWorks.md#validation-strategy)
132132

133133
**:sparkling_heart: [Contribute!](Contributing.md)** - learn how to get involved, check out some pointers to educational commits that'll
134-
help you ramp up on the codebase (even if you've never worked on a parser before),
134+
help you ramp up on the codebase (even if you've never worked on a parser before),
135135
and recommended workflows that make it easier to iterate.
136136

137137
---
138-
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
139-
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact
138+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
139+
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact
140140
[opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

0 commit comments

Comments
 (0)