Skip to content

1.0.0 #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 71 commits into from
Jan 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
76aa80e
Merge pull request #44 from glayzzle/master
ichiriac Dec 27, 2016
37a17ae
implement nodes flags & add tests on classes
ichiriac Dec 27, 2016
b9b63cb
implement traits usage
ichiriac Dec 27, 2016
0249eb4
fix doc
ichiriac Dec 27, 2016
a90dd4f
start tests over trait & interface nodes
ichiriac Dec 27, 2016
1182236
rebuild nodes tree
ichiriac Dec 27, 2016
24f84ca
fix documentation nodes implementation
ichiriac Dec 27, 2016
7e2e192
fix documentation nodes implementation
ichiriac Dec 27, 2016
3fe2360
add interface node
ichiriac Dec 27, 2016
96d38f3
implement trait nodes
ichiriac Dec 27, 2016
170c7ee
rename documentation to doc
ichiriac Dec 27, 2016
9cfdf55
fix function & rename children as body
ichiriac Dec 27, 2016
9d14c69
fix trait insteadof -> identifier[]
ichiriac Dec 27, 2016
20860e3
add a new read_name_list helper
ichiriac Dec 27, 2016
deacdb4
https://github.com/glayzzle/php-parser/issues/11 change the expect re…
ichiriac Dec 27, 2016
59d2866
ignore plateform specific code
ichiriac Dec 28, 2016
7980c44
code array becomes code block nodes
ichiriac Dec 28, 2016
5ecbf5a
implement if node
ichiriac Dec 28, 2016
78f1132
fix coverage on if statements
ichiriac Dec 28, 2016
a40736e
isolate generic function into a utils.js file
ichiriac Dec 28, 2016
b99d1c8
fix doc, use block node instead []
ichiriac Dec 28, 2016
8e9ba7f
implement while & do nodes
ichiriac Dec 28, 2016
353ada4
implement for nodes
ichiriac Dec 28, 2016
1b38288
fix list node
ichiriac Dec 28, 2016
4ea9ac0
fix & byref for vars
ichiriac Dec 28, 2016
4005e58
add a list node
ichiriac Dec 28, 2016
ebae0aa
add coverage on list statements - wip
ichiriac Dec 28, 2016
136d2bf
add foreach node & rebuild docs
ichiriac Dec 28, 2016
fc06912
remove old tests installation requirements
ichiriac Dec 28, 2016
2c8a405
avoid including other docs into readme
ichiriac Dec 28, 2016
28d255d
https://github.com/glayzzle/php-parser-tests/issues/1
ichiriac Dec 28, 2016
89bb053
https://github.com/glayzzle/php-parser-tests/issues/1
ichiriac Dec 28, 2016
73efd7f
prepare release text
ichiriac Dec 28, 2016
c292bc6
fix tests
ichiriac Dec 28, 2016
eeff19c
remove unused references
ichiriac Dec 28, 2016
b748a0d
remove old dependencies
ichiriac Dec 28, 2016
3a59f39
fix coverage
ichiriac Dec 28, 2016
b952c64
update texts
ichiriac Dec 28, 2016
67c9d01
enable open/close tags on eval mode
ichiriac Dec 28, 2016
84ef031
implement switch, case, break nodes
ichiriac Dec 28, 2016
794d765
implement switch, case, break nodes
ichiriac Dec 28, 2016
d520b9f
add goto, label, post nodes
ichiriac Dec 28, 2016
b7f1483
cache node modules in order to speed up builds
ichiriac Dec 28, 2016
2fdd9fa
add try/catch and call nodes
ichiriac Dec 28, 2016
1721238
implement namespace & use nodes (fix https://github.com/glayzzle/php-…
ichiriac Dec 29, 2016
4585ca4
fix https://github.com/glayzzle/php-parser/issues/45 & add some tests
ichiriac Dec 29, 2016
daaf93e
add bin, cast & unary nodes
ichiriac Dec 29, 2016
f674b9f
add bin, cast & unary nodes
ichiriac Dec 29, 2016
aab775b
add bool & retif nodes
ichiriac Dec 30, 2016
88871e0
add silent node
ichiriac Dec 30, 2016
5747a93
add pre node
ichiriac Dec 30, 2016
0bdb379
add new node
ichiriac Dec 30, 2016
ae9fea9
cover ast.js
ichiriac Dec 30, 2016
d75ddd7
add closure node
ichiriac Dec 30, 2016
f74c40a
improve strings coverage on lexer
ichiriac Dec 30, 2016
59760a8
test here doc on lexer
ichiriac Dec 30, 2016
0206c33
rename var.identifier to var.name + enable array tests
ichiriac Dec 30, 2016
adb7f39
fix columns implementation
ichiriac Dec 30, 2016
4039451
fix positions retrieval
ichiriac Dec 30, 2016
91010c0
eat next token before result (fix positions)
ichiriac Dec 30, 2016
4c87f29
fix positions on assign nodes
ichiriac Dec 30, 2016
78ca985
fix var name location
ichiriac Dec 30, 2016
a874732
enable new tests
ichiriac Dec 30, 2016
cdb9f42
fix & test simple_variable parsing
ichiriac Dec 30, 2016
55c96a7
add new lookup nodes & migrate vars (wip)
ichiriac Dec 30, 2016
2143b98
add the static lookup node
ichiriac Dec 30, 2016
ad2b9ab
add global node
ichiriac Dec 31, 2016
0573362
start testing numbers
ichiriac Jan 1, 2017
1901702
cover tests on initial parser
ichiriac Jan 1, 2017
a64128b
fix comment lexing & add tests (wip)
ichiriac Jan 1, 2017
6fd68be
fix scalar endeless loop (edge) + cover strings lexer
ichiriac Jan 1, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions .gitmodules

This file was deleted.

5 changes: 3 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/bin/
/test/
/docs/
/test/
/gruntfile.js
10 changes: 4 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
language: node_js
node_js:
- '0.12'
cache:
bundler: true
directories:
- node_modules # NPM package
notifications:
email: false
webhooks:
Expand All @@ -9,11 +13,5 @@ notifications:
on_success: change
on_failure: always
on_start: never
before_script:
- sudo apt-get install python-software-properties -y
- sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php -y
- sudo apt-get update -y
- sudo apt-get install php7.0 php7.0-xml -y
- php -v
script: npm run cover
after_success: cat /home/travis/build/glayzzle/php-parser/coverage/lcov.info | /home/travis/build/glayzzle/php-parser/node_modules/coveralls/bin/coveralls.js
61 changes: 15 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,24 @@ Parse PHP code from NodeJS and convert it to AST. This library is a standalone m
$ npm install php-parser --save
```

# Try it

```sh
$ cd bin
$ node test.js -e "echo 'Hello World';"
```
# Use it

Will output :
```js
*** START TESTING ***
// initialize a new parser instance
var parser = require('php-parser').create();

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

-- AST :
// how to list tokens
var tokens = parser.tokenGetAll('<?php echo "Hello World";');
```

For more details please [visit he wiki](https://github.com/glayzzle/php-parser/docs).

# Output

```js
[
'program', <-- program node
[
Expand All @@ -47,42 +49,9 @@ T_ECHO T_CONSTANT_ENCAPSED_STRING ;
Try it online (demo) :
http://glayzzle.com/php-parser/#demo

# Use it

```js
// initialize a new parser instance
var parser = require('php-parser').create();

// how to retrieve the AST
var AST = parser.parseEval('echo "Hello World";');

// how to list tokens
var tokens = parser.tokenGetAll('<?php echo "Hello World";');
```

For more details please [visit he wiki](https://github.com/glayzzle/php-parser/wiki).

# Join the dev

If you want to change/fix the lexer you will find code to `./src/lexer/`.
You can also implement the parser, the code is into `./src/parser/`.
To check your changes add tests into `./test/parser/`, and run `npm run test`.
Try to keep or improve the coverage levels.

The command line options :

```sh
Usage: test [options] [-f] <file>

-f <file> Parse and test the specified file
-d <path> Parse each file in the specified path
-r Use recursivity with the specified path
-e Eval the specified input and shows AST
-v Enable verbose mode and show debug
-h, --help Print help and exit
```
# Contributing

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

# Misc

Expand Down
9 changes: 9 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Releases

## 1.0.0 : (2016-12-29)

- All nodes are now converted to objects
- Bruteforce tests are in a separate project
- Improved tests with mocha
- Many syntax fixes
- Tests over a silent error mode
- Release of a complete AST documentation

## 0.1.5 : (2016-12-27)

> The 0.1.x version starts to be deprecated
Expand Down
218 changes: 0 additions & 218 deletions bin/bench.js

This file was deleted.

Loading