Changeset 82cecb85d4b9fff471d3eadd986735ad736c6c3f

Show
Ignore:
Timestamp:
06/28/09 23:36:50 (14 months ago)
Author:
mb0 <mb0@…>
Children:
2d81bf0e2ed8217c6cb2a26fcb22d09b8441f7a3
Parents:
c598ac61d680bc607baa6ff4a8fbb9447b6cf4ed
git-author:
mb0 <mb0@…> (06/08/09 14:07:49)
git-committer:
mb0 <mb0@…> (06/28/09 23:36:50)
Message:

do not allow empty semicolon only allow virtual semicolon.
parsing without virtual semicolon insertion is now stricter..

Files:
4 modified

Legend:

Unmodified
Added
Removed
  • org.axdt.as3.test/src/org/axdt/as3/imp/parser/BasicParserTest.java

    ra106cc3 r82cecb8  
    9999        public void testImport() throws Exception { 
    100100                Program prog; ImportDirectiveList list; 
    101                 prog = parse("import A"); 
     101                prog = parse("import A;"); 
    102102                assertEquals(ImportDirectiveList.class, prog.getDirectives().getDirectiveAt(0).getClass()); 
    103                 prog = parse("import A import a.b.C; import abc.*"); 
     103                prog = parse("import A; import a.b.C; import abc.*;"); 
    104104                list = (ImportDirectiveList) prog.getDirectives().getDirectiveAt(0); 
    105105                assertEquals(3, list.size()); 
     
    126126                assertEquals(null, type.getBody().getDirectives()); 
    127127                 
    128                 prog = parse("interface A { function f():A;function g():B}"); 
     128                prog = parse("interface A { function f():A;function g():B;}"); 
    129129                assertEquals(InterfaceDefinition.class, prog.getDirectives().getDirectiveAt(0).getClass()); 
    130130                type = (InterfaceDefinition) prog.getDirectives().getDirectiveAt(0); 
     
    157157                assertEquals(FunctionDefinition.class, directive.getClass()); 
    158158 
    159                 prog = parse("function f(b:B){a = b;a.c()}"); 
     159                prog = parse("function f(b:B){a = b;a.c();}"); 
    160160                directive = prog.getDirectives().getDirectiveAt(0); 
    161161                def = (FunctionDefinition) directive; 
  • org.axdt.as3.test/src/org/axdt/as3/imp/parser/ExpressionTest.java

    re9006de r82cecb8  
    8787                assertExpression(parse("get"),Ident.class); 
    8888                assertExpression(parse("set"),Ident.class); 
    89                 assertExpression(parse("namespace"),Ident.class); 
     89                //assertExpression(parse("namespace"),Ident.class); 
    9090                assertExpression(parse("include"),Ident.class); 
    9191                assertExpression(parse("dynamic"),Ident.class); 
  • org.axdt.as3.test/src/org/axdt/as3/imp/parser/VirtualSemiTest.java

    r5eb830a r82cecb8  
    1111        } 
    1212        public void testVirtualSemi() throws Exception { 
    13                 assertNotNull(parse("{var i = 0;var j = 1}", false)); 
     13                assertNotNull(parse("{var i = 0;var j = 1;}", false)); 
    1414                // without virtual semi 
    1515                System.out.print("expected"); 
    16                 assertNull(parse("{var i = 0\nvar j = 1}", false)); 
     16                assertNull(parse("{var i = 0\nvar j = 1;}", false)); 
    1717                // with insertion  
    18                 assertNotNull(parse("{var i = 0;\nvar j = 1}", true)); 
    19                 assertNotNull(parse("{var i = 0\n;var j = 1}", true)); 
    20                 assertNotNull(parse("{var i = 0\nvar j = 1}", true)); 
     18                assertNotNull(parse("{var i = 0;\nvar j = 1;}", true)); 
     19                assertNotNull(parse("{var i = 0\n;var j = 1;}", true)); 
     20                assertNotNull(parse("{var i = 0\nvar j = 1;}", true)); 
    2121        } 
    2222} 
  • org.axdt.as3/src/org/axdt/as3/imp/parser/AS3Parser.g

    r369d8ec r82cecb8  
    121121 
    122122%Recover 
    123     VirtualSemicolon 
    124123%End 
    125124 
     
    552551SubstatementsPrefix$$Substatement_full ::= SubstatementsPrefix Substatement_full 
    553552 
    554 Semicolon_abbrev ::= %empty 
     553-- no empty semicolon ! use virtual semi now instead ! 
     554--Semicolon_abbrev ::= %empty 
    555555Semicolon_abbrev$Semicolon ::= SEMI$ | VirtualSemicolon$ 
    556556 
    557 Semicolon_nosif ::= %empty 
     557--Semicolon_nosif ::= %empty 
    558558Semicolon_nosif$Semicolon ::= SEMI$ | VirtualSemicolon$ 
    559559