Introduce 'ubiquitous_tokens' concept, for parsing comments and such
This commit is contained in:
parent
b010e1667e
commit
4700e33746
24 changed files with 18321 additions and 19057 deletions
|
|
@ -97,14 +97,25 @@ print(object[propertyName()]);
|
|||
==========================================
|
||||
parses comments
|
||||
==========================================
|
||||
// this is another comment
|
||||
stuff(); // this is a comment
|
||||
/* this is a third comment */
|
||||
var thing = {
|
||||
|
||||
// this is a property.
|
||||
// its value is a function.
|
||||
key: function(x /* this is a parameter */) {
|
||||
|
||||
// this is a statement
|
||||
doStuff();
|
||||
}
|
||||
};
|
||||
---
|
||||
(program
|
||||
(program (var_declaration (assignment (identifier) (object
|
||||
(comment)
|
||||
(expression_statement (function_call (identifier))) (comment)
|
||||
(comment))
|
||||
(comment)
|
||||
(identifier) (function_expression
|
||||
(formal_parameters (identifier) (comment))
|
||||
(statement_block
|
||||
(comment)
|
||||
(expression_statement (function_call (identifier)))))))))
|
||||
|
||||
======================================
|
||||
parses real code
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue