aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/CodeTools/lsl.parser.cs
diff options
context:
space:
mode:
authorMike Mazur2008-07-31 01:27:33 +0000
committerMike Mazur2008-07-31 01:27:33 +0000
commiteef386427863e27a40cb22a424ddb5ceeb6c7a56 (patch)
tree331ca69428a9ece47d412556a366839f76ffded2 /OpenSim/Region/ScriptEngine/Shared/CodeTools/lsl.parser.cs
parentMore LSL_Types implicit/explicit cast changes. Fix issue 1854. (diff)
downloadopensim-SC-eef386427863e27a40cb22a424ddb5ceeb6c7a56.zip
opensim-SC-eef386427863e27a40cb22a424ddb5ceeb6c7a56.tar.gz
opensim-SC-eef386427863e27a40cb22a424ddb5ceeb6c7a56.tar.bz2
opensim-SC-eef386427863e27a40cb22a424ddb5ceeb6c7a56.tar.xz
Fix issue 1860; exception thrown in the parser on if/if-else/for/while/do-while
statements with no body.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/CodeTools/lsl.parser.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/CodeTools/lsl.parser.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/lsl.parser.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/lsl.parser.cs
index e9b3886..9778245 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/lsl.parser.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/lsl.parser.cs
@@ -359,7 +359,7 @@ public override int yynum { get { return 114; }}
359public StateChange(Parser yyp):base(yyp){}} 359public StateChange(Parser yyp):base(yyp){}}
360//%+IfStatement+115 360//%+IfStatement+115
361public class IfStatement : SYMBOL{ 361public class IfStatement : SYMBOL{
362 private void AddStatement ( Statement s ){ if ( s . kids . Top is CompoundStatement ) kids . Add ( s . kids . Pop ()); 362 private void AddStatement ( Statement s ){ if (0< s . kids . Count && s . kids . Top is CompoundStatement ) kids . Add ( s . kids . Pop ());
363 else kids . Add ( s ); 363 else kids . Add ( s );
364} 364}
365 public IfStatement (Parser yyp, Expression e , Statement ifs ):base(((LSLSyntax 365 public IfStatement (Parser yyp, Expression e , Statement ifs ):base(((LSLSyntax
@@ -369,7 +369,7 @@ public class IfStatement : SYMBOL{
369 public IfStatement (Parser yyp, Expression e , Statement ifs , Statement es ):base(((LSLSyntax 369 public IfStatement (Parser yyp, Expression e , Statement ifs , Statement es ):base(((LSLSyntax
370)yyp)){ kids . Add ( e ); 370)yyp)){ kids . Add ( e );
371 AddStatement ( ifs ); 371 AddStatement ( ifs );
372 if ( es . kids . Top is IfStatement ) kids . Add ( es . kids . Pop ()); 372 if (0< es . kids . Count && es . kids . Top is IfStatement ) kids . Add ( es . kids . Pop ());
373 else AddStatement ( es ); 373 else AddStatement ( es );
374} 374}
375 375
@@ -380,7 +380,7 @@ public IfStatement(Parser yyp):base(yyp){}}
380public class WhileStatement : SYMBOL{ 380public class WhileStatement : SYMBOL{
381 public WhileStatement (Parser yyp, Expression e , Statement s ):base(((LSLSyntax 381 public WhileStatement (Parser yyp, Expression e , Statement s ):base(((LSLSyntax
382)yyp)){ kids . Add ( e ); 382)yyp)){ kids . Add ( e );
383 if ( s . kids . Top is CompoundStatement ) kids . Add ( s . kids . Pop ()); 383 if (0< s . kids . Count && s . kids . Top is CompoundStatement ) kids . Add ( s . kids . Pop ());
384 else kids . Add ( s ); 384 else kids . Add ( s );
385} 385}
386 386
@@ -390,7 +390,7 @@ public WhileStatement(Parser yyp):base(yyp){}}
390//%+DoWhileStatement+117 390//%+DoWhileStatement+117
391public class DoWhileStatement : SYMBOL{ 391public class DoWhileStatement : SYMBOL{
392 public DoWhileStatement (Parser yyp, Expression e , Statement s ):base(((LSLSyntax 392 public DoWhileStatement (Parser yyp, Expression e , Statement s ):base(((LSLSyntax
393)yyp)){ if ( s . kids . Top is CompoundStatement ) kids . Add ( s . kids . Pop ()); 393)yyp)){ if (0< s . kids . Count && s . kids . Top is CompoundStatement ) kids . Add ( s . kids . Pop ());
394 else kids . Add ( s ); 394 else kids . Add ( s );
395 kids . Add ( e ); 395 kids . Add ( e );
396} 396}
@@ -404,7 +404,7 @@ public class ForLoop : SYMBOL{
404)yyp)){ kids . Add ( flsa ); 404)yyp)){ kids . Add ( flsa );
405 kids . Add ( e ); 405 kids . Add ( e );
406 kids . Add ( flsb ); 406 kids . Add ( flsb );
407 if ( s . kids . Top is CompoundStatement ) kids . Add ( s . kids . Pop ()); 407 if (0< s . kids . Count && s . kids . Top is CompoundStatement ) kids . Add ( s . kids . Pop ());
408 else kids . Add ( s ); 408 else kids . Add ( s );
409} 409}
410 410