1 //: Allow code for recipes to be pulled in from multiple places and inserted 2 //: at special labels called 'waypoints' using two new top-level commands: 3 //: before 4 //: after 5 6 //: Most labels are local: they must be unique to a recipe, and are invisible 7 //: outside the recipe. However, waypoints are global: a recipe can have 8 //: multiple of them, you can't use them as jump targets. 9 :(before "End is_jump_target Special-cases") 10 if (is_waypoint(label)) return false; 11 //: Waypoints are always surrounded by '<>', e.g. <handle-request>. 12from strutils import endsWith, split from os import isAbsolute proc checkMsg*(msg, expectedEnd, name: string, absolute = true)= let filePrefix = msg.split(' ', maxSplit = 1)[0] if absolute and not filePrefix.isAbsolute: echo name, ":not absolute: `", msg & "`" elif not msg.endsWith expectedEnd: echo name, ":expected suffix:\n`" & expectedEnd & "`\ngot:\n`" & msg & "`" else: echo name, ":ok"