-
Notifications
You must be signed in to change notification settings - Fork 0
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
a2469b1
commit 3c71e8b
Showing
4 changed files
with
15 additions
and
8 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 |
---|---|---|
@@ -1,4 +1 @@ | ||
from Storm.error import * | ||
from Storm.lexer import * | ||
from Storm.type import * | ||
from Storm.token import * | ||
from Storm.lexer import Lexer |
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,4 +1,3 @@ | ||
from typing import Text | ||
from Storm import token | ||
|
||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class Bcolors: | ||
HEADER = '\033[95m' | ||
OKBLUE = '\033[94m' | ||
OKCYAN = '\033[96m' | ||
OKGREEN = '\033[92m' | ||
WARNING = '\033[93m' | ||
FAIL = '\033[91m' | ||
ENDC = '\033[0m' | ||
BOLD = '\033[1m' | ||
UNDERLINE = '\033[4m' |
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,15 +1,16 @@ | ||
from Storm import Lexer | ||
from bgcolors import Bcolors | ||
|
||
def run(text): | ||
lexer = Lexer(text) | ||
tokens, error = lexer.make_tokens() | ||
print(tokens) | ||
if error: | ||
print("ERROR") | ||
print(error) | ||
print(f"{Bcolors.FAIL}ERROR{Bcolors.ENDC}") | ||
print(f"{Bcolors.FAIL}{error}{Bcolors.ENDC}") | ||
|
||
|
||
while True: | ||
text = input("storm > ") | ||
text = input(f"{Bcolors.OKBLUE}strom > {Bcolors.ENDC} ") | ||
run(text) | ||
|