Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Commits on Nov 19, 2010
  1. @laverdet

    Support for typehints and object literal elisons

    laverdet authored
    Summary:
    Included in this diff is support for type declarations as made popular by ActionScript. While not part of ECMAScript, if typing ever does make it into the language it will most likely look similar to this. By default type declarations will still yield a syntax error, however you may elect to tell the parser to allow these declarations by passing PARSE_TYPEHINT to the second parameter of NodeProgram.
    
    Additionally this adds support for trailing commas in object literals. While expressly allowed by ECMA-262, trailing commas in object literals have become defacto forbidden in most client-side JavaScript applications due to poor browser option.
    
    Test Plan:
    Compiles
    
    Reviewed By: epriestley
  2. @laverdet

    Cleanup various deficiencies

    laverdet authored
    Summary:
    This cleans up a lot of junk in the code like stray virtuals, missing refs and consts where applicable, better exceptions, and proper string literal rendering.
    
    Test Plan:
    Compiles
    
    Reviewed By: epriestley
Commits on Jun 23, 2009
  1. @DaveFet

    Adding Apache License 2.0

    DaveFet authored
    Reviewed By: marcel
Commits on Jun 18, 2009
  1. @laverdet

    Cleanup stuff

    laverdet authored
    Summary: - Get rid of my custom flex input function. I realized later that
             flex had this functionality built-in, I just didn't know how to use
             it.
             - Catch errors in jsbeautify
             - Remove shady `identifier()` method; replace with `isValidlVal()`.
             - Remove duped code in parser.cpp
    
    Reviewed By: epriestley
    
    Test Plan: * Ran jsbeautify through valgrind to ensure I haven't done
               anything terrible
               * Made `jsexports` and ran analyze_resources with it, no
               segfaults
               * Built fbjs, no errors.
    
    Revert: OK
    
    DiffCamp Revision: 51202
Commits on Nov 19, 2008
  1. @laverdet

    Making libfbjs actually libfbjs.so

    laverdet authored
    Summary:
    Cool
    
    Trac Bug: #
    
    Blame Rev:
    
    Reviewed By: dweatherford
    
    Test Plan: compiles (and runs)
    
    Revert Plan: ok
  2. @laverdet

    Implement the ability to the parse a char*

    laverdet authored
    Summary:
    This will be useful soon.
    
    Reviewed By: dweatherford
    
    Test Plan: Node* node  = new NodeProgram("if(1){alert(2)"});
    
    Revert Plan: ok
Commits on Nov 17, 2008
  1. @laverdet

    Splitting out NodeFunctionExpression and NodeFunctionDeclaration from…

    laverdet authored
    … NodeFunction
    
    Summary:
    Now the parser tree generated correctly distinguishes between function expressions and function declarations. This is necessary both to ensure proper emulation and also to ensure that all expression inherit from NodeExpression.
    
    Reviewed By: dweatherford
    
    Test Plan: all of my current tests passed
    
    Revert Plan: ok
Commits on Nov 16, 2008
  1. @laverdet

    Fix ambiguities between ObjectLiteral & Block

    laverdet authored
    Summary:
    There's been a long standing bug in the parser in that it can't properly parse `if(1){}`. The problem was an ambiguity between ObjectLiteral & Block. The ES-262 spec addresses this by saying an ExpressionStatement may not begin with a t_LCURLY or t_FUNCTION, though it's been unclear how to build this into the grammar. The answer was to duplicate the Expression grammar again, except removing all possible reductions that begin with t_LCURLY or t_FUNCTION (i.e. ObjectLiteral or FunctionExpression). The ES-262 spec does something similar to handle ambiguities with the in operator in for(in) loops.
    
    The new grammar has no reduce\reduce or shift\reduce conflicts so I've removed %glr-parser.
    
    This also removes an unintentional `using namespace fbjs` in parser.yacc.hpp (it was generated, so it wasn't quite obvious). Also the `using namespace std` in node.hpp.
    
    Reviewed By: dweatherford
    
    Test Plan:
    
    Revert Plan: ok
Commits on Sep 17, 2008
  1. @laverdet

    Updated lexer \ parser definition

    laverdet authored
    Summary:
    I've fixed a few bugs in the parser and lexer. Also this introduce a new parsing API that's a lot simpler than the old one. Now to parse and render some Javascript all you have to do is:
    Node node(stdin);
    cout << node.render();
    
    This commit might actually make this project uncompilable since I'm leaving out a bunch of other local changes I have. I just want to start to work on some different changes to the parser that I'm not fully committed to and need an exit plan if things go sour.
    
    Reviewed By: dcorson
    
    Test Plan: none
    
    Revert Plan: ok
Something went wrong with that request. Please try again.