Skip to content

Commit

Permalink
Add short description of JS parser to readme, see #67
Browse files Browse the repository at this point in the history
  • Loading branch information
tdewolff committed Nov 19, 2020
1 parent a539aff commit 58df9bc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 0 additions & 1 deletion css/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ func main() {
}
fmt.Println(out)
}

```

## License
Expand Down
9 changes: 9 additions & 0 deletions js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ func main() {
}
```

## Parser
### Usage
The following parses a file and returns an abstract syntax tree (AST).
``` go
ast, err := js.NewParser(parse.NewInputString("if (state == 5) { console.log('In state five'); }"))
```

See [ast.go](https://github.com/tdewolff/parse/blob/master/js/ast.go) for all available data structures that can represent the abstact syntax tree.

## License
Released under the [MIT license](https://github.com/tdewolff/parse/blob/master/LICENSE.md).

Expand Down

0 comments on commit 58df9bc

Please sign in to comment.