Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bcardiff/crystal-ast-helper
Helper tool to debug parser and formatter
https://github.com/bcardiff/crystal-ast-helper
Last synced: about 2 months ago
JSON representation
Helper tool to debug parser and formatter
- Host: GitHub
- URL: https://github.com/bcardiff/crystal-ast-helper
- Owner: bcardiff
- License: mit
- Created: 2018-10-09T19:03:03.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-07T05:55:24.000Z (over 4 years ago)
- Last Synced: 2024-02-01T16:07:44.805Z (5 months ago)
- Language: Crystal
- Size: 7.81 KB
- Stars: 27
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-crystal - ast_helper - Helper tool to debug parser and formatter (Official Documentation Translations)
- awesome-crystal - ast_helper - Helper tool to debug parser and formatter (Official Documentation Translations)
README
# ast_helper
## Installation
```
$ git checkout https://github.com/bcardiff/crystal-ast-helper.git
$ cd crystal-ast-helper
$ shards
$ crystal src/ast_helper.cr$ open http://localhost:9090
```If you want to use with crystal head use:
```
$ path/to/crystal-clone/bin/crystal src/ast_helper.cr
```## Usage
When opening [http://localhost:9090](http://localhost:9090) you will be able to:
* input source
* view the output according to the formatter
* view the tokens returned by the lexer used for parsing and for formatting
* view the tokens consumed so far even if the formatter fails
* view the stack trace of each token
* view the AST of the whole program![](https://user-images.githubusercontent.com/459923/46692683-4d02af80-cbde-11e8-8af4-443432567a99.gif)
## Contributing
1. Fork it ()
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request## Contributors
- [bcardiff](https://github.com/bcardiff) Brian J. Cardiff - creator, maintainer