root/org.axdt.as3.test/src/org/axdt/as3/imp/parser/VirtualSemiTest.java @ 82cecb85d4b9fff471d3eadd986735ad736c6c3f

Revision 82cecb85d4b9fff471d3eadd986735ad736c6c3f, 0.7 KB (checked in by mb0 <mb0@…>, 15 months ago)

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

  • Property mode set to 100644
Line 
1package org.axdt.as3.imp.parser;
2
3import org.axdt.as3.imp.parser.Ast.Program;
4
5import junit.framework.TestCase;
6
7public class VirtualSemiTest extends TestCase {
8
9        public static Program parse(String content, boolean insertVirtualSemi) {
10                return ParseUtil.parse(content, 0, insertVirtualSemi);
11        }
12        public void testVirtualSemi() throws Exception {
13                assertNotNull(parse("{var i = 0;var j = 1;}", false));
14                // without virtual semi
15                System.out.print("expected");
16                assertNull(parse("{var i = 0\nvar j = 1;}", false));
17                // 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));
21        }
22}
Note: See TracBrowser for help on using the browser.