parseMichelsonScript static method

String? parseMichelsonScript(
  1. String code
)

Implementation

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