Handbook
Glossary
parse-javascript ( input -- ast )
Vocabulary
peg
.
javascript
Inputs
input
a
string
Outputs
ast
a JavaScript abstract syntax tree
Word description
Parse the input string using the JavaScript parser. Throws an error if the string does not contain valid JavaScript. Returns the abstract syntax tree if successful.
Definition
USING:
accessors
namespaces
peg
peg.private
;
IN:
peg.javascript
:
parse-javascript
( input -- ast )
[
\
( gensym )
perform-parse
]
with-scope
check-parse-result
ast>>
;