Skip to content

Commit

Permalink
Merge branch 'master' of github.com:sirikata/sirikata
Browse files Browse the repository at this point in the history
  • Loading branch information
ewencp committed Jun 1, 2011
2 parents defb4b7 + 4b4a2a9 commit 93c516d
Show file tree
Hide file tree
Showing 14 changed files with 19,289 additions and 16,924 deletions.
2 changes: 1 addition & 1 deletion externals/prox
12 changes: 7 additions & 5 deletions liboh/plugins/js/JSSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ void JSSerializer::serializeObjectInternal(v8::Local<v8::Value> v8Val, Sirikata:
v8::Local<v8::Object> v8Obj = v8Val->ToObject();

//stamps message
annotateObject(objVec,v8Obj,toStampWith);
annotateMessage(jsmessage,toStampWith);


if(v8Obj->InternalFieldCount() > 0)
{
v8::Local<v8::Value> typeidVal = v8Obj->GetInternalField(TYPEID_FIELD);
Expand Down Expand Up @@ -351,7 +351,7 @@ void JSSerializer::serializeObjectInternal(v8::Local<v8::Value> v8Val, Sirikata:
{
//means that we have not already stamped this function object
//as having been serialized. need to serialize it now.
annotateObject(objVec,v8Func,toStampWith);
//annotateObject(objVec,v8Func,toStampWith);
serializeFunctionInternal(v8Func, jsf_value,toStampWith);
}
else
Expand All @@ -375,7 +375,7 @@ void JSSerializer::serializeObjectInternal(v8::Local<v8::Value> v8Val, Sirikata:
if (hiddenValue.IsEmpty())
{
//means that we have not already stamped this object, and should now
annotateObject(objVec,v8Array,toStampWith);
//annotateObject(objVec,v8Array,toStampWith);
Sirikata::JS::Protocol::IJSMessage ijs_m = jsf_value.mutable_a_value();
serializeObjectInternal(v8Array, ijs_m, toStampWith,objVec);

Expand All @@ -399,7 +399,7 @@ void JSSerializer::serializeObjectInternal(v8::Local<v8::Value> v8Val, Sirikata:
{
//means that we have not already stamped this object, and should
//now
annotateObject(objVec,v8obj,toStampWith);
//annotateObject(objVec,v8obj,toStampWith);

Sirikata::JS::Protocol::IJSMessage ijs_o = jsf_value.mutable_o_value();
//recursively call serialize on this
Expand Down Expand Up @@ -483,7 +483,9 @@ bool JSSerializer::deserializeObject( JSObjectScript* jsObjScript, Sirikata::JS:
FixupMap toFixUp;
v8::Handle<v8::Object> tmpParent;

//if can't handle first stage of deserialization, don't even worry about fixups
//if can't handle first stage of deserialization, don't even worry about
//fixups
labeledObjs[jsmessage.msg_id()] = deserializeTo;
if (! deserializeObjectInternal(jsObjScript, jsmessage,deserializeTo, labeledObjs,toFixUp))
return false;

Expand Down
24 changes: 17 additions & 7 deletions liboh/plugins/js/emerson/Emerson.g
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ tokens
DEFAULT;
SWITCH;
CASE;
CASE_BLOCK;
LABEL;
ASSIGN;
MULT_ASSIGN;
Expand Down Expand Up @@ -184,8 +185,8 @@ statement
| breakStatement
| returnStatement
| withStatement
| switchStatement
| labelledStatement
| switchStatement
| throwStatement
| whenStatement
| tryStatement
Expand Down Expand Up @@ -322,18 +323,27 @@ switchStatement
: 'switch' LTERM* '(' LTERM* expression LTERM* ')' LTERM* caseBlock -> ^(SWITCH expression caseBlock)
;
caseBlock
: '{' (LTERM* case1=caseClause)* (LTERM* defaultClause (LTERM* case2=caseClause)*)? LTERM* '}' -> ^($case1)* (^(defaultClause)*)? (^($case2)*)?
;
: '{' LTERM* case1=caseClause? LTERM* '}' -> ^(CASE_BLOCK $case1?)
| '{' LTERM* def=defaultClause LTERM* '}' -> ^(CASE_BLOCK $def)
;
caseClause
: 'case' LTERM* expression LTERM* ':' LTERM* statementList? -> ^( CASE expression statementList?)
;
:'case' LTERM* expression LTERM* ':' LTERM* statementList? LTERM* defaultClause -> ^( CASE expression statementList? defaultClause)
| 'case' LTERM* expression LTERM* ':' LTERM* statementList? LTERM* caseClause? -> ^( CASE expression statementList? caseClause?)
;
defaultClause
: 'default' LTERM* ':' LTERM* statementList? -> ^(DEFAULT statementList?)
: 'default' LTERM* ':' LTERM* statementList? LTERM* caseClauseSeenDefault? -> ^(DEFAULT statementList? caseClauseSeenDefault?)
;
caseClauseSeenDefault
: 'case' LTERM* expression LTERM* ':' LTERM* statementList? LTERM* caseClauseSeenDefault? -> ^( CASE expression statementList? caseClauseSeenDefault?)
;
throwStatement
: 'throw' expression (LTERM | ';') -> ^(THROW expression)
;
Expand Down
Loading

0 comments on commit 93c516d

Please sign in to comment.