UNPKG

@artemis-lang/parser

Version:

The artemis language parser

18 lines (15 loc) 369 B
import NodeTypes from '../../node/node-types'; import ParserPlugin from '../../parser-plugin'; const hexPlugin = new ParserPlugin( (parser) => { return parser.match('hex'); }, (parser) => { const left = parser.consume('hex', 'Expected hex').value; return { type: NodeTypes.HexLiteral, value: left }; } ); export default hexPlugin;