Repository: pniedzwiedzinski/pseudo

Issue:
[BUG] read_string
**Describe the bug**
Thanks! Just a few more steps to finish reporting.

**Your pseudocode file**
```

pisz "nie"

```

**Log file**
```

  File "/Users/pniedzwiedzinski/.local/share/virtualenvs/pseudo--geLLKRp/lib/python3.7/site-packages/pseudo/lexer.py", line 244, in read_next
    return read_string()
TypeError: read_string() missing 1 required positional argument: 'lexer'

```

**Desktop (please complete the following information):**
 - OS: macOs
 - pseudo version (check with `pdc -v`) 0.10.0

**Additional context**
How do you feel today?
Great!


Comments:

Patch:
diff --git a/Pipfile.lock b/Pipfile.lock
index 35051ac..9e007b4 100644
--- a/Pipfile.lock
+++ b/Pipfile.lock
@@ -138,11 +138,11 @@
         },
         "pytest-cov": {
             "hashes": [
-                "sha256:0ab664b25c6aa9716cbf203b17ddb301932383046082c081b9848a0edf5add33",
-                "sha256:230ef817450ab0699c6cc3c9c8f7a829c34674456f2ed8df1fe1d39780f7c87f"
+                "sha256:2b097cde81a302e1047331b48cadacf23577e431b61e9c6f49a1170bbe3d3da6",
+                "sha256:e00ea4fdde970725482f1f35630d12f074e121a23801aabf2ae154ec6bdd343a"
             ],
             "index": "pypi",
-            "version": "==2.6.1"
+            "version": "==2.7.1"
         },
         "pytest-timeout": {
             "hashes": [
@@ -397,10 +397,10 @@
         },
         "urllib3": {
             "hashes": [
-                "sha256:4c291ca23bbb55c76518905869ef34bdd5f0e46af7afe6861e8375643ffee1a0",
-                "sha256:9a247273df709c4fedb38c711e44292304f73f39ab01beda9f6b9fc375669ac3"
+                "sha256:2393a695cd12afedd0dcb26fe5d50d0cf248e5a66f75dbd89a3d4eb333a61af4",
+                "sha256:a637e5fae88995b256e3409dc4d52c2e2e0ba32c42a6365fee8bbd2238de3cfb"
             ],
-            "version": "==1.24.2"
+            "version": "==1.24.3"
         }
     }
 }
diff --git a/docs/source/index.rst b/docs/source/index.rst
index 872b3bc..08b44ca 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -4,6 +4,7 @@ Home
 
 .. toctree::
     getting_started
+    stream
     runtime
     type/index
 
diff --git a/docs/source/stream.rst b/docs/source/stream.rst
new file mode 100644
index 0000000..5037b4f
--- /dev/null
+++ b/docs/source/stream.rst
@@ -0,0 +1,7 @@
+Runtime
+=======
+
+.. toctree::
+
+.. automodule:: pseudo.stream
+    :members:
\ No newline at end of file
diff --git a/pseudo/__init__.py b/pseudo/__init__.py
index 983644f..4ce8d6a 100644
--- a/pseudo/__init__.py
+++ b/pseudo/__init__.py
@@ -23,7 +23,7 @@ Example:
 
 
 __author__ = "Patryk Niedźwiedziński"
-__version__ = "0.10.0"
+__version__ = "0.10.1"
 
 
 import gc
diff --git a/pseudo/lexer.py b/pseudo/lexer.py
index 17e365e..d02c317 100644
--- a/pseudo/lexer.py
+++ b/pseudo/lexer.py
@@ -139,6 +139,8 @@ class Lexer:
             return read_while(self, indent_level)
         if keyword == "dla":
             return read_for(self, indent_level)
+        if keyword == "koniec":
+            return Statement(keyword)
         arg = self.read_args()
         arg = self.read_expression(arg)
         if keyword == "czytaj":
@@ -241,7 +243,7 @@ class Lexer:
             return Value(c)
 
         if c == '"' or c == "'":
-            return read_string()
+            return read_string(self)
 
         if is_operator(c):
             return read_operator(self.i)
diff --git a/pseudo/type/__init__.py b/pseudo/type/__init__.py
index 8200ac3..27a8ebe 100644
--- a/pseudo/type/__init__.py
+++ b/pseudo/type/__init__.py
@@ -8,7 +8,6 @@ __author__ = "Patryk Niedźwiedziński"
 from pseudo.type.numbers import Int
 from pseudo.type.string import String
 from pseudo.type.bool import Bool
-from pseudo.type.variable import Variable, Assignment
 from pseudo.type.base import Value, EOL
 
 


Test patch:
diff --git a/tests/lexer_test.py b/tests/lexer_test.py
index 8b47ee1..e33e72b 100644
--- a/tests/lexer_test.py
+++ b/tests/lexer_test.py
@@ -5,7 +5,8 @@ import pseudo
 
 from pseudo.type.operation import Operation, Operator
 from pseudo.type.loop import Loop
-from pseudo.type import Int, Statement, Bool, Variable, Assignment
+from pseudo.type import Int, Statement, Bool
+from pseudo.type.variable import Variable, Assignment
 from pseudo.stream import Stream, EOL, EndOfFile
 
 __author__ = "Patryk Niedźwiedziński"
@@ -220,3 +221,4 @@ def test_read_indent_size(lexer):
 
     if lexer.indent_size != 1 or lexer.indent_char != "\t":
         raise AssertionError
+
diff --git a/tests/pseudo_test.py b/tests/pseudo_test.py
index 66c7ceb..249c5a7 100644
--- a/tests/pseudo_test.py
+++ b/tests/pseudo_test.py
@@ -23,12 +23,14 @@ jeżeli a=1 to
 dopóki a < 2 wykonuj
     T[a] := a
     a:=a+1
-pisz a
+pisz "2"
 
 dla i:=3,...,5 wykonuj
     dla x:=3,...,5 wykonuj
         T[x] <- x
         pisz x
+
+koniec
 """
 
 
diff --git a/tests/type_test/statement_test.py b/tests/type_test/statement_test.py
new file mode 100644
index 0000000..01ebb22
--- /dev/null
+++ b/tests/type_test/statement_test.py
@@ -0,0 +1,16 @@
+"""This module contains tests for pseudo.type.Statement"""
+
+import pytest
+
+from pseudo.runtime import RunTime
+from pseudo.type import Statement
+
+
+@pytest.mark.timeout(2)
+def test_exit():
+    try:
+        Statement("koniec").eval(RunTime())
+    except SystemExit:
+        pass
+    else:
+        raise AssertionError