From ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Thu, 30 Apr 2009 13:04:20 -0500 Subject: Second Life viewer sources 1.23.0-RC --- linden/indra/lscript/lscript_compile/indra.l | 51 ++++++--- linden/indra/lscript/lscript_compile/indra.y | 21 ++++ .../lscript/lscript_compile/lscript_alloc.cpp | 3 +- .../lscript/lscript_compile/lscript_bytecode.cpp | 3 +- .../lscript/lscript_compile/lscript_bytecode.h | 3 +- .../lscript/lscript_compile/lscript_error.cpp | 3 +- .../indra/lscript/lscript_compile/lscript_error.h | 3 +- .../indra/lscript/lscript_compile/lscript_heap.cpp | 3 +- .../indra/lscript/lscript_compile/lscript_heap.h | 3 +- .../lscript/lscript_compile/lscript_resource.cpp | 3 +- .../lscript/lscript_compile/lscript_resource.h | 3 +- .../lscript/lscript_compile/lscript_scope.cpp | 3 +- .../indra/lscript/lscript_compile/lscript_scope.h | 3 +- .../indra/lscript/lscript_compile/lscript_tree.cpp | 116 ++++++++++++++++++++- .../indra/lscript/lscript_compile/lscript_tree.h | 33 +++++- .../lscript/lscript_compile/lscript_typecheck.cpp | 3 +- .../lscript/lscript_compile/lscript_typecheck.h | 3 +- 17 files changed, 229 insertions(+), 31 deletions(-) (limited to 'linden/indra/lscript/lscript_compile') diff --git a/linden/indra/lscript/lscript_compile/indra.l b/linden/indra/lscript/lscript_compile/indra.l index 3e62195..ac52432 100644 --- a/linden/indra/lscript/lscript_compile/indra.l +++ b/linden/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); } @@ -116,6 +118,7 @@ extern "C" { int yyerror(const char *fmt, ...); } "object_rez" { count(); return(OBJECT_REZ); } "remote_data" { count(); return(REMOTE_DATA); } "http_response" { count(); return(HTTP_RESPONSE); } +"http_request" { count(); return(HTTP_REQUEST); } "." { count(); return(PERIOD); } @@ -219,16 +222,17 @@ extern "C" { int yyerror(const char *fmt, ...); } "INVENTORY_ALL" { count(); yylval.ival = LLAssetType::AT_NONE; return(INTEGER_CONSTANT); } "INVENTORY_NONE" { count(); yylval.ival = LLAssetType::AT_NONE; return(INTEGER_CONSTANT); } -"CHANGED_INVENTORY" { count(); yylval.ival = 0x1; return(INTEGER_CONSTANT); } -"CHANGED_COLOR" { count(); yylval.ival = 0x2; return(INTEGER_CONSTANT); } -"CHANGED_SHAPE" { count(); yylval.ival = 0x4; return(INTEGER_CONSTANT); } -"CHANGED_SCALE" { count(); yylval.ival = 0x8; return(INTEGER_CONSTANT); } -"CHANGED_TEXTURE" { count(); yylval.ival = 0x10; return(INTEGER_CONSTANT); } -"CHANGED_LINK" { count(); yylval.ival = 0x20; return(INTEGER_CONSTANT); } -"CHANGED_ALLOWED_DROP" { count(); yylval.ival = 0x40; return(INTEGER_CONSTANT); } -"CHANGED_OWNER" { count(); yylval.ival = 0x80; return(INTEGER_CONSTANT); } -"CHANGED_REGION" { count(); yylval.ival = 0x100; return(INTEGER_CONSTANT); } -"CHANGED_TELEPORT" { count(); yylval.ival = 0x200; return(INTEGER_CONSTANT); } +"CHANGED_INVENTORY" { count(); yylval.ival = CHANGED_INVENTORY; return(INTEGER_CONSTANT); } +"CHANGED_COLOR" { count(); yylval.ival = CHANGED_COLOR; return(INTEGER_CONSTANT); } +"CHANGED_SHAPE" { count(); yylval.ival = CHANGED_SHAPE; return(INTEGER_CONSTANT); } +"CHANGED_SCALE" { count(); yylval.ival = CHANGED_SCALE; return(INTEGER_CONSTANT); } +"CHANGED_TEXTURE" { count(); yylval.ival = CHANGED_TEXTURE; return(INTEGER_CONSTANT); } +"CHANGED_LINK" { count(); yylval.ival = CHANGED_LINK; return(INTEGER_CONSTANT); } +"CHANGED_ALLOWED_DROP" { count(); yylval.ival = CHANGED_ALLOWED_DROP; return(INTEGER_CONSTANT); } +"CHANGED_OWNER" { count(); yylval.ival = CHANGED_OWNER; return(INTEGER_CONSTANT); } +"CHANGED_REGION" { count(); yylval.ival = CHANGED_REGION; return(INTEGER_CONSTANT); } +"CHANGED_TELEPORT" { count(); yylval.ival = CHANGED_TELEPORT; return(INTEGER_CONSTANT); } +"CHANGED_REGION_START" { count(); yylval.ival = CHANGED_REGION_START; return(INTEGER_CONSTANT); } "OBJECT_UNKNOWN_DETAIL" { count(); yylval.ival = OBJECT_UNKNOWN_DETAIL; return(INTEGER_CONSTANT); } "OBJECT_NAME" { count(); yylval.ival = OBJECT_NAME; return(INTEGER_CONSTANT); } @@ -250,6 +254,8 @@ extern "C" { int yyerror(const char *fmt, ...); } "NULL_KEY" { yylval.sval = new char[UUID_STR_LENGTH]; strcpy(yylval.sval, "00000000-0000-0000-0000-000000000000"); return(STRING_CONSTANT); } "EOF" { yylval.sval = new char[UUID_STR_LENGTH]; strcpy(yylval.sval, "\n\n\n"); return(STRING_CONSTANT); } +"URL_REQUEST_GRANTED" { yylval.sval = new char[UUID_STR_LENGTH]; strcpy(yylval.sval, URL_REQUEST_GRANTED); return(STRING_CONSTANT); } +"URL_REQUEST_DENIED" { yylval.sval = new char[UUID_STR_LENGTH]; strcpy(yylval.sval, URL_REQUEST_DENIED); return(STRING_CONSTANT); } "PI" { count(); yylval.fval = F_PI; return(FP_CONSTANT); } "TWO_PI" { count(); yylval.fval = F_TWO_PI; return(FP_CONSTANT); } @@ -790,7 +796,7 @@ S32 yywrap() return(1); } -void comment() +void line_comment() { char c; @@ -798,6 +804,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/linden/indra/lscript/lscript_compile/indra.y b/linden/indra/lscript/lscript_compile/indra.y index fdc240c..e4b10ff 100644 --- a/linden/indra/lscript/lscript_compile/indra.y +++ b/linden/indra/lscript/lscript_compile/indra.y @@ -92,6 +92,7 @@ %token LINK_MESSAGE %token REMOTE_DATA %token HTTP_RESPONSE +%token HTTP_REQUEST %token IDENTIFIER %token STATE_DEFAULT @@ -195,6 +196,7 @@ %type object_rez %type remote_data %type http_response +%type http_request %type link_message %type timer %type chat @@ -848,6 +850,11 @@ event $$ = new LLScriptEventHandler(gLine, gColumn, $1, $2); gAllocationManager->addAllocation($$); } + | http_request compound_statement + { + $$ = new LLScriptEventHandler(gLine, gColumn, $1, $2); + gAllocationManager->addAllocation($$); + } ; state_entry @@ -1216,6 +1223,20 @@ http_response } ; +http_request + : HTTP_REQUEST '(' LLKEY IDENTIFIER ',' STRING IDENTIFIER ',' STRING IDENTIFIER ')' + { + LLScriptIdentifier *id1 = new LLScriptIdentifier(gLine, gColumn, $4); + gAllocationManager->addAllocation(id1); + LLScriptIdentifier *id2 = new LLScriptIdentifier(gLine, gColumn, $7); + gAllocationManager->addAllocation(id2); + LLScriptIdentifier *id3 = new LLScriptIdentifier(gLine, gColumn, $10); + gAllocationManager->addAllocation(id3); + $$ = new LLScriptHTTPRequestEvent(gLine, gColumn, id1, id2, id3); + gAllocationManager->addAllocation($$); + } + ; + compound_statement : '{' '}' { diff --git a/linden/indra/lscript/lscript_compile/lscript_alloc.cpp b/linden/indra/lscript/lscript_compile/lscript_alloc.cpp index f522e18..76713de 100644 --- a/linden/indra/lscript/lscript_compile/lscript_alloc.cpp +++ b/linden/indra/lscript/lscript_compile/lscript_alloc.cpp @@ -17,7 +17,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/linden/indra/lscript/lscript_compile/lscript_bytecode.cpp b/linden/indra/lscript/lscript_compile/lscript_bytecode.cpp index f6e5127..9cd7d48 100644 --- a/linden/indra/lscript/lscript_compile/lscript_bytecode.cpp +++ b/linden/indra/lscript/lscript_compile/lscript_bytecode.cpp @@ -17,7 +17,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/linden/indra/lscript/lscript_compile/lscript_bytecode.h b/linden/indra/lscript/lscript_compile/lscript_bytecode.h index c9f8633..5e2789d 100644 --- a/linden/indra/lscript/lscript_compile/lscript_bytecode.h +++ b/linden/indra/lscript/lscript_compile/lscript_bytecode.h @@ -17,7 +17,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/linden/indra/lscript/lscript_compile/lscript_error.cpp b/linden/indra/lscript/lscript_compile/lscript_error.cpp index 5bdf2a2..c1a765b 100644 --- a/linden/indra/lscript/lscript_compile/lscript_error.cpp +++ b/linden/indra/lscript/lscript_compile/lscript_error.cpp @@ -17,7 +17,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/linden/indra/lscript/lscript_compile/lscript_error.h b/linden/indra/lscript/lscript_compile/lscript_error.h index 2f8f8bc..95f48a4 100644 --- a/linden/indra/lscript/lscript_compile/lscript_error.h +++ b/linden/indra/lscript/lscript_compile/lscript_error.h @@ -17,7 +17,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/linden/indra/lscript/lscript_compile/lscript_heap.cpp b/linden/indra/lscript/lscript_compile/lscript_heap.cpp index 5dccce9..b4d2764 100644 --- a/linden/indra/lscript/lscript_compile/lscript_heap.cpp +++ b/linden/indra/lscript/lscript_compile/lscript_heap.cpp @@ -17,7 +17,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/linden/indra/lscript/lscript_compile/lscript_heap.h b/linden/indra/lscript/lscript_compile/lscript_heap.h index ced4609..b1a4b5c 100644 --- a/linden/indra/lscript/lscript_compile/lscript_heap.h +++ b/linden/indra/lscript/lscript_compile/lscript_heap.h @@ -17,7 +17,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/linden/indra/lscript/lscript_compile/lscript_resource.cpp b/linden/indra/lscript/lscript_compile/lscript_resource.cpp index eb23665..c5eff1c 100644 --- a/linden/indra/lscript/lscript_compile/lscript_resource.cpp +++ b/linden/indra/lscript/lscript_compile/lscript_resource.cpp @@ -17,7 +17,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/linden/indra/lscript/lscript_compile/lscript_resource.h b/linden/indra/lscript/lscript_compile/lscript_resource.h index f69e605..ede8b03 100644 --- a/linden/indra/lscript/lscript_compile/lscript_resource.h +++ b/linden/indra/lscript/lscript_compile/lscript_resource.h @@ -17,7 +17,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/linden/indra/lscript/lscript_compile/lscript_scope.cpp b/linden/indra/lscript/lscript_compile/lscript_scope.cpp index 95a8eae..e6a7940 100644 --- a/linden/indra/lscript/lscript_compile/lscript_scope.cpp +++ b/linden/indra/lscript/lscript_compile/lscript_scope.cpp @@ -17,7 +17,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/linden/indra/lscript/lscript_compile/lscript_scope.h b/linden/indra/lscript/lscript_compile/lscript_scope.h index 31125bc..ec36d37 100644 --- a/linden/indra/lscript/lscript_compile/lscript_scope.h +++ b/linden/indra/lscript/lscript_compile/lscript_scope.h @@ -17,7 +17,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/linden/indra/lscript/lscript_compile/lscript_tree.cpp b/linden/indra/lscript/lscript_compile/lscript_tree.cpp index 2a41d91..e291d4c 100644 --- a/linden/indra/lscript/lscript_compile/lscript_tree.cpp +++ b/linden/indra/lscript/lscript_compile/lscript_tree.cpp @@ -17,7 +17,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, @@ -630,7 +631,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"); @@ -3288,6 +3291,110 @@ S32 LLScriptHTTPResponseEvent::getSize() return 16; } +void LLScriptHTTPRequestEvent::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass pass, LSCRIPTPruneType ptype, BOOL &prunearg, LLScriptScope *scope, LSCRIPTType &type, LSCRIPTType basetype, U64 &count, LLScriptByteCodeChunk *chunk, LLScriptByteCodeChunk *heap, S32 stacksize, LLScriptScopeEntry *entry, S32 entrycount, LLScriptLibData **ldata) +{ + if (gErrorToText.getErrors()) + { + return; + } + switch(pass) + { + case LSCP_PRETTY_PRINT: + case LSCP_EMIT_ASSEMBLY: + fdotabs(fp, tabs, tabsize); + fprintf(fp, "http_request( key "); + mRequestId->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); + fprintf(fp, ", string "); + mMethod->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); + fprintf(fp, ", string "); + mBody->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); + fprintf(fp, " )\n"); + break; + + case LSCP_SCOPE_PASS1: + checkForDuplicateHandler(fp, this, scope, "http_request"); + if (scope->checkEntry(mRequestId->mName)) + { + gErrorToText.writeError(fp, this, LSERROR_DUPLICATE_NAME); + } + else + { + mRequestId->mScopeEntry = scope->addEntry(mRequestId->mName, LIT_VARIABLE, LST_KEY); + } + + if (scope->checkEntry(mMethod->mName)) + { + gErrorToText.writeError(fp, this, LSERROR_DUPLICATE_NAME); + } + else + { + mMethod->mScopeEntry = scope->addEntry(mMethod->mName, LIT_VARIABLE, LST_STRING); + } + + if (scope->checkEntry(mBody->mName)) + { + gErrorToText.writeError(fp, this, LSERROR_DUPLICATE_NAME); + } + else + { + mBody->mScopeEntry = scope->addEntry(mBody->mName, LIT_VARIABLE, LST_STRING); + } + break; + + case LSCP_RESOURCE: + { + // we're just tryng to determine how much space the variable needs + if (mRequestId->mScopeEntry) + { + mRequestId->mScopeEntry->mOffset = (S32)count; + mRequestId->mScopeEntry->mSize = 4; + count += mRequestId->mScopeEntry->mSize; + + mMethod->mScopeEntry->mOffset = (S32)count; + mMethod->mScopeEntry->mSize = 4; + count += mMethod->mScopeEntry->mSize; + + mBody->mScopeEntry->mOffset = (S32)count; + mBody->mScopeEntry->mSize = 4; + count += mBody->mScopeEntry->mSize; + } + } + break; + + case LSCP_EMIT_BYTE_CODE: + { +#ifdef LSL_INCLUDE_DEBUG_INFO + char name[] = "http_request"; + chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/ + chunk->addBytes(mRequestId->mName, strlen(mRequestId->mName) + 1); /*Flawfinder: ignore*/ + chunk->addBytes(mMethod->mName, strlen(mMethod->mName) + 1); /*Flawfinder: ignore*/ + chunk->addBytes(mBody->mName, strlen(mBody->mName) + 1); /*Flawfinder: ignore*/ +#endif + } + break; + case LSCP_EMIT_CIL_ASSEMBLY: + fdotabs(fp, tabs, tabsize); + fprintf(fp, "http_request( valuetype [ScriptTypes]LindenLab.SecondLife.Key "); + mRequestId->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); + fprintf(fp, ", string "); + mMethod->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); + fprintf(fp, ", string "); + mBody->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); + fprintf(fp, " )\n"); + break; + default: + mRequestId->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); + mMethod->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); + mBody->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); + break; + } +} + +S32 LLScriptHTTPRequestEvent::getSize() +{ + // key + string + string = 12 + return 12; +} void LLScriptMoneyEvent::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass pass, LSCRIPTPruneType ptype, BOOL &prunearg, LLScriptScope *scope, LSCRIPTType &type, LSCRIPTType basetype, U64 &count, LLScriptByteCodeChunk *chunk, LLScriptByteCodeChunk *heap, S32 stacksize, LLScriptScopeEntry *entry, S32 entrycount, LLScriptLibData **ldata) { @@ -9655,6 +9762,11 @@ void LLScriptEventHandler::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom mScopeEntry->mFunctionArgs.addType(LST_LIST); mScopeEntry->mFunctionArgs.addType(LST_STRING); break; + case LSTT_HTTP_REQUEST: + mScopeEntry->mFunctionArgs.addType(LST_KEY); + mScopeEntry->mFunctionArgs.addType(LST_STRING); + mScopeEntry->mFunctionArgs.addType(LST_STRING); + break; default: break; diff --git a/linden/indra/lscript/lscript_compile/lscript_tree.h b/linden/indra/lscript/lscript_compile/lscript_tree.h index 0e110f5..12c1690 100644 --- a/linden/indra/lscript/lscript_compile/lscript_tree.h +++ b/linden/indra/lscript/lscript_compile/lscript_tree.h @@ -17,7 +17,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, @@ -758,12 +759,12 @@ class LLScriptHTTPResponseEvent : public LLScriptEvent { public: LLScriptHTTPResponseEvent(S32 line, S32 col, - LLScriptIdentifier *reqeust_id, + LLScriptIdentifier *request_id, LLScriptIdentifier *status, LLScriptIdentifier *metadata, LLScriptIdentifier *body) : LLScriptEvent(line, col, LSTT_HTTP_RESPONSE), - mRequestId(reqeust_id), mStatus(status), mMetadata(metadata), mBody(body) + mRequestId(request_id), mStatus(status), mMetadata(metadata), mBody(body) { } @@ -782,6 +783,32 @@ public: LLScriptIdentifier *mBody; }; +class LLScriptHTTPRequestEvent : public LLScriptEvent +{ +public: + LLScriptHTTPRequestEvent(S32 line, S32 col, + LLScriptIdentifier *request_id, + LLScriptIdentifier *method, + LLScriptIdentifier *body) + : LLScriptEvent(line, col, LSTT_HTTP_REQUEST), + mRequestId(request_id), mMethod(method), mBody(body) + { + } + + void recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass pass, + LSCRIPTPruneType ptype, BOOL &prunearg, LLScriptScope *scope, + LSCRIPTType &type, LSCRIPTType basetype, U64 &count, + LLScriptByteCodeChunk *chunk, LLScriptByteCodeChunk *heap, + S32 stacksize, LLScriptScopeEntry *entry, + S32 entrycount, LLScriptLibData **ldata); + + S32 getSize(); + + LLScriptIdentifier *mRequestId; + LLScriptIdentifier *mMethod; + LLScriptIdentifier *mBody; +}; + class LLScriptRezEvent : public LLScriptEvent { public: diff --git a/linden/indra/lscript/lscript_compile/lscript_typecheck.cpp b/linden/indra/lscript/lscript_compile/lscript_typecheck.cpp index ed01cdd..6a409b8 100644 --- a/linden/indra/lscript/lscript_compile/lscript_typecheck.cpp +++ b/linden/indra/lscript/lscript_compile/lscript_typecheck.cpp @@ -17,7 +17,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/linden/indra/lscript/lscript_compile/lscript_typecheck.h b/linden/indra/lscript/lscript_compile/lscript_typecheck.h index 7e3a35d..cebe3ce 100644 --- a/linden/indra/lscript/lscript_compile/lscript_typecheck.h +++ b/linden/indra/lscript/lscript_compile/lscript_typecheck.h @@ -17,7 +17,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, -- cgit v1.1