author | wenzelm |
Sat, 18 Jun 2011 17:33:27 +0200 | |
changeset 43443 | 5d9693c2337e |
parent 43418 | c69e9fbb81a8 |
child 43447 | 0ef3ec385b2b |
permissions | -rw-r--r-- |
27901 | 1 |
/* Title: Pure/General/symbol.scala |
2 |
Author: Makarius |
|
3 |
||
27924 | 4 |
Detecting and recoding Isabelle symbols. |
27901 | 5 |
*/ |
6 |
||
7 |
package isabelle |
|
8 |
||
27918 | 9 |
import scala.io.Source |
36011
3ff725ac13a4
adapted to Scala 2.8.0 Beta1 -- with notable changes to scala.collection;
wenzelm
parents:
34316
diff
changeset
|
10 |
import scala.collection.mutable |
31522 | 11 |
import scala.util.matching.Regex |
27901 | 12 |
|
13 |
||
31522 | 14 |
object Symbol |
15 |
{ |
|
36763 | 16 |
/* spaces */ |
17 |
||
36816 | 18 |
val spc = ' ' |
19 |
val space = " " |
|
20 |
||
21 |
private val static_spaces = space * 4000 |
|
36763 | 22 |
|
23 |
def spaces(k: Int): String = |
|
24 |
{ |
|
25 |
require(k >= 0) |
|
26 |
if (k < static_spaces.length) static_spaces.substring(0, k) |
|
36816 | 27 |
else space * k |
36763 | 28 |
} |
29 |
||
30 |
||
43418 | 31 |
/* ASCII characters */ |
32 |
||
33 |
def is_ascii_letter(c: Char): Boolean = 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z' |
|
34 |
def is_ascii_digit(c: Char): Boolean = '0' <= c && c <= '9' |
|
35 |
def is_ascii_quasi(c: Char): Boolean = c == '_' || c == '\'' |
|
36 |
||
37 |
def is_ascii_letdig(c: Char): Boolean = |
|
38 |
is_ascii_letter(c) || is_ascii_digit(c) || is_ascii_quasi(c) |
|
39 |
||
40 |
def is_ascii_identifier(s: String): Boolean = |
|
41 |
s.length > 0 && is_ascii_letter(s(0)) && s.substring(1).forall(is_ascii_letdig) |
|
42 |
||
43 |
||
33998 | 44 |
/* Symbol regexps */ |
27901 | 45 |
|
31522 | 46 |
private val plain = new Regex("""(?xs) |
40524
6131d7a78ad3
treat Unicode "replacement character" (i.e. decoding error) is malformed;
wenzelm
parents:
40523
diff
changeset
|
47 |
[^\r\\\ud800-\udfff\ufffd] | [\ud800-\udbff][\udc00-\udfff] """) |
37556
2bf29095d26f
treat alternative newline symbols as in Isabelle/ML;
wenzelm
parents:
36816
diff
changeset
|
48 |
|
40522 | 49 |
private val physical_newline = new Regex("""(?xs) \n | \r\n | \r """) |
27901 | 50 |
|
31522 | 51 |
private val symbol = new Regex("""(?xs) |
31545
5f1f0a20af4d
discontinued escaped symbols such as \\<forall> -- only one backslash should be used;
wenzelm
parents:
31523
diff
changeset
|
52 |
\\ < (?: |
27924 | 53 |
\^? [A-Za-z][A-Za-z0-9_']* | |
54 |
\^raw: [\x20-\x7e\u0100-\uffff && [^.>]]* ) >""") |
|
55 |
||
40523
1050315f6ee2
simplified/robustified treatment of malformed symbols, which are now fully internalized (total Symbol.explode etc.);
wenzelm
parents:
40522
diff
changeset
|
56 |
private val malformed_symbol = new Regex("(?xs) (?!" + symbol + ")" + |
40529 | 57 |
""" [\ud800-\udbff\ufffd] | \\<\^? """) |
27924 | 58 |
|
40523
1050315f6ee2
simplified/robustified treatment of malformed symbols, which are now fully internalized (total Symbol.explode etc.);
wenzelm
parents:
40522
diff
changeset
|
59 |
val regex_total = |
1050315f6ee2
simplified/robustified treatment of malformed symbols, which are now fully internalized (total Symbol.explode etc.);
wenzelm
parents:
40522
diff
changeset
|
60 |
new Regex(plain + "|" + physical_newline + "|" + symbol + "|" + malformed_symbol + "| .") |
27937
fdf77e7be01a
more robust pattern: look at longer matches first, added catch-all case;
wenzelm
parents:
27935
diff
changeset
|
61 |
|
34137 | 62 |
|
63 |
/* basic matching */ |
|
64 |
||
37556
2bf29095d26f
treat alternative newline symbols as in Isabelle/ML;
wenzelm
parents:
36816
diff
changeset
|
65 |
def is_plain(c: Char): Boolean = !(c == '\r' || c == '\\' || '\ud800' <= c && c <= '\udfff') |
34137 | 66 |
|
38877 | 67 |
def is_physical_newline(s: CharSequence): Boolean = |
68 |
"\n".contentEquals(s) || "\r".contentEquals(s) || "\r\n".contentEquals(s) |
|
69 |
||
40523
1050315f6ee2
simplified/robustified treatment of malformed symbols, which are now fully internalized (total Symbol.explode etc.);
wenzelm
parents:
40522
diff
changeset
|
70 |
def is_malformed(s: CharSequence): Boolean = |
1050315f6ee2
simplified/robustified treatment of malformed symbols, which are now fully internalized (total Symbol.explode etc.);
wenzelm
parents:
40522
diff
changeset
|
71 |
!(s.length == 1 && is_plain(s.charAt(0))) && malformed_symbol.pattern.matcher(s).matches |
34137 | 72 |
|
73 |
class Matcher(text: CharSequence) |
|
74 |
{ |
|
40523
1050315f6ee2
simplified/robustified treatment of malformed symbols, which are now fully internalized (total Symbol.explode etc.);
wenzelm
parents:
40522
diff
changeset
|
75 |
private val matcher = regex_total.pattern.matcher(text) |
34137 | 76 |
def apply(start: Int, end: Int): Int = |
77 |
{ |
|
78 |
require(0 <= start && start < end && end <= text.length) |
|
34316
f879b649ac4c
clarified Symbol.is_plain/is_wellformed -- is_closed was rejecting plain backslashes;
wenzelm
parents:
34193
diff
changeset
|
79 |
if (is_plain(text.charAt(start))) 1 |
34138 | 80 |
else { |
34137 | 81 |
matcher.region(start, end).lookingAt |
82 |
matcher.group.length |
|
83 |
} |
|
84 |
} |
|
31522 | 85 |
} |
27937
fdf77e7be01a
more robust pattern: look at longer matches first, added catch-all case;
wenzelm
parents:
27935
diff
changeset
|
86 |
|
fdf77e7be01a
more robust pattern: look at longer matches first, added catch-all case;
wenzelm
parents:
27935
diff
changeset
|
87 |
|
36011
3ff725ac13a4
adapted to Scala 2.8.0 Beta1 -- with notable changes to scala.collection;
wenzelm
parents:
34316
diff
changeset
|
88 |
/* iterator */ |
33998 | 89 |
|
36011
3ff725ac13a4
adapted to Scala 2.8.0 Beta1 -- with notable changes to scala.collection;
wenzelm
parents:
34316
diff
changeset
|
90 |
def iterator(text: CharSequence) = new Iterator[CharSequence] |
34134 | 91 |
{ |
34137 | 92 |
private val matcher = new Matcher(text) |
33998 | 93 |
private var i = 0 |
94 |
def hasNext = i < text.length |
|
40522 | 95 |
def next = |
96 |
{ |
|
34137 | 97 |
val n = matcher(i, text.length) |
98 |
val s = text.subSequence(i, i + n) |
|
99 |
i += n |
|
100 |
s |
|
33998 | 101 |
} |
102 |
} |
|
103 |
||
104 |
||
105 |
/* decoding offsets */ |
|
106 |
||
107 |
class Index(text: CharSequence) |
|
31929 | 108 |
{ |
109 |
case class Entry(chr: Int, sym: Int) |
|
110 |
val index: Array[Entry] = |
|
111 |
{ |
|
34137 | 112 |
val matcher = new Matcher(text) |
31929 | 113 |
val buf = new mutable.ArrayBuffer[Entry] |
114 |
var chr = 0 |
|
115 |
var sym = 0 |
|
33998 | 116 |
while (chr < text.length) { |
34137 | 117 |
val n = matcher(chr, text.length) |
118 |
chr += n |
|
31929 | 119 |
sym += 1 |
34137 | 120 |
if (n > 1) buf += Entry(chr, sym) |
31929 | 121 |
} |
122 |
buf.toArray |
|
123 |
} |
|
38479
e628da370072
more efficient Markup_Tree, based on branches sorted by quasi-order;
wenzelm
parents:
37556
diff
changeset
|
124 |
def decode(sym1: Int): Int = |
31929 | 125 |
{ |
38479
e628da370072
more efficient Markup_Tree, based on branches sorted by quasi-order;
wenzelm
parents:
37556
diff
changeset
|
126 |
val sym = sym1 - 1 |
31929 | 127 |
val end = index.length |
128 |
def bisect(a: Int, b: Int): Int = |
|
129 |
{ |
|
130 |
if (a < b) { |
|
131 |
val c = (a + b) / 2 |
|
132 |
if (sym < index(c).sym) bisect(a, c) |
|
133 |
else if (c + 1 == end || sym < index(c + 1).sym) c |
|
134 |
else bisect(c + 1, b) |
|
135 |
} |
|
136 |
else -1 |
|
137 |
} |
|
138 |
val i = bisect(0, end) |
|
139 |
if (i < 0) sym |
|
140 |
else index(i).chr + sym - index(i).sym |
|
141 |
} |
|
38479
e628da370072
more efficient Markup_Tree, based on branches sorted by quasi-order;
wenzelm
parents:
37556
diff
changeset
|
142 |
def decode(range: Text.Range): Text.Range = range.map(decode(_)) |
31929 | 143 |
} |
144 |
||
145 |
||
33998 | 146 |
/* recoding text */ |
27937
fdf77e7be01a
more robust pattern: look at longer matches first, added catch-all case;
wenzelm
parents:
27935
diff
changeset
|
147 |
|
31522 | 148 |
private class Recoder(list: List[(String, String)]) |
149 |
{ |
|
150 |
private val (min, max) = |
|
151 |
{ |
|
27937
fdf77e7be01a
more robust pattern: look at longer matches first, added catch-all case;
wenzelm
parents:
27935
diff
changeset
|
152 |
var min = '\uffff' |
fdf77e7be01a
more robust pattern: look at longer matches first, added catch-all case;
wenzelm
parents:
27935
diff
changeset
|
153 |
var max = '\u0000' |
fdf77e7be01a
more robust pattern: look at longer matches first, added catch-all case;
wenzelm
parents:
27935
diff
changeset
|
154 |
for ((x, _) <- list) { |
fdf77e7be01a
more robust pattern: look at longer matches first, added catch-all case;
wenzelm
parents:
27935
diff
changeset
|
155 |
val c = x(0) |
fdf77e7be01a
more robust pattern: look at longer matches first, added catch-all case;
wenzelm
parents:
27935
diff
changeset
|
156 |
if (c < min) min = c |
fdf77e7be01a
more robust pattern: look at longer matches first, added catch-all case;
wenzelm
parents:
27935
diff
changeset
|
157 |
if (c > max) max = c |
fdf77e7be01a
more robust pattern: look at longer matches first, added catch-all case;
wenzelm
parents:
27935
diff
changeset
|
158 |
} |
fdf77e7be01a
more robust pattern: look at longer matches first, added catch-all case;
wenzelm
parents:
27935
diff
changeset
|
159 |
(min, max) |
fdf77e7be01a
more robust pattern: look at longer matches first, added catch-all case;
wenzelm
parents:
27935
diff
changeset
|
160 |
} |
40443 | 161 |
private val table = |
162 |
{ |
|
163 |
var tab = Map[String, String]() |
|
164 |
for ((x, y) <- list) { |
|
165 |
tab.get(x) match { |
|
166 |
case None => tab += (x -> y) |
|
167 |
case Some(z) => |
|
168 |
error("Duplicate mapping of \"" + x + "\" to \"" + y + "\" vs. \"" + z + "\"") |
|
169 |
} |
|
170 |
} |
|
171 |
tab |
|
172 |
} |
|
31522 | 173 |
def recode(text: String): String = |
174 |
{ |
|
27937
fdf77e7be01a
more robust pattern: look at longer matches first, added catch-all case;
wenzelm
parents:
27935
diff
changeset
|
175 |
val len = text.length |
40523
1050315f6ee2
simplified/robustified treatment of malformed symbols, which are now fully internalized (total Symbol.explode etc.);
wenzelm
parents:
40522
diff
changeset
|
176 |
val matcher = regex_total.pattern.matcher(text) |
27937
fdf77e7be01a
more robust pattern: look at longer matches first, added catch-all case;
wenzelm
parents:
27935
diff
changeset
|
177 |
val result = new StringBuilder(len) |
fdf77e7be01a
more robust pattern: look at longer matches first, added catch-all case;
wenzelm
parents:
27935
diff
changeset
|
178 |
var i = 0 |
fdf77e7be01a
more robust pattern: look at longer matches first, added catch-all case;
wenzelm
parents:
27935
diff
changeset
|
179 |
while (i < len) { |
fdf77e7be01a
more robust pattern: look at longer matches first, added catch-all case;
wenzelm
parents:
27935
diff
changeset
|
180 |
val c = text(i) |
fdf77e7be01a
more robust pattern: look at longer matches first, added catch-all case;
wenzelm
parents:
27935
diff
changeset
|
181 |
if (min <= c && c <= max) { |
31929 | 182 |
matcher.region(i, len).lookingAt |
27938 | 183 |
val x = matcher.group |
31522 | 184 |
result.append(table.get(x) getOrElse x) |
27937
fdf77e7be01a
more robust pattern: look at longer matches first, added catch-all case;
wenzelm
parents:
27935
diff
changeset
|
185 |
i = matcher.end |
fdf77e7be01a
more robust pattern: look at longer matches first, added catch-all case;
wenzelm
parents:
27935
diff
changeset
|
186 |
} |
fdf77e7be01a
more robust pattern: look at longer matches first, added catch-all case;
wenzelm
parents:
27935
diff
changeset
|
187 |
else { result.append(c); i += 1 } |
fdf77e7be01a
more robust pattern: look at longer matches first, added catch-all case;
wenzelm
parents:
27935
diff
changeset
|
188 |
} |
fdf77e7be01a
more robust pattern: look at longer matches first, added catch-all case;
wenzelm
parents:
27935
diff
changeset
|
189 |
result.toString |
fdf77e7be01a
more robust pattern: look at longer matches first, added catch-all case;
wenzelm
parents:
27935
diff
changeset
|
190 |
} |
fdf77e7be01a
more robust pattern: look at longer matches first, added catch-all case;
wenzelm
parents:
27935
diff
changeset
|
191 |
} |
27924 | 192 |
|
27918 | 193 |
|
27923
7ebe9d38743a
use scala.collection.jcl.HashMap, which seems to be more efficient;
wenzelm
parents:
27918
diff
changeset
|
194 |
|
27927 | 195 |
/** Symbol interpretation **/ |
196 |
||
34137 | 197 |
class Interpretation(symbol_decls: List[String]) |
29569
f3f529b5d8fb
more general init of Symbol.Interpretation, independent of IsabelleSystem instance;
wenzelm
parents:
29174
diff
changeset
|
198 |
{ |
31522 | 199 |
/* read symbols */ |
200 |
||
201 |
private val empty = new Regex("""(?xs) ^\s* (?: \#.* )? $ """) |
|
202 |
private val key = new Regex("""(?xs) (.+): """) |
|
203 |
||
204 |
private def read_decl(decl: String): (String, Map[String, String]) = |
|
205 |
{ |
|
206 |
def err() = error("Bad symbol declaration: " + decl) |
|
207 |
||
208 |
def read_props(props: List[String]): Map[String, String] = |
|
209 |
{ |
|
210 |
props match { |
|
211 |
case Nil => Map() |
|
212 |
case _ :: Nil => err() |
|
213 |
case key(x) :: y :: rest => read_props(rest) + (x -> y) |
|
214 |
case _ => err() |
|
215 |
} |
|
216 |
} |
|
217 |
decl.split("\\s+").toList match { |
|
40523
1050315f6ee2
simplified/robustified treatment of malformed symbols, which are now fully internalized (total Symbol.explode etc.);
wenzelm
parents:
40522
diff
changeset
|
218 |
case sym :: props if sym.length > 1 && !is_malformed(sym) => (sym, read_props(props)) |
34193 | 219 |
case _ => err() |
31522 | 220 |
} |
221 |
} |
|
222 |
||
223 |
private val symbols: List[(String, Map[String, String])] = |
|
40443 | 224 |
Map(( |
225 |
for (decl <- symbol_decls if !empty.pattern.matcher(decl).matches) |
|
226 |
yield read_decl(decl)): _*) toList |
|
31522 | 227 |
|
228 |
||
31651 | 229 |
/* misc properties */ |
230 |
||
34134 | 231 |
val names: Map[String, String] = |
232 |
{ |
|
31651 | 233 |
val name = new Regex("""\\<([A-Za-z][A-Za-z0-9_']*)>""") |
234 |
Map((for ((sym @ name(a), _) <- symbols) yield (sym -> a)): _*) |
|
235 |
} |
|
236 |
||
40443 | 237 |
val abbrevs: Map[String, String] = |
238 |
Map(( |
|
239 |
for ((sym, props) <- symbols if props.isDefinedAt("abbrev")) |
|
240 |
yield (sym -> props("abbrev"))): _*) |
|
31651 | 241 |
|
242 |
||
31522 | 243 |
/* main recoder methods */ |
244 |
||
245 |
private val (decoder, encoder) = |
|
246 |
{ |
|
247 |
val mapping = |
|
248 |
for { |
|
249 |
(sym, props) <- symbols |
|
250 |
val code = |
|
251 |
try { Integer.decode(props("code")).intValue } |
|
252 |
catch { |
|
253 |
case _: NoSuchElementException => error("Missing code for symbol " + sym) |
|
254 |
case _: NumberFormatException => error("Bad code for symbol " + sym) |
|
255 |
} |
|
256 |
val ch = new String(Character.toChars(code)) |
|
34193 | 257 |
} yield { |
258 |
if (code < 128) error("Illegal ASCII code for symbol " + sym) |
|
259 |
else (sym, ch) |
|
260 |
} |
|
31545
5f1f0a20af4d
discontinued escaped symbols such as \\<forall> -- only one backslash should be used;
wenzelm
parents:
31523
diff
changeset
|
261 |
(new Recoder(mapping), |
31548 | 262 |
new Recoder(mapping map { case (x, y) => (y, x) })) |
31522 | 263 |
} |
27918 | 264 |
|
34098 | 265 |
def decode(text: String): String = decoder.recode(text) |
266 |
def encode(text: String): String = encoder.recode(text) |
|
34134 | 267 |
|
268 |
||
269 |
/* classification */ |
|
270 |
||
34138 | 271 |
private object Decode_Set |
272 |
{ |
|
273 |
def apply(elems: String*): Set[String] = |
|
274 |
{ |
|
275 |
val content = elems.toList |
|
276 |
Set((content ::: content.map(decode)): _*) |
|
277 |
} |
|
278 |
} |
|
279 |
||
280 |
private val letters = Decode_Set( |
|
34134 | 281 |
"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", |
282 |
"N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", |
|
283 |
"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", |
|
284 |
"n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", |
|
285 |
||
286 |
"\\<A>", "\\<B>", "\\<C>", "\\<D>", "\\<E>", "\\<F>", "\\<G>", |
|
287 |
"\\<H>", "\\<I>", "\\<J>", "\\<K>", "\\<L>", "\\<M>", "\\<N>", |
|
288 |
"\\<O>", "\\<P>", "\\<Q>", "\\<R>", "\\<S>", "\\<T>", "\\<U>", |
|
289 |
"\\<V>", "\\<W>", "\\<X>", "\\<Y>", "\\<Z>", "\\<a>", "\\<b>", |
|
290 |
"\\<c>", "\\<d>", "\\<e>", "\\<f>", "\\<g>", "\\<h>", "\\<i>", |
|
291 |
"\\<j>", "\\<k>", "\\<l>", "\\<m>", "\\<n>", "\\<o>", "\\<p>", |
|
292 |
"\\<q>", "\\<r>", "\\<s>", "\\<t>", "\\<u>", "\\<v>", "\\<w>", |
|
293 |
"\\<x>", "\\<y>", "\\<z>", |
|
294 |
||
295 |
"\\<AA>", "\\<BB>", "\\<CC>", "\\<DD>", "\\<EE>", "\\<FF>", |
|
296 |
"\\<GG>", "\\<HH>", "\\<II>", "\\<JJ>", "\\<KK>", "\\<LL>", |
|
297 |
"\\<MM>", "\\<NN>", "\\<OO>", "\\<PP>", "\\<QQ>", "\\<RR>", |
|
298 |
"\\<SS>", "\\<TT>", "\\<UU>", "\\<VV>", "\\<WW>", "\\<XX>", |
|
299 |
"\\<YY>", "\\<ZZ>", "\\<aa>", "\\<bb>", "\\<cc>", "\\<dd>", |
|
300 |
"\\<ee>", "\\<ff>", "\\<gg>", "\\<hh>", "\\<ii>", "\\<jj>", |
|
301 |
"\\<kk>", "\\<ll>", "\\<mm>", "\\<nn>", "\\<oo>", "\\<pp>", |
|
302 |
"\\<qq>", "\\<rr>", "\\<ss>", "\\<tt>", "\\<uu>", "\\<vv>", |
|
303 |
"\\<ww>", "\\<xx>", "\\<yy>", "\\<zz>", |
|
304 |
||
305 |
"\\<alpha>", "\\<beta>", "\\<gamma>", "\\<delta>", "\\<epsilon>", |
|
306 |
"\\<zeta>", "\\<eta>", "\\<theta>", "\\<iota>", "\\<kappa>", |
|
307 |
"\\<mu>", "\\<nu>", "\\<xi>", "\\<pi>", "\\<rho>", "\\<sigma>", |
|
308 |
"\\<tau>", "\\<upsilon>", "\\<phi>", "\\<chi>", "\\<psi>", |
|
309 |
"\\<omega>", "\\<Gamma>", "\\<Delta>", "\\<Theta>", "\\<Lambda>", |
|
310 |
"\\<Xi>", "\\<Pi>", "\\<Sigma>", "\\<Upsilon>", "\\<Phi>", |
|
311 |
"\\<Psi>", "\\<Omega>", |
|
312 |
||
313 |
"\\<^isub>", "\\<^isup>") |
|
314 |
||
34138 | 315 |
private val blanks = |
36816 | 316 |
Decode_Set(space, "\t", "\n", "\u000B", "\f", "\r", "\\<spacespace>", "\\<^newline>") |
34138 | 317 |
|
318 |
private val sym_chars = |
|
319 |
Set("!", "#", "$", "%", "&", "*", "+", "-", "/", "<", "=", ">", "?", "@", "^", "_", "|", "~") |
|
34134 | 320 |
|
321 |
def is_letter(sym: String): Boolean = letters.contains(sym) |
|
34138 | 322 |
def is_digit(sym: String): Boolean = sym.length == 1 && '0' <= sym(0) && sym(0) <= '9' |
34134 | 323 |
def is_quasi(sym: String): Boolean = sym == "_" || sym == "'" |
34138 | 324 |
def is_letdig(sym: String): Boolean = is_letter(sym) || is_digit(sym) || is_quasi(sym) |
34134 | 325 |
def is_blank(sym: String): Boolean = blanks.contains(sym) |
34138 | 326 |
def is_symbolic_char(sym: String): Boolean = sym_chars.contains(sym) |
40523
1050315f6ee2
simplified/robustified treatment of malformed symbols, which are now fully internalized (total Symbol.explode etc.);
wenzelm
parents:
40522
diff
changeset
|
327 |
def is_symbolic(sym: String): Boolean = |
1050315f6ee2
simplified/robustified treatment of malformed symbols, which are now fully internalized (total Symbol.explode etc.);
wenzelm
parents:
40522
diff
changeset
|
328 |
sym.startsWith("\\<") && sym.endsWith(">") && !sym.startsWith("\\<^") |
43443
5d9693c2337e
basic support for extended syntax styles: sub/superscript;
wenzelm
parents:
43418
diff
changeset
|
329 |
def is_controllable(sym: String): Boolean = |
5d9693c2337e
basic support for extended syntax styles: sub/superscript;
wenzelm
parents:
43418
diff
changeset
|
330 |
!is_blank(sym) && !sym.startsWith("\\<^") |
27918 | 331 |
} |
27901 | 332 |
} |