- rememeber original settings
Closed this issue · 2 comments
github-actions commented
This issue was automatically created by a github action that converts project Todos to issues.
sharpshooter/sharpshooter/__init__.py
Line 366 in 9dad050
# ignore spaces before comments
# t_ignore_SPACESCOMMENTFIX = r'[ ]+' + r'\#.*' # note - not working ?
def t_label(self, t):
r"\#\["
self.empty_line = False
content = t.lexer.lexdata[t.lexer.lexpos:]
if content.find("\n") != -1:
content = content[:content.find("\n")]
original_length = len(content)
content = '\n'.join(content.split('\\n'))
if content[0] == " ":
content = content[1:]
# split at the first space
content = content.split(" ", 1)[0]
# if last is a ']' then remove it
if content[-1] == "]":
content = content[:-1]
self.current_label = content
t.lexer.skip(original_length)
def t_newline(self, t):
r"\n+"
# print("THE CURRENT LABEL IS:", self.current_label, t.lexer.lineno)
if tree.LABEL is not None:
# print('get me:', self.current_label, tree.LABEL, (self.current_label != tree.LABEL))
if self.current_label != tree.LABEL:
tree.TEST_MODE = True
tree.QUIET_MODE = True
else:
tree.TEST_MODE = False #tree._TEST_MODE_BAK
tree.QUIET_MODE = False # tree._QUIET_MODE_BAK
# TODO - rememeber original settings
t.lexer.lineno += t.value.count("\n")
self.was_dir = self.is_dir
self.is_dir = False
byteface commented
i think this is literally uncommenting those stashed vars. however not been through testing due to not yet passing it as a CLI param. I had tested some lables by setting the new const in the class however. that should probably be a list... so this was stalled unto those things are wired out. a single label will be fine for now accepted via cli into all commands same way quiet was done.
github-actions commented
Closed in b7afabf