parseMichelsonExpression static method

String? parseMichelsonExpression(
  1. String code
)

Implementation

static String? parseMichelsonExpression(String code) {
  var parser = Nearley();
  parser.parser(Nearley.fromCompiled(MichelsonGrammar().grammar));
  code = code
      .replaceAll(RegExp(r'#.*$', multiLine: true), '')
      .replaceAll('\n', ' ')
      .trim();
  parser.feedExpressionOrScript(code);
  return parser.results[0];
}