From 71d5a2540a98c81f5bcaeb48805e0e2881f530ef Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 16 Apr 2017 16:01:22 +0000 Subject: Vendor import of llvm trunk r300422: https://llvm.org/svn/llvm-project/llvm/trunk@300422 --- docs/tutorial/OCamlLangImpl5.rst | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'docs/tutorial/OCamlLangImpl5.rst') diff --git a/docs/tutorial/OCamlLangImpl5.rst b/docs/tutorial/OCamlLangImpl5.rst index 3a135b233373..6e17de4b2bde 100644 --- a/docs/tutorial/OCamlLangImpl5.rst +++ b/docs/tutorial/OCamlLangImpl5.rst @@ -103,19 +103,7 @@ Parser Extensions for If/Then/Else Now that we have the relevant tokens coming from the lexer and we have the AST node to build, our parsing logic is relatively straightforward. -First we define a new parsing function: - -.. code-block:: ocaml - - let rec parse_primary = parser - ... - (* ifexpr ::= 'if' expr 'then' expr 'else' expr *) - | [< 'Token.If; c=parse_expr; - 'Token.Then ?? "expected 'then'"; t=parse_expr; - 'Token.Else ?? "expected 'else'"; e=parse_expr >] -> - Ast.If (c, t, e) - -Next we hook it up as a primary expression: +Next we add a new case for parsing a if-expression as a primary expression: .. code-block:: ocaml -- cgit v1.2.3