Browse Source

Start compiling identifiers.

We'll need this if we support the "L == foobar" syntax, and besides
it should really be up to the parser client whether or not they use
identifiers with no function call or property reference.

It also allows us to generate error messages for unknown identifers.
pull/16/head
Jeff Young 5 years ago
parent
commit
2ea5528cd0
  1. 23
      common/libeval_compiler/libeval_compiler.cpp

23
common/libeval_compiler/libeval_compiler.cpp

@ -748,6 +748,29 @@ bool COMPILER::generateUCode( UCODE* aCode, CONTEXT* aPreflightContext )
break;
}
case TR_IDENTIFIER:
{
VAR_REF* vref = aCode->createVarRef( this, node->value.str, "" );
if( m_errorStatus.pendingError )
{
m_errorStatus.pendingError = true;
m_errorStatus.stage = ERROR_STATUS::CST_CODEGEN;
if( m_errorStatus.message == "var" )
{
m_errorStatus.message.Printf( _( "Unrecognized item '%s'" ),
node->value.str );
m_errorStatus.srcPos = node->srcPos - strlen( node->value.str );
}
return false;
}
node->uop = makeUop( TR_UOP_PUSH_VALUE, vref );
break;
}
default:
node->uop = makeUop( node->op );
break;

Loading…
Cancel
Save