Skip to content

Commit

Permalink
Remove redundant code block and update comment.
Browse files Browse the repository at this point in the history
By patch zoren here: llvm-mirror#20



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296968 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
sylvestre committed Mar 4, 2017
1 parent d64d538 commit 99aada9
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions docs/tutorial/OCamlLangImpl5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 99aada9

Please sign in to comment.