Merge pull request #33 from jszakmeister/fix-bugs-in-tutorial
Fix bugs in tutorial
This commit is contained in:
commit
d12b145bee
5 changed files with 10 additions and 10 deletions
|
|
@ -115,13 +115,13 @@ following simple example computes `Fibonacci
|
||||||
numbers <http://en.wikipedia.org/wiki/Fibonacci_number>`_:
|
numbers <http://en.wikipedia.org/wiki/Fibonacci_number>`_:
|
||||||
|
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: text
|
||||||
|
|
||||||
# Compute the x'th fibonacci number.
|
# Compute the x'th fibonacci number.
|
||||||
def fib(x):
|
def fib(x)
|
||||||
if x < 3:
|
if x < 3
|
||||||
return 1
|
return 1
|
||||||
else:
|
else
|
||||||
return fib(x-1)+fib(x-2)
|
return fib(x-1)+fib(x-2)
|
||||||
|
|
||||||
# This expression will compute the 40th number.
|
# This expression will compute the 40th number.
|
||||||
|
|
@ -226,7 +226,7 @@ the line.
|
||||||
|
|
||||||
# Regular expressions that tokens and comments of our language.
|
# Regular expressions that tokens and comments of our language.
|
||||||
REGEX_NUMBER = re.compile('[0-9]+(?:.[0-9]+)?')
|
REGEX_NUMBER = re.compile('[0-9]+(?:.[0-9]+)?')
|
||||||
REGEX_IDENTIFIER = re.compile('[a-zA-Z][a-zA-Z0-9]\ *')
|
REGEX_IDENTIFIER = re.compile('[a-zA-Z][a-zA-Z0-9]*')
|
||||||
REGEX_COMMENT = re.compile('#.*')
|
REGEX_COMMENT = re.compile('#.*')
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue