Lists cannot have origins
Lists that are created in Stratego cannot have origins. (Lists that are created by the parser do have origins.)
Workaround: create custom lookups for lists (assuming one does not create empty lists).
origin-offset: list -> (start-offset, end-offset) where <is-list> list; (start-offset, _) := <Hd; origin-offset> list; (_, end-offset) := <last; origin-offset> list
Also used in https://github.com/metaborg/runtime-libraries/blob/master/org.spoofax.meta.runtime.libraries/task/messages.str#L168
Submitted by Daco Harkes on 26 November 2014 at 15:22
Log in to post comments