if (data == NULL || fout == NULL)
return;
- if (!expand || data[0] != '"' && data[0] != '\'')
+ if (!expand ||
+ data[0] != '@' && data[0] != '"' && data[0] != '\'' ||
+ data[0] == '@' && data[1] != '"' && data[1] != '\''
+ )
fputs(data, fout);
else for (size_t i(0); i != size; ++i)
if (data[i] != '\\')
if (parser.parse() != 0 || !driver.errors_.empty())
return NULL;
- CYExpress *express(dynamic_cast<CYExpress *>(driver.program_->statements_));
- _assert(express != NULL);
- return express->expression_;
+ CYOptions options;
+ CYContext context(options);
+
+ // XXX: this could be replaced with a CYStatement::Primitive()
+ if (CYExpress *express = dynamic_cast<CYExpress *>(driver.program_->statements_))
+ return express->expression_->Primitive(context);
+
+ return NULL;
}
static int client_;
driver.program_ = $ CYProgram($ CYExpress($C3(ParseExpression(
" function(object, prefix, word) {\n"
" var names = [];\n"
- " var pattern = '^' + prefix + word;\n"
- " var length = prefix.length;\n"
+ " var before = prefix.length;\n"
+ " prefix += word;\n"
+ " var entire = prefix.length;\n"
" for (name in object)\n"
- " if (name.match(pattern) != null)\n"
- " names.push(name.substr(length));\n"
+ " if (name.substring(0, entire) == prefix)\n"
+ " names.push(name.substr(before));\n"
" return names;\n"
" }\n"
), expression, $S(begin.c_str()), $S(word))));