From: lempinen Date: Tue, 29 Oct 2013 14:08:53 +0000 (+0000) Subject: Fixed support for variable names with spaces. X-Git-Tag: 1.8.1~210 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=bcc5714681584303fb63b1720ff434c02248b2e4;p=simantics%2Fsysdyn.git Fixed support for variable names with spaces. refs #4424 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@28149 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParser.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParser.java index 7b0111ab..913534fe 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParser.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParser.java @@ -1110,13 +1110,17 @@ public class UnitParser/*@bgen(jjtree)*/implements UnitParserTreeConstants, Unit jjtn000.jjtSetFirstToken(getToken(1)); try { jj_consume_token(IDENT); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IDENT: + label_7: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case IDENT: + ; + break; + default: + jj_la1[27] = jj_gen; + break label_7; + } jj_consume_token(IDENT); - break; - default: - jj_la1[27] = jj_gen; - ; } } finally { if (jjtc000) { @@ -1276,7 +1280,7 @@ public class UnitParser/*@bgen(jjtree)*/implements UnitParserTreeConstants, Unit jjtn000.jjtSetFirstToken(getToken(1)); try { for_index(); - label_7: + label_8: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 69: @@ -1284,7 +1288,7 @@ public class UnitParser/*@bgen(jjtree)*/implements UnitParserTreeConstants, Unit break; default: jj_la1[33] = jj_gen; - break label_7; + break label_8; } jj_consume_token(69); for_index(); @@ -1418,7 +1422,7 @@ void named_arguments() : { jj_la1[35] = jj_gen; ; } - label_8: + label_9: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 69: @@ -1426,7 +1430,7 @@ void named_arguments() : { break; default: jj_la1[36] = jj_gen; - break label_8; + break label_9; } jj_consume_token(69); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -1483,7 +1487,7 @@ void named_arguments() : { jjtn000.jjtSetFirstToken(getToken(1)); try { expression(); - label_9: + label_10: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 69: @@ -1491,7 +1495,7 @@ void named_arguments() : { break; default: jj_la1[38] = jj_gen; - break label_9; + break label_10; } jj_consume_token(69); expression(); @@ -1527,7 +1531,7 @@ void named_arguments() : { try { jj_consume_token(64); subscript(); - label_10: + label_11: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 69: @@ -1535,7 +1539,7 @@ void named_arguments() : { break; default: jj_la1[39] = jj_gen; - break label_10; + break label_11; } jj_consume_token(69); subscript(); @@ -1670,45 +1674,45 @@ void named_arguments() : { finally { jj_save(2, xla); } } - private boolean jj_3R_14() { + private boolean jj_3R_15() { if (jj_scan_token(66)) return true; - if (jj_3R_11()) return true; + if (jj_3R_12()) return true; return false; } private boolean jj_3_3() { - if (jj_3R_11()) return true; if (jj_3R_12()) return true; + if (jj_3R_13()) return true; return false; } - private boolean jj_3R_12() { + private boolean jj_3R_13() { if (jj_scan_token(60)) return true; return false; } - private boolean jj_3R_13() { + private boolean jj_3R_14() { if (jj_scan_token(IDENT)) return true; if (jj_scan_token(86)) return true; return false; } private boolean jj_3_2() { - if (jj_3R_13()) return true; + if (jj_3R_14()) return true; return false; } - private boolean jj_3R_11() { + private boolean jj_3R_12() { if (jj_scan_token(IDENT)) return true; Token xsp; xsp = jj_scanpos; - if (jj_3R_14()) jj_scanpos = xsp; + if (jj_3R_15()) jj_scanpos = xsp; return false; } private boolean jj_3_1() { - if (jj_3R_11()) return true; if (jj_3R_12()) return true; + if (jj_3R_13()) return true; return false; } diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParser.jj b/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParser.jj index 16eab62e..a3867bf7 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParser.jj +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParser.jj @@ -863,7 +863,7 @@ void component_identity() : {/*@bgen(jjtree) component_identity */ /*@egen*/ } {/*@bgen(jjtree) component_identity */ try { -/*@egen*/ ()?/*@bgen(jjtree)*/ +/*@egen*/ ()*/*@bgen(jjtree)*/ } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParser.jjt b/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParser.jjt index c6428eec..8c04b8d2 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParser.jjt +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/unitParser/UnitParser.jjt @@ -210,7 +210,7 @@ void component_reference() : { } void component_identity() : { -} { ()? +} { ()* } void function_call_args() : {