@artemis-lang/parser
Version:
The artemis language parser
18 lines (15 loc) • 387 B
text/typescript
import NodeTypes from '../../node/node-types';
import ParserPlugin from '../../parser-plugin';
const binaryPlugin = new ParserPlugin(
(parser) => {
return parser.match('binary');
},
(parser) => {
const left = parser.consume('binary', 'Expected binary').value;
return {
type: NodeTypes.BinaryLiteral,
value: left
};
}
);
export default binaryPlugin;