Skip to content

Commit f8e0455

Browse files
authored
Merge pull request glayzzle#47 from glayzzle/1.0.0
1.0.0
2 parents 1a27f8d + 6fd68be commit f8e0455

File tree

163 files changed

+6372
-7629
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+6372
-7629
lines changed

.gitmodules

Lines changed: 0 additions & 36 deletions
This file was deleted.

.npmignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
/bin/
2-
/test/
1+
/docs/
2+
/test/
3+
/gruntfile.js

.travis.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
language: node_js
22
node_js:
33
- '0.12'
4+
cache:
5+
bundler: true
6+
directories:
7+
- node_modules # NPM package
48
notifications:
59
email: false
610
webhooks:
@@ -9,11 +13,5 @@ notifications:
913
on_success: change
1014
on_failure: always
1115
on_start: never
12-
before_script:
13-
- sudo apt-get install python-software-properties -y
14-
- sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php -y
15-
- sudo apt-get update -y
16-
- sudo apt-get install php7.0 php7.0-xml -y
17-
- php -v
1816
script: npm run cover
1917
after_success: cat /home/travis/build/glayzzle/php-parser/coverage/lcov.info | /home/travis/build/glayzzle/php-parser/node_modules/coveralls/bin/coveralls.js

README.md

Lines changed: 15 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,24 @@ Parse PHP code from NodeJS and convert it to AST. This library is a standalone m
1515
$ npm install php-parser --save
1616
```
1717

18-
# Try it
19-
20-
```sh
21-
$ cd bin
22-
$ node test.js -e "echo 'Hello World';"
23-
```
18+
# Use it
2419

25-
Will output :
2620
```js
27-
*** START TESTING ***
21+
// initialize a new parser instance
22+
var parser = require('php-parser').create();
2823

29-
-- TOKENS :
30-
T_ECHO T_CONSTANT_ENCAPSED_STRING ;
24+
// how to retrieve the AST
25+
var AST = parser.parseEval('echo "Hello World";');
3126

32-
-- AST :
27+
// how to list tokens
28+
var tokens = parser.tokenGetAll('<?php echo "Hello World";');
29+
```
30+
31+
For more details please [visit he wiki](https://github.com/glayzzle/php-parser/docs).
32+
33+
# Output
3334

35+
```js
3436
[
3537
'program', <-- program node
3638
[
@@ -47,42 +49,9 @@ T_ECHO T_CONSTANT_ENCAPSED_STRING ;
4749
Try it online (demo) :
4850
http://glayzzle.com/php-parser/#demo
4951

50-
# Use it
51-
52-
```js
53-
// initialize a new parser instance
54-
var parser = require('php-parser').create();
55-
56-
// how to retrieve the AST
57-
var AST = parser.parseEval('echo "Hello World";');
58-
59-
// how to list tokens
60-
var tokens = parser.tokenGetAll('<?php echo "Hello World";');
61-
```
62-
63-
For more details please [visit he wiki](https://github.com/glayzzle/php-parser/wiki).
64-
65-
# Join the dev
66-
67-
If you want to change/fix the lexer you will find code to `./src/lexer/`.
68-
You can also implement the parser, the code is into `./src/parser/`.
69-
To check your changes add tests into `./test/parser/`, and run `npm run test`.
70-
Try to keep or improve the coverage levels.
71-
72-
The command line options :
73-
74-
```sh
75-
Usage: test [options] [-f] <file>
76-
77-
-f <file> Parse and test the specified file
78-
-d <path> Parse each file in the specified path
79-
-r Use recursivity with the specified path
80-
-e Eval the specified input and shows AST
81-
-v Enable verbose mode and show debug
82-
-h, --help Print help and exit
83-
```
52+
# Contributing
8453

85-
If you run into problems with a test, run it with the cli and add the `--debug` flag.
54+
If you want to contribute please visit this repository https://github.com/glayzzle/php-parser-dev.
8655

8756
# Misc
8857

RELEASE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Releases
22

3+
## 1.0.0 : (2016-12-29)
4+
5+
- All nodes are now converted to objects
6+
- Bruteforce tests are in a separate project
7+
- Improved tests with mocha
8+
- Many syntax fixes
9+
- Tests over a silent error mode
10+
- Release of a complete AST documentation
11+
312
## 0.1.5 : (2016-12-27)
413

514
> The 0.1.x version starts to be deprecated

bin/bench.js

Lines changed: 0 additions & 218 deletions
This file was deleted.

0 commit comments

Comments
 (0)