prevent target duplication
This commit is contained in:
parent
52c67c831b
commit
c352384822
|
@ -237,6 +237,7 @@ class OscCommentMacroListener(CommentMacroListener):
|
|||
ctx.targets = []
|
||||
|
||||
def exitMaster(self, ctx: CommentMacroParser.MasterContext):
|
||||
ctx.targets = set(ctx.targets) # no duplicates
|
||||
if isinstance(ctx.parentCtx, CommentMacroParser.MacroContext):
|
||||
ctx.parentCtx.master = ctx
|
||||
|
||||
|
@ -264,4 +265,5 @@ class OscCommentMacroListener(CommentMacroListener):
|
|||
ctx.targets = []
|
||||
|
||||
def exitTarget(self, ctx: CommentMacroParser.TargetContext):
|
||||
ctx.target = set(ctx.targets) # no duplicates
|
||||
ctx.parentCtx.targets.extend(ctx.targets)
|
||||
|
|
Loading…
Reference in New Issue