equal
deleted
inserted
replaced
91 |
91 |
92 |
92 |
93 |
93 |
94 /** keyword tables **/ |
94 /** keyword tables **/ |
95 |
95 |
96 type Spec = ((String, List[String]), List[String]) |
96 object Spec |
97 |
97 { |
98 val no_spec: Spec = (("", Nil), Nil) |
98 val none: Spec = Spec("") |
99 val before_command_spec: Spec = ((BEFORE_COMMAND, Nil), Nil) |
99 } |
100 val quasi_command_spec: Spec = ((QUASI_COMMAND, Nil), Nil) |
100 sealed case class Spec(kind: String, exts: List[String] = Nil, tags: List[String] = Nil) |
|
101 { |
|
102 def is_none: Boolean = kind == "" |
|
103 } |
101 |
104 |
102 object Keywords |
105 object Keywords |
103 { |
106 { |
104 def empty: Keywords = new Keywords() |
107 def empty: Keywords = new Keywords() |
105 } |
108 } |
163 new Keywords(minor1, major1, kinds1, load_commands1) |
166 new Keywords(minor1, major1, kinds1, load_commands1) |
164 } |
167 } |
165 |
168 |
166 def add_keywords(header: Thy_Header.Keywords): Keywords = |
169 def add_keywords(header: Thy_Header.Keywords): Keywords = |
167 (this /: header) { |
170 (this /: header) { |
168 case (keywords, (name, ((kind, exts), _))) => |
171 case (keywords, (name, spec)) => |
169 if (kind == "") keywords + Symbol.decode(name) + Symbol.encode(name) |
172 if (spec.is_none) |
170 else keywords + (Symbol.decode(name), kind, exts) + (Symbol.encode(name), kind, exts) |
173 keywords + Symbol.decode(name) + Symbol.encode(name) |
|
174 else |
|
175 keywords + |
|
176 (Symbol.decode(name), spec.kind, spec.exts) + |
|
177 (Symbol.encode(name), spec.kind, spec.exts) |
171 } |
178 } |
172 |
179 |
173 |
180 |
174 /* command kind */ |
181 /* command kind */ |
175 |
182 |