From 51e6c441f2515d92080f054978ac3cb25005ad3c Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Thu, 3 Oct 2019 13:32:43 -0700 Subject: [PATCH] Add documentation for pascaligo parser interface as .mli --- src/passes/1-parser/pascaligo.mli | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/passes/1-parser/pascaligo.mli diff --git a/src/passes/1-parser/pascaligo.mli b/src/passes/1-parser/pascaligo.mli new file mode 100644 index 000000000..e82d6ab35 --- /dev/null +++ b/src/passes/1-parser/pascaligo.mli @@ -0,0 +1,21 @@ +(* This file provides an interface to the PascaLIGO parser. *) + +open Trace + +module Parser = Parser_pascaligo.Parser +module AST = Parser_pascaligo.AST +module ParserLog = Parser_pascaligo.ParserLog +module LexToken = Parser_pascaligo.LexToken + + +(** Open a PascaLIGO filename given by string and convert into an abstract syntax tree. *) +val parse_file : string -> (AST.t result) + +(** Convert a given string into a PascaLIGO abstract syntax tree *) +val parse_string : string -> AST.t result + +(** Parse a given string as a PascaLIGO expression and return an expression AST. + +This is intended to be used for interactive interpreters, or other scenarios +where you would want to parse a PascaLIGO expression outside of a contract. *) +val parse_expression : string -> AST.expr result