svoid dm_importTextIntoRulesModule(S text) { for (S ruleText : ai_splitEntriesWithMultipleDoubleArrows(splitAtEmptyLines(text))) { new LS comments; ruleText = gazelle_processSquareBracketAnnotations(ruleText, comments); new Matches m; S id = null; for (S s : comments) if "id: *" { id = $1; comments.remove(s); break; } if (id == null) { print("Importing ID-less rule (better provide an ID!): " + ruleText); call(dm_call(gazelle_rulesModule(), 'uniqConcept, id), '_uniqConcept, text := ruleText, comments := lines_rtrim(comments)); } else { print("Importing rule: " + id); call(dm_call(gazelle_rulesModule(), 'uniqConcept, globalID := id), '_setFields, text := ruleText, comments := lines_rtrim(comments)); } } }