aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/lscript/lscript_compile/indra.y
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:59 -0500
committerJacek Antonelli2008-08-15 23:44:59 -0500
commita408bac29378072fbf36864164149458c978cfcc (patch)
tree67feccf1a5d3816611ba48d6762f86f0f7f4b1f6 /linden/indra/lscript/lscript_compile/indra.y
parentSecond Life viewer sources 1.17.0.12 (diff)
downloadmeta-impy-a408bac29378072fbf36864164149458c978cfcc.zip
meta-impy-a408bac29378072fbf36864164149458c978cfcc.tar.gz
meta-impy-a408bac29378072fbf36864164149458c978cfcc.tar.bz2
meta-impy-a408bac29378072fbf36864164149458c978cfcc.tar.xz
Second Life viewer sources 1.17.1.0
Diffstat (limited to '')
-rw-r--r--linden/indra/lscript/lscript_compile/indra.y44
1 files changed, 33 insertions, 11 deletions
diff --git a/linden/indra/lscript/lscript_compile/indra.y b/linden/indra/lscript/lscript_compile/indra.y
index 7744649..c7a4fd6 100644
--- a/linden/indra/lscript/lscript_compile/indra.y
+++ b/linden/indra/lscript/lscript_compile/indra.y
@@ -143,6 +143,8 @@
143%type <assignable> simple_assignable 143%type <assignable> simple_assignable
144%type <assignable> simple_assignable_no_list 144%type <assignable> simple_assignable_no_list
145%type <constant> constant 145%type <constant> constant
146%type <ival> integer_constant
147%type <fval> fp_constant
146%type <assignable> special_constant 148%type <assignable> special_constant
147%type <assignable> vector_constant 149%type <assignable> vector_constant
148%type <assignable> quaternion_constant 150%type <assignable> quaternion_constant
@@ -352,30 +354,50 @@ simple_assignable_no_list
352 ; 354 ;
353 355
354constant 356constant
355 : INTEGER_CONSTANT 357 : integer_constant
356 { 358 {
357 $$ = new LLScriptConstantInteger(gLine, gColumn, $1); 359 $$ = new LLScriptConstantInteger(gLine, gColumn, $1);
358 gAllocationManager->addAllocation($$); 360 gAllocationManager->addAllocation($$);
359 } 361 }
360 | INTEGER_TRUE 362 | fp_constant
361 { 363 {
362 $$ = new LLScriptConstantInteger(gLine, gColumn, $1); 364 $$ = new LLScriptConstantFloat(gLine, gColumn, $1);
363 gAllocationManager->addAllocation($$); 365 gAllocationManager->addAllocation($$);
364 } 366 }
365 | INTEGER_FALSE 367 | STRING_CONSTANT
366 { 368 {
367 $$ = new LLScriptConstantInteger(gLine, gColumn, $1); 369 $$ = new LLScriptConstantString(gLine, gColumn, $1);
368 gAllocationManager->addAllocation($$); 370 gAllocationManager->addAllocation($$);
369 } 371 }
370 | FP_CONSTANT 372 ;
373
374fp_constant
375 : FP_CONSTANT
371 { 376 {
372 $$ = new LLScriptConstantFloat(gLine, gColumn, $1); 377 $$ = $1;
373 gAllocationManager->addAllocation($$);
374 } 378 }
375 | STRING_CONSTANT 379 | '-' FP_CONSTANT
376 { 380 {
377 $$ = new LLScriptConstantString(gLine, gColumn, $1); 381 $$ = -$2;
378 gAllocationManager->addAllocation($$); 382 }
383 ;
384
385integer_constant
386 : INTEGER_CONSTANT
387 {
388 $$ = $1;
389 }
390 | INTEGER_TRUE
391 {
392 $$ = $1;
393 }
394 | INTEGER_FALSE
395 {
396 $$ = $1;
397 }
398 | '-' INTEGER_CONSTANT
399 {
400 $$ = -$2;
379 } 401 }
380 ; 402 ;
381 403