From 391a121d6dcc2c12781da2e0baaeee9dd7ec9d91 Mon Sep 17 00:00:00 2001 From: Maggie Mari Date: Sun, 19 Aug 2012 12:18:26 -0500 Subject: [PATCH] Removed extraneous slashes. --- .../doc/kaleidoscope/PythonLangImpl5.rst | 2 +- .../doc/kaleidoscope/PythonLangImpl6.rst | 20 +++++++++---------- .../doc/kaleidoscope/PythonLangImpl7.rst | 14 ++++++------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/docs/source/doc/kaleidoscope/PythonLangImpl5.rst b/docs/source/doc/kaleidoscope/PythonLangImpl5.rst index 386c87d..c0abb18 100644 --- a/docs/source/doc/kaleidoscope/PythonLangImpl5.rst +++ b/docs/source/doc/kaleidoscope/PythonLangImpl5.rst @@ -1375,7 +1375,7 @@ Parser return ForExpressionNode(loop_variable, start, end, step, body) - # primary ::= identifierexpr \| numberexpr \| parenexpr \| ifexpr \| + # primary ::= identifierexpr | numberexpr | parenexpr | ifexpr | forexpr def ParsePrimary(self): if isinstance(self.current, IdentifierToken): return self.ParseIdentifierExpr() elif isinstance(self.current, NumberToken): return self.ParseNumberExpr() diff --git a/docs/source/doc/kaleidoscope/PythonLangImpl6.rst b/docs/source/doc/kaleidoscope/PythonLangImpl6.rst index 382f0ef..0dd0f20 100644 --- a/docs/source/doc/kaleidoscope/PythonLangImpl6.rst +++ b/docs/source/doc/kaleidoscope/PythonLangImpl6.rst @@ -60,10 +60,10 @@ binary operators. An example of this is: def binary> 10 (LHS RHS) RHS < LHS # Binary "logical or", (note that it does not "short circuit"). - def binary\| 5 (LHS RHS) if LHS then 1 else if RHS then 1 else 0 + def binary| 5 (LHS RHS) if LHS then 1 else if RHS then 1 else 0 # Define = with slightly lower precedence than relationals. - def binary= 9 (LHS RHS) !(LHS < RHS \| LHS > RHS) + def binary= 9 (LHS RHS) !(LHS < RHS | LHS > RHS) @@ -101,7 +101,7 @@ keywords: any new AST or parser support. On the other hand, we have to be able to represent the definitions of - these new operators, in the "def binary\| 5" part of the function + these new operators, in the "def binary| 5" part of the function definition. In our grammar so far, the "name" for the function definition is parsed as the "prototype" production and into the ``PrototypeNode``. To represent our new user-defined operators as @@ -294,7 +294,7 @@ simple: we'll add a new function to do it: .. code-block:: python - # unary ::= primary \| unary_operator unary def + # unary ::= primary | unary_operator unary def ParseUnary(self): # If the current token is not an operator, it must be a primary expression. if (not isinstance(self.current, CharacterToken) or self.current in [CharacterToken('('), CharacterToken(',')]): return @@ -419,13 +419,13 @@ We can also define a bunch of other "primitive" operations, such as: def binary> 10 (LHS RHS) RHS < LHS # Binary logical or, which does not short circuit. - def binary\| 5 (LHS RHS) if LHS then 1 else if RHS then 1 else 0 + def binary| 5 (LHS RHS) if LHS then 1 else if RHS then 1 else 0 # Binary logical and, which does not short circuit. def binary& 6 (LHS RHS) if !LHS then 0 else !!RHS # Define = with slightly lower precedence than relationals. - def binary = 9 (LHS RHS) !(LHS < RHS \| LHS > RHS) + def binary = 9 (LHS RHS) !(LHS < RHS | LHS > RHS) @@ -454,7 +454,7 @@ denser the character: # determine whether the specific location diverges. # Solve for z = z^2 + c in the complex plane. def - mandelconverger(real imag iters creal cimag) if iters > 255 \| + mandelconverger(real imag iters creal cimag) if iters > 255 | (real\ *real + imag*\ imag > 4) then iters else mandelconverger(real\ *real - imag*\ imag + creal, 2\ *real*\ imag + cimag, iters+1, creal, cimag) @@ -1095,7 +1095,7 @@ the if/then/else and for expressions: isinstance(self.current, CharacterToken): return g_binop_precedence.get(self.current.char, -1) else: return -1 - # identifierexpr ::= identifier \| identifier '(' expression\* ')' def + # identifierexpr ::= identifier | identifier '(' expression\* ')' def ParseIdentifierExpr(self): identifier_name = self.current.name self.Next() # eat identifier. @@ -1196,7 +1196,7 @@ the if/then/else and for expressions: return ForExpressionNode(loop_variable, start, end, step, body) - # primary ::= identifierexpr \| numberexpr \| parenexpr \| ifexpr \| + # primary ::= identifierexpr | numberexpr | parenexpr | ifexpr | forexpr def ParsePrimary(self): if isinstance(self.current, IdentifierToken): return self.ParseIdentifierExpr() elif isinstance(self.current, NumberToken): return self.ParseNumberExpr() @@ -1205,7 +1205,7 @@ the if/then/else and for expressions: self.current == CharacterToken('('): return self.ParseParenExpr() else: raise RuntimeError('Unknown token when expecting an expression.') - # unary ::= primary \| unary_operator unary def ParseUnary(self): # If + # unary ::= primary | unary_operator unary def ParseUnary(self): # If the current token is not an operator, it must be a primary expression. if (not isinstance(self.current, CharacterToken) or self.current in [CharacterToken('('), CharacterToken(',')]): return self.ParsePrimary() diff --git a/docs/source/doc/kaleidoscope/PythonLangImpl7.rst b/docs/source/doc/kaleidoscope/PythonLangImpl7.rst index be681d6..c8d6495 100644 --- a/docs/source/doc/kaleidoscope/PythonLangImpl7.rst +++ b/docs/source/doc/kaleidoscope/PythonLangImpl7.rst @@ -181,7 +181,7 @@ using a PHI node: into SSA registers, inserting Phi nodes as appropriate. If you run this example through the pass, for example, you'll get: - $ llvm-as < example.ll \| opt -mem2reg \| llvm-dis + $ llvm-as < example.ll | opt -mem2reg | llvm-dis @@ -628,8 +628,8 @@ do is add it as a primary expression: .. code-block:: python - # primary ::= # dentifierexpr \| numberexpr \| - parenexpr \| ifexpr \| forexpr \| varexpr def ParsePrimary(self): if + # primary ::= # dentifierexpr | numberexpr | + parenexpr | ifexpr | forexpr | varexpr def ParsePrimary(self): if isinstance(self.current, IdentifierToken): return self.ParseIdentifierExpr() elif isinstance(self.current, NumberToken): return self.ParseNumberExpr() elif isinstance(self.current, IfToken): @@ -1304,7 +1304,7 @@ mutable variables and var/in support: isinstance(self.current, CharacterToken): return g_binop_precedence.get(self.current.char, -1) else: return -1 - # identifierexpr ::= identifier \| identifier '(' expression\* ')' def + # identifierexpr ::= identifier | identifier '(' expression\* ')' def ParseIdentifierExpr(self): identifier_name = self.current.name self.Next() # eat identifier. @@ -1444,8 +1444,8 @@ mutable variables and var/in support: return VarExpressionNode(variables, body) - # primary ::= # dentifierexpr \| numberexpr \| parenexpr \| ifexpr \| - forexpr \| varexpr def ParsePrimary(self): if isinstance(self.current, + # primary ::= # dentifierexpr | numberexpr | parenexpr | ifexpr | + forexpr | varexpr def ParsePrimary(self): if isinstance(self.current, IdentifierToken): return self.ParseIdentifierExpr() elif isinstance(self.current, NumberToken): return self.ParseNumberExpr() elif isinstance(self.current, IfToken): return self.ParseIfExpr() elif @@ -1454,7 +1454,7 @@ mutable variables and var/in support: self.current == CharacterToken('('): return self.ParseParenExpr() else: raise RuntimeError('Unknown token when expecting an expression.') - # unary ::= primary \| unary_operator unary def ParseUnary(self): # If + # unary ::= primary | unary_operator unary def ParseUnary(self): # If the current token is not an operator, it must be a primary expression. if (not isinstance(self.current, CharacterToken) or self.current in [CharacterToken('('), CharacterToken(',')]): return self.ParsePrimary()