hexLiteral method

Parser<ConstantNode> hexLiteral()
inherited

Implementation

Parser<ConstantNode> hexLiteral() =>
    ((string('0x') | string('0X')) &
            (pattern('0-9a-fA-F') | char('_')).plus().flatten())
        .flatten()
        .map(
          (s) => ConstantNode(
            int.parse(s.substring(2).replaceAll('_', ''), radix: 16),
          ),
        );