Пример #1
0
void Parser::keywordMessage(MethodGenerationContext* mgenc, bool super) {
    StdString kw = keyword();
    
    // special compilation for ifTrue and ifFalse
    if (!super && kw == "ifTrue:") {
        ifTrueMessage(mgenc);
        return;
    } else if (!super && kw == "ifFalse:") {
        ifFalseMessage(mgenc);
        return;
    }
    formula(mgenc);
    while (sym == Keyword) {
        kw.append(keyword());
        formula(mgenc);
    }

    VMSymbol* msg = GetUniverse()->SymbolFor(kw);

    mgenc->AddLiteralIfAbsent(msg);

    if (super)
        bcGen->EmitSUPERSEND(mgenc, msg);
    else
        bcGen->EmitSEND(mgenc, msg);

}
Пример #2
0
void Parser::keywordPattern(MethodGenerationContext* mgenc) {
    StdString kw;
    do {
        kw.append(keyword());
        mgenc->AddArgumentIfAbsent(argument());
    } while (sym == Keyword);

    mgenc->SetSignature(GetUniverse()->SymbolFor(kw));
}