equal
deleted
inserted
replaced
54 override def toString: String = keywords.toString |
54 override def toString: String = keywords.toString |
55 |
55 |
56 |
56 |
57 /* keywords */ |
57 /* keywords */ |
58 |
58 |
59 def + (name: String, kind: String = "", exts: List[String] = Nil): Outer_Syntax = |
59 def + (name: String, kind: String = "", load_command: String = ""): Outer_Syntax = |
60 new Outer_Syntax( |
60 new Outer_Syntax( |
61 keywords + (name, kind, exts), rev_abbrevs, language_context, has_tokens = true) |
61 keywords + (name, kind, load_command), rev_abbrevs, language_context, has_tokens = true) |
62 |
62 |
63 def add_keywords(keywords: Thy_Header.Keywords): Outer_Syntax = |
63 def add_keywords(keywords: Thy_Header.Keywords): Outer_Syntax = |
64 (this /: keywords) { |
64 (this /: keywords) { |
65 case (syntax, (name, spec)) => |
65 case (syntax, (name, spec)) => |
66 syntax + |
66 syntax + |
67 (Symbol.decode(name), spec.kind, spec.exts) + |
67 (Symbol.decode(name), spec.kind, spec.load_command) + |
68 (Symbol.encode(name), spec.kind, spec.exts) |
68 (Symbol.encode(name), spec.kind, spec.load_command) |
69 } |
69 } |
70 |
70 |
71 |
71 |
72 /* abbrevs */ |
72 /* abbrevs */ |
73 |
73 |
131 } |
131 } |
132 |
132 |
133 |
133 |
134 /* load commands */ |
134 /* load commands */ |
135 |
135 |
136 def load_command(name: String): Option[List[String]] = |
136 def load_command(name: String): Option[String] = |
137 keywords.load_commands.get(name) |
137 keywords.load_commands.get(name) |
138 |
138 |
139 def has_load_commands(text: String): Boolean = |
139 def has_load_commands(text: String): Boolean = |
140 keywords.load_commands.exists({ case (cmd, _) => text.containsSlice(cmd) }) |
140 keywords.load_commands.exists({ case (cmd, _) => text.containsSlice(cmd) }) |
141 |
141 |