diff options
Diffstat (limited to 'goatNote.py')
-rw-r--r-- | goatNote.py | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/goatNote.py b/goatNote.py index 060660b..fb419b9 100644 --- a/goatNote.py +++ b/goatNote.py @@ -1,5 +1,37 @@ -#drop user into a shell -print("enter one of the following commands: list, toggle, change date, view") +from enum import Enum +import re + + +# Assigning numbers to types of data +class tokenTypes (Enum): + HEADING = 1 + DATE = 2 + TODO = 3 + BULLETPOINT = 4 + +# Tokenizing +# TODO ADD SPACES TO HEADING TODO +# TODO keep the stuff in order when it lists TODO +def tokenize(file: str): + headingRe = r"\s*\*\s*([A-z0-9]+)\s*\*\s*\[(\d\d\d\d[.]\d\d[.]\d\d)\]\s*{(TO[.]DO|DONE)}\s*" + bulletPointRe = r"-\s*([A-z0-9]+)\s*" + + heading = re.findall(headingRe, file) + print(heading) + bulletPoint = re.findall(bulletPointRe, file) + print(bulletPoint) + +tokenize(""" + *heading* [1004.23.23] {TO.DO} + - hi + - hey + *heading* [1004.23.23] {TO.DO} + - hi + - hey +""") + +# Drop user into a shell +print("enter one of the following commands: list, toggle, change date, view, formatting help, or type close to exit program") line = input(": ") @@ -12,9 +44,12 @@ while line != "close": print("CHANGE DATEEE") elif line == "view": print("look at me (view)") + elif line == "formatting help": + print("you need help? loser.") else: print("Invalid command :(") line = input(": ") print("byee(closing file)") + |