diff options
author | Kelly Washington <kelly@lindenlab.com> | 2007-06-21 22:40:22 +0000 |
---|---|---|
committer | Kelly Washington <kelly@lindenlab.com> | 2007-06-21 22:40:22 +0000 |
commit | e03bb0606a10f29c8b94909a713a5bb5c69e88b7 (patch) | |
tree | 6d8d07894579438c8cc70e08f5730c3c95dfe768 /indra/lscript/lscript_compile/indra.y | |
parent | 2638f12f95eea692502836cf6548b4a0b234d009 (diff) |
merge -r62831:64079 branches/maintenance to release
Diffstat (limited to 'indra/lscript/lscript_compile/indra.y')
-rw-r--r-- | indra/lscript/lscript_compile/indra.y | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/indra/lscript/lscript_compile/indra.y b/indra/lscript/lscript_compile/indra.y index 7744649a92..c7a4fd6289 100644 --- a/indra/lscript/lscript_compile/indra.y +++ b/indra/lscript/lscript_compile/indra.y @@ -143,6 +143,8 @@ %type <assignable> simple_assignable %type <assignable> simple_assignable_no_list %type <constant> constant +%type <ival> integer_constant +%type <fval> fp_constant %type <assignable> special_constant %type <assignable> vector_constant %type <assignable> quaternion_constant @@ -352,30 +354,50 @@ simple_assignable_no_list ; constant - : INTEGER_CONSTANT + : integer_constant { $$ = new LLScriptConstantInteger(gLine, gColumn, $1); gAllocationManager->addAllocation($$); } - | INTEGER_TRUE + | fp_constant { - $$ = new LLScriptConstantInteger(gLine, gColumn, $1); + $$ = new LLScriptConstantFloat(gLine, gColumn, $1); gAllocationManager->addAllocation($$); } - | INTEGER_FALSE + | STRING_CONSTANT { - $$ = new LLScriptConstantInteger(gLine, gColumn, $1); + $$ = new LLScriptConstantString(gLine, gColumn, $1); gAllocationManager->addAllocation($$); } - | FP_CONSTANT + ; + +fp_constant + : FP_CONSTANT { - $$ = new LLScriptConstantFloat(gLine, gColumn, $1); - gAllocationManager->addAllocation($$); + $$ = $1; } - | STRING_CONSTANT + | '-' FP_CONSTANT { - $$ = new LLScriptConstantString(gLine, gColumn, $1); - gAllocationManager->addAllocation($$); + $$ = -$2; + } + ; + +integer_constant + : INTEGER_CONSTANT + { + $$ = $1; + } + | INTEGER_TRUE + { + $$ = $1; + } + | INTEGER_FALSE + { + $$ = $1; + } + | '-' INTEGER_CONSTANT + { + $$ = -$2; } ; |