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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user