if content[-1] == "]":
content = content[:-1]
# sslog('cl:', self.current_label)
if content not in self.labels:
# sslog('Adding a label:', self.current_label, lvl='g')
self.labels.append(self.current_label)
self.current_label = content
else:
pass
# sslog('Creating a branch:', content, lvl='g')
# TODO - this is a potential can of worms. (mainly due to catching incorrect use cases)
# if branch exists already, then make it
# TODO - may need to save cwd and restore?
# cwd = os.getcwd()
# TODO - these cant be constants for this to work. (will need to pass vars)
# note - the lexer itself allows for custom props
# tree(self.lexer.lexdata, test=tree.TEST_MODE, quiet=tree.QUIET_MODE, label=tree.LABEL)
# os.chdir(cwd)
t.lexer.skip(original_length)
def t_newline(self, t):
r"\n+"
if tree.LABEL is not None:
if self.current_label != tree.LABEL:
tree.TEST_MODE = True
tree.QUIET_MODE = True
else:
tree.TEST_MODE = tree._TEST_MODE_BAK
tree.QUIET_MODE = tree._QUIET_MODE_BAK
t.lexer.lineno += t.value.count("\n")
self.was_dir = self.is_dir
This issue was automatically created by a github action that converts project Todos to issues.
https://github.com/byteface/sharpshooter/blob/b7afabf36077e1d982f523b71e742597441dedff/sharpshooter/__init__.py#L360