itextomml 1.5.2 → 1.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/itex2MML.h +9 -9
- data/ext/itex2MML_ruby.c +148 -127
- data/ext/lex.yy.c +815 -812
- data/ext/y.tab.c +2243 -2217
- data/ext/y.tab.h +195 -188
- data/lib/itex_stringsupport.rb +8 -20
- data/lib/itextomml.rb +73 -0
- metadata +8 -8
data/ext/y.tab.h
CHANGED
@@ -1,14 +1,13 @@
|
|
1
|
-
/* A Bison parser, made by GNU Bison
|
1
|
+
/* A Bison parser, made by GNU Bison 3.0.4. */
|
2
2
|
|
3
|
-
/*
|
3
|
+
/* Bison interface for Yacc-like parsers in C
|
4
4
|
|
5
|
-
Copyright (C) 1984, 1989
|
6
|
-
Free Software Foundation, Inc.
|
5
|
+
Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
|
7
6
|
|
8
|
-
This program is free software
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
9
8
|
it under the terms of the GNU General Public License as published by
|
10
|
-
the Free Software Foundation
|
11
|
-
any later version.
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
12
11
|
|
13
12
|
This program is distributed in the hope that it will be useful,
|
14
13
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
@@ -16,9 +15,7 @@
|
|
16
15
|
GNU General Public License for more details.
|
17
16
|
|
18
17
|
You should have received a copy of the GNU General Public License
|
19
|
-
along with this program
|
20
|
-
Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
21
|
-
Boston, MA 02110-1301, USA. */
|
18
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
22
19
|
|
23
20
|
/* As a special exception, you may create a larger work that contains
|
24
21
|
part or all of the Bison parser skeleton and distribute that work
|
@@ -33,183 +30,192 @@
|
|
33
30
|
This special exception was added by the Free Software Foundation in
|
34
31
|
version 2.2 of Bison. */
|
35
32
|
|
36
|
-
|
33
|
+
#ifndef YY_ITEX2MML_YY_Y_TAB_H_INCLUDED
|
34
|
+
# define YY_ITEX2MML_YY_Y_TAB_H_INCLUDED
|
35
|
+
/* Debug traces. */
|
36
|
+
#ifndef YYDEBUG
|
37
|
+
# define YYDEBUG 0
|
38
|
+
#endif
|
39
|
+
#if YYDEBUG
|
40
|
+
extern int itex2MML_yydebug;
|
41
|
+
#endif
|
42
|
+
|
43
|
+
/* Token type. */
|
37
44
|
#ifndef YYTOKENTYPE
|
38
45
|
# define YYTOKENTYPE
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
};
|
46
|
+
enum yytokentype
|
47
|
+
{
|
48
|
+
TEXOVER = 258,
|
49
|
+
TEXATOP = 259,
|
50
|
+
CHAR = 260,
|
51
|
+
STARTMATH = 261,
|
52
|
+
STARTDMATH = 262,
|
53
|
+
ENDMATH = 263,
|
54
|
+
MI = 264,
|
55
|
+
MIB = 265,
|
56
|
+
MN = 266,
|
57
|
+
MO = 267,
|
58
|
+
SUP = 268,
|
59
|
+
SUB = 269,
|
60
|
+
MROWOPEN = 270,
|
61
|
+
MROWCLOSE = 271,
|
62
|
+
LEFT = 272,
|
63
|
+
RIGHT = 273,
|
64
|
+
BIG = 274,
|
65
|
+
BBIG = 275,
|
66
|
+
BIGG = 276,
|
67
|
+
BBIGG = 277,
|
68
|
+
BIGL = 278,
|
69
|
+
BBIGL = 279,
|
70
|
+
BIGGL = 280,
|
71
|
+
BBIGGL = 281,
|
72
|
+
FRAC = 282,
|
73
|
+
TFRAC = 283,
|
74
|
+
OPERATORNAME = 284,
|
75
|
+
MATHOP = 285,
|
76
|
+
MATHBIN = 286,
|
77
|
+
MATHREL = 287,
|
78
|
+
MOP = 288,
|
79
|
+
MOL = 289,
|
80
|
+
MOLL = 290,
|
81
|
+
MOF = 291,
|
82
|
+
MOR = 292,
|
83
|
+
PERIODDELIM = 293,
|
84
|
+
OTHERDELIM = 294,
|
85
|
+
LEFTDELIM = 295,
|
86
|
+
RIGHTDELIM = 296,
|
87
|
+
MOS = 297,
|
88
|
+
MOB = 298,
|
89
|
+
SQRT = 299,
|
90
|
+
ROOT = 300,
|
91
|
+
BINOM = 301,
|
92
|
+
TBINOM = 302,
|
93
|
+
UNDER = 303,
|
94
|
+
OVER = 304,
|
95
|
+
OVERBRACE = 305,
|
96
|
+
UNDERLINE = 306,
|
97
|
+
UNDERBRACE = 307,
|
98
|
+
UNDEROVER = 308,
|
99
|
+
TENSOR = 309,
|
100
|
+
MULTI = 310,
|
101
|
+
ARRAYALIGN = 311,
|
102
|
+
COLUMNALIGN = 312,
|
103
|
+
ARRAY = 313,
|
104
|
+
COLSEP = 314,
|
105
|
+
ROWSEP = 315,
|
106
|
+
ARRAYOPTS = 316,
|
107
|
+
COLLAYOUT = 317,
|
108
|
+
COLALIGN = 318,
|
109
|
+
ROWALIGN = 319,
|
110
|
+
ALIGN = 320,
|
111
|
+
EQROWS = 321,
|
112
|
+
EQCOLS = 322,
|
113
|
+
ROWLINES = 323,
|
114
|
+
COLLINES = 324,
|
115
|
+
FRAME = 325,
|
116
|
+
PADDING = 326,
|
117
|
+
ATTRLIST = 327,
|
118
|
+
ITALICS = 328,
|
119
|
+
SANS = 329,
|
120
|
+
TT = 330,
|
121
|
+
BOLD = 331,
|
122
|
+
BOXED = 332,
|
123
|
+
SLASHED = 333,
|
124
|
+
RM = 334,
|
125
|
+
BB = 335,
|
126
|
+
ST = 336,
|
127
|
+
END = 337,
|
128
|
+
BBLOWERCHAR = 338,
|
129
|
+
BBUPPERCHAR = 339,
|
130
|
+
BBDIGIT = 340,
|
131
|
+
CALCHAR = 341,
|
132
|
+
FRAKCHAR = 342,
|
133
|
+
CAL = 343,
|
134
|
+
FRAK = 344,
|
135
|
+
CLAP = 345,
|
136
|
+
LLAP = 346,
|
137
|
+
RLAP = 347,
|
138
|
+
ROWOPTS = 348,
|
139
|
+
TEXTSIZE = 349,
|
140
|
+
SCSIZE = 350,
|
141
|
+
SCSCSIZE = 351,
|
142
|
+
DISPLAY = 352,
|
143
|
+
TEXTSTY = 353,
|
144
|
+
TEXTBOX = 354,
|
145
|
+
TEXTSTRING = 355,
|
146
|
+
XMLSTRING = 356,
|
147
|
+
CELLOPTS = 357,
|
148
|
+
ROWSPAN = 358,
|
149
|
+
COLSPAN = 359,
|
150
|
+
THINSPACE = 360,
|
151
|
+
MEDSPACE = 361,
|
152
|
+
THICKSPACE = 362,
|
153
|
+
QUAD = 363,
|
154
|
+
QQUAD = 364,
|
155
|
+
NEGSPACE = 365,
|
156
|
+
NEGMEDSPACE = 366,
|
157
|
+
NEGTHICKSPACE = 367,
|
158
|
+
PHANTOM = 368,
|
159
|
+
HREF = 369,
|
160
|
+
UNKNOWNCHAR = 370,
|
161
|
+
EMPTYMROW = 371,
|
162
|
+
STATLINE = 372,
|
163
|
+
TOOLTIP = 373,
|
164
|
+
TOGGLE = 374,
|
165
|
+
TOGGLESTART = 375,
|
166
|
+
TOGGLEEND = 376,
|
167
|
+
FGHIGHLIGHT = 377,
|
168
|
+
BGHIGHLIGHT = 378,
|
169
|
+
SPACE = 379,
|
170
|
+
INTONE = 380,
|
171
|
+
INTTWO = 381,
|
172
|
+
INTTHREE = 382,
|
173
|
+
BAR = 383,
|
174
|
+
WIDEBAR = 384,
|
175
|
+
VEC = 385,
|
176
|
+
WIDEVEC = 386,
|
177
|
+
HAT = 387,
|
178
|
+
WIDEHAT = 388,
|
179
|
+
CHECK = 389,
|
180
|
+
WIDECHECK = 390,
|
181
|
+
TILDE = 391,
|
182
|
+
WIDETILDE = 392,
|
183
|
+
DOT = 393,
|
184
|
+
DDOT = 394,
|
185
|
+
DDDOT = 395,
|
186
|
+
DDDDOT = 396,
|
187
|
+
UNARYMINUS = 397,
|
188
|
+
UNARYPLUS = 398,
|
189
|
+
BEGINENV = 399,
|
190
|
+
ENDENV = 400,
|
191
|
+
MATRIX = 401,
|
192
|
+
PMATRIX = 402,
|
193
|
+
BMATRIX = 403,
|
194
|
+
BBMATRIX = 404,
|
195
|
+
VMATRIX = 405,
|
196
|
+
VVMATRIX = 406,
|
197
|
+
SVG = 407,
|
198
|
+
ENDSVG = 408,
|
199
|
+
SMALLMATRIX = 409,
|
200
|
+
CASES = 410,
|
201
|
+
ALIGNED = 411,
|
202
|
+
GATHERED = 412,
|
203
|
+
SUBSTACK = 413,
|
204
|
+
PMOD = 414,
|
205
|
+
RMCHAR = 415,
|
206
|
+
COLOR = 416,
|
207
|
+
BGCOLOR = 417,
|
208
|
+
XARROW = 418,
|
209
|
+
OPTARGOPEN = 419,
|
210
|
+
OPTARGCLOSE = 420,
|
211
|
+
ITEXNUM = 421,
|
212
|
+
RAISEBOX = 422,
|
213
|
+
NEG = 423
|
214
|
+
};
|
209
215
|
#endif
|
210
216
|
/* Tokens. */
|
211
|
-
#define
|
212
|
-
#define
|
217
|
+
#define TEXOVER 258
|
218
|
+
#define TEXATOP 259
|
213
219
|
#define CHAR 260
|
214
220
|
#define STARTMATH 261
|
215
221
|
#define STARTDMATH 262
|
@@ -375,15 +381,16 @@
|
|
375
381
|
#define RAISEBOX 422
|
376
382
|
#define NEG 423
|
377
383
|
|
378
|
-
|
379
|
-
|
380
|
-
|
384
|
+
/* Value type. */
|
381
385
|
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
382
386
|
typedef int YYSTYPE;
|
383
|
-
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
384
|
-
# define YYSTYPE_IS_DECLARED 1
|
385
387
|
# define YYSTYPE_IS_TRIVIAL 1
|
388
|
+
# define YYSTYPE_IS_DECLARED 1
|
386
389
|
#endif
|
387
390
|
|
391
|
+
|
388
392
|
extern YYSTYPE itex2MML_yylval;
|
389
393
|
|
394
|
+
int itex2MML_yyparse (char **ret_str);
|
395
|
+
|
396
|
+
#endif /* !YY_ITEX2MML_YY_Y_TAB_H_INCLUDED */
|
data/lib/itex_stringsupport.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Some useful additions to the String class
|
2
|
-
# Copyright (C) 2010, Jacques Distler. All rights reserved.
|
2
|
+
# Copyright (C) 2010-16, Jacques Distler. All rights reserved.
|
3
3
|
# Licensed under a triple GPL/MPL/LGPL License.
|
4
4
|
|
5
5
|
class String
|
@@ -564,7 +564,6 @@ end
|
|
564
564
|
'daleth' => 'ℸ',
|
565
565
|
'demptyv' => '⦱',
|
566
566
|
'ell' => 'ℓ',
|
567
|
-
'empty' => '∅',
|
568
567
|
'emptyv' => '∅',
|
569
568
|
'gimel' => 'ℷ',
|
570
569
|
'iiota' => '℩',
|
@@ -813,7 +812,6 @@ end
|
|
813
812
|
'upsi' => 'υ',
|
814
813
|
'Xi' => 'Ξ',
|
815
814
|
'xi' => 'ξ',
|
816
|
-
'zeta' => 'ζ',
|
817
815
|
'Afr' => '𝔄',
|
818
816
|
'afr' => '𝔞',
|
819
817
|
'Bfr' => '𝔅',
|
@@ -1521,8 +1519,6 @@ end
|
|
1521
1519
|
'clubs' => '♣',
|
1522
1520
|
'copysr' => '℗',
|
1523
1521
|
'cross' => '✗',
|
1524
|
-
'Dagger' => '‡',
|
1525
|
-
'dagger' => '†',
|
1526
1522
|
'dash' => '‐',
|
1527
1523
|
'diams' => '♦',
|
1528
1524
|
'dlcrop' => '⌍',
|
@@ -2002,7 +1998,7 @@ end
|
|
2002
1998
|
'NotExists' => '∄',
|
2003
1999
|
'NotGreater' => '≯',
|
2004
2000
|
'NotGreaterEqual' => '≱',
|
2005
|
-
'NotGreaterFullEqual' => '&#
|
2001
|
+
'NotGreaterFullEqual' => '≧̸',
|
2006
2002
|
'NotGreaterGreater' => '≫̸',
|
2007
2003
|
'NotGreaterLess' => '≹',
|
2008
2004
|
'NotGreaterSlantEqual' => '⩾̸',
|
@@ -2315,7 +2311,7 @@ end
|
|
2315
2311
|
"'" => ''',
|
2316
2312
|
'"' => '"',
|
2317
2313
|
}
|
2318
|
-
TO_ESCAPE_PATTERN = Regexp.union(TO_ESCAPE.keys)
|
2314
|
+
TO_ESCAPE_PATTERN = Regexp.union(*TO_ESCAPE.keys)
|
2319
2315
|
|
2320
2316
|
def escapeHTML
|
2321
2317
|
self.gsub(TO_ESCAPE_PATTERN){|m| TO_ESCAPE[m]}
|
@@ -2331,24 +2327,16 @@ end
|
|
2331
2327
|
when /\Aquot\z/ni then '"'
|
2332
2328
|
when /\Aapos\z/ni then "'"
|
2333
2329
|
when /\A#0*(\d+)\z/n then
|
2334
|
-
if Integer($1) <
|
2335
|
-
Integer($1).
|
2330
|
+
if Integer($1) < 1114111
|
2331
|
+
[Integer($1)].pack("U")
|
2336
2332
|
else
|
2337
|
-
|
2338
|
-
[Integer($1)].pack("U")
|
2339
|
-
else
|
2340
|
-
"&##{$1};"
|
2341
|
-
end
|
2333
|
+
"&##{$1};"
|
2342
2334
|
end
|
2343
2335
|
when /\A#x([0-9a-f]+)\z/ni then
|
2344
|
-
if $1.hex <
|
2336
|
+
if $1.hex < 1114111
|
2345
2337
|
[$1.hex].pack("U")
|
2346
2338
|
else
|
2347
|
-
|
2348
|
-
[$1.hex].pack("U")
|
2349
|
-
else
|
2350
|
-
"&#x#{$1};"
|
2351
|
-
end
|
2339
|
+
"&#x#{$1};"
|
2352
2340
|
end
|
2353
2341
|
else
|
2354
2342
|
"&#{match};"
|