Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add syntax highlighting for los github

  • Loading branch information...
commit 1ea9e49e732d1ae7ed3b0d61e8f2232473b191ac 1 parent c0c43a6
@wycats authored
Showing with 9 additions and 3 deletions.
  1. +9 −3 README.markdown
View
12 README.markdown
@@ -27,18 +27,24 @@ from the code.
ParseJS is provided as a Rubygem. At the moment, you can use it in your Gemfile by using
Bundler's git feature.
- gem "parsejs", :git => "git://github.com/wycats/parsejs.git"
+```ruby
+gem "parsejs", :git => "git://github.com/wycats/parsejs.git"
+```
You can parse a String of JavaScript and receive an AST by using
`ParseJS.parse`.
- ast = ParseJS.parse(some_data)
+```ruby
+ast = ParseJS.parse(some_data)
+```
You can convert the AST back into a JavaScript String using the
stringifier. You can mutate the AST before converting it into a String
if you wish.
- ParseJS::Stringifier.to_string(ast)
+```
+ParseJS::Stringifier.to_string(ast)
+```
You can write your own AST walker without implementing visitors for all
nodes by subclassing `ParseJS::Visitor`. Take a look
Please sign in to comment.
Something went wrong with that request. Please try again.