altoviso / bdParse

a JavaScript LL(1) parser in JavaScript
http://bdframework.org/bdParse/index.html
Other
14 stars 3 forks source link

booleans become undefined in AST #3

Open csnover opened 13 years ago

csnover commented 13 years ago

The following code:

var a = true;

is transformed into the following tree:

{ type: { value: 'asnRoot' },
  comment: undefined,
  location: { startLine: 2, startCol: 0, endLine: 2, endCol: 13 },
  children: 
   [ { type: { value: 'asnVar' },
       comment: undefined,
       location: { startLine: 2, startCol: 0, endLine: 2, endCol: 13 },
       children: 
        [ { name: 
             { type: { value: 'tName', isExprAtom: true },
               value: 'a',
               location: { startLine: 2, startCol: 4, endLine: 2, endCol: 5 },
               newlineBefore: false,
               comment: undefined },
            initialValue: 
             { type: { value: 'asnName' },
               comment: undefined,
               location: { startLine: 2, startCol: 8, endLine: 2, endCol: 12 },
               children: 
                { type: { value: 'tName', isExprAtom: true },
                  value: undefined,
                  location: { startLine: 2, startCol: 8, endLine: 2, endCol: 12 },
                  newlineBefore: false,
                  comment: undefined } },
            comment: undefined } ],
       parent: [Circular] } ] }