proc_macro
Version:
A JavaScript implementation of proc_macros.
30 lines • 932 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var Expression = /** @class */ (function () {
function Expression() {
}
/**
* Method that attempts to parse the next token(s) into this expression.
* @param tokenStream The TokenStream trying to parse.
* @throws If the next token(s) cannot be parsed, an error is produced.
*/
Expression.parse = function (tokenStream) {
throw tokenStream.error("Parse not defined for expression.");
};
/**
* Checks if the class can be parsed.
* @param tokenStream The TokenStream trying to parse.
*/
Expression.canParse = function (tokenStream) {
try {
this.parse(tokenStream.clone());
return true;
}
catch (e) {
return false;
}
};
return Expression;
}());
exports.default = Expression;
//# sourceMappingURL=expression.js.map