Hit this assert:

public static void putSource(ISimpleTerm term, IResource resource, IParseController controller) {
ISimpleTerm root = ParentAttachment.getRoot(term);
assert term == root;
root.putAttachment(new SourceAttachment(resource, controller));
}

when using a custom disambiguator.

I think that is relevant, because:

term == File(None,Chunk(…))
root == amb([ Chunk(…),
File(None,Chunk(…)) ])

which exactly matches the custom disambiguation step I perform.

Stack:

SourceAttachment.putSource(ISimpleTerm, IResource, IParseController) line: 77
CustomDisambiguator.transferAttachments(IStrategoTerm, IStrategoTerm) line: 86
CustomDisambiguator.disambiguate(IStrategoTerm) line: 72
SGLRParseController.parse(String, IProgressMonitor) line: 291
SGLRParseController.parse(String, IProgressMonitor) line: 1
DynamicParseController.parse(String, IProgressMonitor) line: 169
ParserScheduler.run(IProgressMonitor) line: 86
Worker.run() line: 54

Spoofax r23335

Submitted by Tobi Vollebregt on 14 September 2011 at 22:32

On 14 September 2011 at 22:52 Lennart Kats commented:

SourceAttachments should only appear at the very top of an AST. That assertion checks if you’re not accidentally trying to assign one to a node that is not at the top. I guess the CustomDisambiguator should remove the parent of the result so it’s the new root.


On 14 September 2011 at 23:00 Tobi Vollebregt commented:

Yeah, I just figured that out. With a bit of luck I have this one fixed tonight.


On 14 September 2011 at 23:07 Tobi Vollebregt tagged @tvo

On 14 September 2011 at 23:07 Tobi Vollebregt closed this issue.

On 14 September 2011 at 23:07 Tobi Vollebregt tagged disambiguator

On 15 September 2011 at 09:47 Lennart Kats tagged 1.0

Log in to post comments