use tclint as parser / formatter
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
from tclint.syntax_tree import BracedWord
|
||||
|
||||
|
||||
def lib_spf_prepend(args, parser):
|
||||
if len(args) >= 5:
|
||||
# Heuristik: myTag wurde zu früh getrennt, hänge ihn an den BracedBlock
|
||||
merged_contents = args[3].contents + "\n" + args[4].contents
|
||||
merged = BracedWord(merged_contents, pos=args[3].pos, end_pos=args[4].end_pos)
|
||||
script = parser.parse_script(merged)
|
||||
return args[:3] + [script] # [routine, arg1, arg2, script]
|
||||
elif len(args) >= 4:
|
||||
args[2] = parser.parse_script(args[2])
|
||||
return args
|
||||
|
||||
|
||||
commands = {"LIB_SPF_prepend": lib_spf_prepend}
|
||||
Reference in New Issue
Block a user