-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bfb3f35
commit ba828af
Showing
14 changed files
with
134 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,5 @@ build | |
*.whl | ||
|
||
.idea/ | ||
.mypy_cache/ | ||
.pytype/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
language: python | ||
python: | ||
- 3.4 | ||
- 3.5 | ||
- 3.6 | ||
- 3.7 | ||
script: | ||
- python run_tests.py | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
from .ast import AST | ||
from .lexer import Lexer | ||
from .parser import Parser | ||
from .interpreter import Interpreter | ||
|
||
|
||
def ParserFactory(text): | ||
def ParserFactory(text: str) -> Parser: | ||
lexer = Lexer(text) | ||
return Parser(lexer) | ||
|
||
|
||
def InterpreterFactory(text, symbol_table): | ||
def InterpreterFactory(text: str, symbol_table: dict) -> Interpreter: | ||
parser = ParserFactory(text) | ||
tree = parser.parse() | ||
return Interpreter(tree, symbol_table) | ||
|
||
|
||
def interpret(text, symbol_table): | ||
def interpret(text: str, symbol_table: dict) -> bool: | ||
return InterpreterFactory(text, symbol_table).interpret() | ||
|
||
|
||
def parse(text): | ||
def parse(text: str) -> AST: | ||
return ParserFactory(text).parse() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.