summaryrefslogtreecommitdiff
path: root/indra/lscript
diff options
context:
space:
mode:
authorRobert Knop <prospero@lindenlab.com>2008-12-04 22:36:34 +0000
committerRobert Knop <prospero@lindenlab.com>2008-12-04 22:36:34 +0000
commit189599b6ff0c4e6b81e761fbc990c057189359f2 (patch)
tree1e9e0e91bae9bb1ee53e57ac91cdbbfc9f6dba95 /indra/lscript
parentfd46865a502036b9e4414e7ec4950faf551b1f14 (diff)
Merging from server/server-1.25 back to trunk.
svn merge -r99446:104838 svn+ssh://svn.lindenlab.com/svn/linden/branches/server/server-1.25 Conflicts resolved by Prospero, except for one scary conflict in SendConfirmationEmail.php which was resolved by jarv.
Diffstat (limited to 'indra/lscript')
-rw-r--r--indra/lscript/lscript_compile/indra.l27
-rw-r--r--indra/lscript/lscript_compile/lscript_tree.cpp4
-rw-r--r--indra/lscript/lscript_execute/lscript_execute.cpp9
3 files changed, 33 insertions, 7 deletions
diff --git a/indra/lscript/lscript_compile/indra.l b/indra/lscript/lscript_compile/indra.l
index 3e62195dc8..2616b47c73 100644
--- a/indra/lscript/lscript_compile/indra.l
+++ b/indra/lscript/lscript_compile/indra.l
@@ -36,7 +36,8 @@ FS (f|F)
#include "llclickaction.h"
void count();
-void comment();
+void line_comment();
+void block_comment();
void parse_string();
#define YYLMAX 16384
@@ -60,7 +61,8 @@ extern "C" { int yyerror(const char *fmt, ...); }
%}
%%
-"//" { gInternalLine++; gInternalColumn = 0; comment(); }
+"//" { gInternalLine++; gInternalColumn = 0; line_comment(); }
+"/*" { block_comment(); }
"integer" { count(); return(INTEGER); }
"float" { count(); return(FLOAT_TYPE); }
@@ -790,7 +792,7 @@ S32 yywrap()
return(1);
}
-void comment()
+void line_comment()
{
char c;
@@ -798,6 +800,25 @@ void comment()
;
}
+void block_comment()
+{
+ char c1 = 0;
+ char c2 = yyinput();
+ while (c2 != 0 && c2 != EOF && !(c1 == '*' && c2 == '/')) {
+ if (c2 == '\n')
+ {
+ gInternalLine++;
+ gInternalColumn = 0;
+ }
+ else if (c2 == '\t')
+ gInternalColumn += 4 - (gInternalColumn % 8);
+ else
+ gInternalColumn++;
+ c1 = c2;
+ c2 = yyinput();
+ }
+}
+
void count()
{
S32 i;
diff --git a/indra/lscript/lscript_compile/lscript_tree.cpp b/indra/lscript/lscript_compile/lscript_tree.cpp
index 66f8825845..cd2dc87c5e 100644
--- a/indra/lscript/lscript_compile/lscript_tree.cpp
+++ b/indra/lscript/lscript_compile/lscript_tree.cpp
@@ -630,7 +630,9 @@ static void print_cil_cast(LLFILE* fp, LSCRIPTType srcType, LSCRIPTType targetTy
switch(targetType)
{
case LST_INTEGER:
- fprintf(fp, "conv.i4\n");
+ //fprintf(fp, "call int32 [LslLibrary]LindenLab.SecondLife.LslRunTime::ToInteger(float32)\n");
+ fprintf(fp, "conv.i4\n"); // TODO replace this line with the above
+ // we the entire grid is > 1.25.1
break;
case LST_STRING:
fprintf(fp, "call string [LslLibrary]LindenLab.SecondLife.LslRunTime::ToString(float32)\n");
diff --git a/indra/lscript/lscript_execute/lscript_execute.cpp b/indra/lscript/lscript_execute/lscript_execute.cpp
index 52e3af320c..6280719748 100644
--- a/indra/lscript/lscript_execute/lscript_execute.cpp
+++ b/indra/lscript/lscript_execute/lscript_execute.cpp
@@ -891,14 +891,13 @@ void LLScriptExecute::runInstructions(BOOL b_print, const LLUUID &id,
b_done = TRUE;
}
- while (!b_done)
+ if (!b_done)
{
// Call handler for next queued event.
if(getEventCount() > 0)
{
++events_processed;
callNextQueuedEventHandler(event_register, id, quanta);
- b_done = TRUE;
}
else
{
@@ -910,8 +909,8 @@ void LLScriptExecute::runInstructions(BOOL b_print, const LLUUID &id,
++events_processed;
callEventHandler(event, id, quanta);
}
- b_done = TRUE;
}
+ b_done = TRUE;
}
}
}
@@ -946,6 +945,10 @@ F32 LLScriptExecute::runQuanta(BOOL b_print, const LLUUID &id, const char **erro
timer_checks = 0;
}
}
+ if (inloop == 0.0f)
+ {
+ inloop = timer.getElapsedTimeF32();
+ }
return inloop;
}