plurimath 0.11.1 → 0.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/.rubocop_todo.yml +108 -175
- data/Gemfile +1 -0
- data/README.adoc +282 -6
- data/lib/plurimath/asciimath/parse.rb +6 -1
- data/lib/plurimath/asciimath/transform.rb +2 -0
- data/lib/plurimath/base_number_prefix.rb +43 -0
- data/lib/plurimath/configuration.rb +9 -1
- data/lib/plurimath/errors/evaluation/division_by_zero_error.rb +13 -0
- data/lib/plurimath/errors/evaluation/error.rb +9 -0
- data/lib/plurimath/errors/evaluation/invalid_binding_error.rb +14 -0
- data/lib/plurimath/errors/evaluation/invalid_binding_key_error.rb +14 -0
- data/lib/plurimath/errors/evaluation/math_domain_error.rb +9 -0
- data/lib/plurimath/errors/evaluation/missing_variable_error.rb +13 -0
- data/lib/plurimath/errors/evaluation/non_finite_result_error.rb +13 -0
- data/lib/plurimath/errors/evaluation/unsupported_expression_error.rb +13 -0
- data/lib/plurimath/errors/evaluation.rb +18 -0
- data/lib/plurimath/errors.rb +1 -0
- data/lib/plurimath/formatter/numbers/base_notation.rb +54 -31
- data/lib/plurimath/formatter/numbers/formatted_notation.rb +62 -0
- data/lib/plurimath/formatter/numbers/formatted_number.rb +87 -0
- data/lib/plurimath/formatter/numbers/fraction.rb +1 -1
- data/lib/plurimath/formatter/numbers/mathml_renderer.rb +56 -0
- data/lib/plurimath/formatter/numbers/notation_renderer.rb +30 -29
- data/lib/plurimath/formatter/numbers/number_renderer.rb +10 -9
- data/lib/plurimath/formatter/numbers/omml_renderer.rb +74 -0
- data/lib/plurimath/formatter/numbers/source.rb +29 -4
- data/lib/plurimath/formatter/numbers/text_renderer.rb +52 -0
- data/lib/plurimath/formatter/numbers.rb +6 -2
- data/lib/plurimath/html/parse.rb +5 -0
- data/lib/plurimath/html/transform.rb +2 -0
- data/lib/plurimath/latex/parse.rb +5 -0
- data/lib/plurimath/latex/transform.rb +2 -0
- data/lib/plurimath/math/core.rb +52 -0
- data/lib/plurimath/math/evaluation/evaluator.rb +147 -0
- data/lib/plurimath/math/evaluation/expression_parser.rb +215 -0
- data/lib/plurimath/math/evaluation/iteration.rb +63 -0
- data/lib/plurimath/math/evaluation.rb +13 -0
- data/lib/plurimath/math/formula.rb +9 -0
- data/lib/plurimath/math/function/abs.rb +4 -0
- data/lib/plurimath/math/function/arccos.rb +4 -0
- data/lib/plurimath/math/function/arcsin.rb +4 -0
- data/lib/plurimath/math/function/arctan.rb +4 -0
- data/lib/plurimath/math/function/ceil.rb +4 -0
- data/lib/plurimath/math/function/cos.rb +4 -0
- data/lib/plurimath/math/function/cosh.rb +4 -0
- data/lib/plurimath/math/function/cot.rb +4 -0
- data/lib/plurimath/math/function/coth.rb +4 -0
- data/lib/plurimath/math/function/csc.rb +4 -0
- data/lib/plurimath/math/function/csch.rb +4 -0
- data/lib/plurimath/math/function/exp.rb +4 -0
- data/lib/plurimath/math/function/fenced.rb +4 -0
- data/lib/plurimath/math/function/floor.rb +4 -0
- data/lib/plurimath/math/function/frac.rb +7 -0
- data/lib/plurimath/math/function/gcd.rb +9 -0
- data/lib/plurimath/math/function/lcm.rb +9 -0
- data/lib/plurimath/math/function/lg.rb +4 -0
- data/lib/plurimath/math/function/ln.rb +4 -0
- data/lib/plurimath/math/function/log.rb +19 -0
- data/lib/plurimath/math/function/max.rb +4 -0
- data/lib/plurimath/math/function/min.rb +4 -0
- data/lib/plurimath/math/function/mod.rb +15 -0
- data/lib/plurimath/math/function/power.rb +10 -0
- data/lib/plurimath/math/function/prod.rb +10 -0
- data/lib/plurimath/math/function/root.rb +7 -0
- data/lib/plurimath/math/function/sec.rb +4 -0
- data/lib/plurimath/math/function/sech.rb +4 -0
- data/lib/plurimath/math/function/sin.rb +4 -0
- data/lib/plurimath/math/function/sinh.rb +4 -0
- data/lib/plurimath/math/function/sqrt.rb +4 -0
- data/lib/plurimath/math/function/sum.rb +10 -0
- data/lib/plurimath/math/function/tan.rb +4 -0
- data/lib/plurimath/math/function/tanh.rb +4 -0
- data/lib/plurimath/math/function/text.rb +17 -0
- data/lib/plurimath/math/number.rb +40 -29
- data/lib/plurimath/math/symbols/cdot.rb +4 -0
- data/lib/plurimath/math/symbols/div.rb +4 -0
- data/lib/plurimath/math/symbols/hat.rb +4 -0
- data/lib/plurimath/math/symbols/minus.rb +4 -0
- data/lib/plurimath/math/symbols/pi.rb +5 -1
- data/lib/plurimath/math/symbols/plus.rb +4 -0
- data/lib/plurimath/math/symbols/slash.rb +4 -0
- data/lib/plurimath/math/symbols/symbol.rb +45 -0
- data/lib/plurimath/math/symbols/times.rb +4 -0
- data/lib/plurimath/math.rb +1 -0
- data/lib/plurimath/mathml/constants.rb +18 -0
- data/lib/plurimath/number_formatter.rb +47 -28
- data/lib/plurimath/setup/opal.rb.erb +13 -0
- data/lib/plurimath/unicode_math/parse.rb +5 -1
- data/lib/plurimath/unicode_math/transform.rb +469 -755
- data/lib/plurimath/utility.rb +1 -1
- data/lib/plurimath/version.rb +1 -1
- data/lib/plurimath.rb +1 -0
- metadata +21 -3
- data/lib/plurimath/formatter/numbers/parts_renderer.rb +0 -30
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Plurimath
|
|
4
4
|
class UnicodeMath
|
|
5
5
|
class Transform < Parslet::Transform
|
|
6
|
+
include Plurimath::BaseNumberPrefix::Transform
|
|
7
|
+
|
|
6
8
|
rule(td: simple(:td)) { Math::Function::Td.new([td]) }
|
|
7
9
|
rule(tr: simple(:tr)) { Math::Function::Tr.new([tr]) }
|
|
8
10
|
|
|
@@ -39,9 +41,7 @@ module Plurimath
|
|
|
39
41
|
rule(script: simple(:script)) { :script }
|
|
40
42
|
rule(double: simple(:double)) { :double }
|
|
41
43
|
rule(mitBbb: simple(:mitBbb)) { :mitBbb }
|
|
42
|
-
rule(symbol: simple(:symbol))
|
|
43
|
-
Utility.symbols_class(symbol, lang: :unicodemath)
|
|
44
|
-
end
|
|
44
|
+
rule(symbol: simple(:symbol)) { Utility.symbols_class(symbol, lang: :unicodemath) }
|
|
45
45
|
rule(number: simple(:number)) { Math::Number.new(number) }
|
|
46
46
|
|
|
47
47
|
rule(backcolor: simple(:color)) { color }
|
|
@@ -58,12 +58,8 @@ module Plurimath
|
|
|
58
58
|
rule(operand: sequence(:operand)) { operand }
|
|
59
59
|
rule(mini_sup: simple(:mini_sup)) { mini_sup }
|
|
60
60
|
rule(mini_sub: simple(:mini_sub)) { mini_sub }
|
|
61
|
-
rule(close_paren: simple(:paren))
|
|
62
|
-
|
|
63
|
-
end
|
|
64
|
-
rule(operator: simple(:operator)) do
|
|
65
|
-
Utility.symbols_class(operator, lang: :unicodemath)
|
|
66
|
-
end
|
|
61
|
+
rule(close_paren: simple(:paren)) { Utility.symbols_class(paren, lang: :unicodemath) }
|
|
62
|
+
rule(operator: simple(:operator)) { Utility.symbols_class(operator, lang: :unicodemath) }
|
|
67
63
|
|
|
68
64
|
rule(unary_sub_sup: simple(:unary)) { unary }
|
|
69
65
|
rule(sub_script: sequence(:script)) { script }
|
|
@@ -77,13 +73,9 @@ module Plurimath
|
|
|
77
73
|
rule(accents_subsup: simple(:subsup)) { subsup }
|
|
78
74
|
rule(subsup_exp: simple(:subsup_exp)) { subsup_exp }
|
|
79
75
|
rule(expression: simple(:expression)) { expression }
|
|
80
|
-
rule(open_paren: simple(:open_paren))
|
|
81
|
-
Utility.symbols_class(open_paren, lang: :unicodemath)
|
|
82
|
-
end
|
|
76
|
+
rule(open_paren: simple(:open_paren)) { Utility.symbols_class(open_paren, lang: :unicodemath) }
|
|
83
77
|
rule(override_subsup: simple(:subsup)) { subsup }
|
|
84
|
-
rule(slashed_value: sequence(:values))
|
|
85
|
-
Utility.sequence_slashed_values(values, lang: :unicodemath)
|
|
86
|
-
end
|
|
78
|
+
rule(slashed_value: sequence(:values)) { Utility.sequence_slashed_values(values, lang: :unicodemath) }
|
|
87
79
|
|
|
88
80
|
rule(intermediate_exp: sequence(:expr)) { expr }
|
|
89
81
|
rule(diacritic_belows: simple(:belows)) { belows }
|
|
@@ -91,25 +83,17 @@ module Plurimath
|
|
|
91
83
|
rule(sup_recursion: simple(:recursion)) { recursion }
|
|
92
84
|
rule(nary_sub_sup: simple(:subsup_exp)) { subsup_exp }
|
|
93
85
|
rule(open_paren: sequence(:open_paren)) { open_paren }
|
|
94
|
-
rule(subsup_exp: sequence(:subsup_exp))
|
|
95
|
-
Utility.filter_values(subsup_exp)
|
|
96
|
-
end
|
|
86
|
+
rule(subsup_exp: sequence(:subsup_exp)) { Utility.filter_values(subsup_exp) }
|
|
97
87
|
|
|
98
88
|
rule(diacritics_accents: simple(:accent)) { accent }
|
|
99
89
|
rule(mini_sub_sup: simple(:mini_sub_sup)) { mini_sub_sup }
|
|
100
90
|
rule(unary_subsup: simple(:unary_subsup)) { unary_subsup }
|
|
101
|
-
rule(exclamation_symbol: simple(:symbol))
|
|
102
|
-
|
|
103
|
-
end
|
|
104
|
-
rule(alphanumeric: simple(:alphanumeric)) do
|
|
105
|
-
Utility.symbols_class(alphanumeric, lang: :unicodemath)
|
|
106
|
-
end
|
|
91
|
+
rule(exclamation_symbol: simple(:symbol)) { Utility.symbols_class(symbol, lang: :unicodemath) }
|
|
92
|
+
rule(alphanumeric: simple(:alphanumeric)) { Utility.symbols_class(alphanumeric, lang: :unicodemath) }
|
|
107
93
|
|
|
108
94
|
rule(diacritic_overlays: simple(:overlays)) { overlays }
|
|
109
95
|
rule(mini_sub_sup: sequence(:mini_sub_sup)) { mini_sub_sup }
|
|
110
|
-
rule(unicode_fractions: simple(:fractions))
|
|
111
|
-
Utility.unicode_fractions(fractions)
|
|
112
|
-
end
|
|
96
|
+
rule(unicode_fractions: simple(:fractions)) { Utility.unicode_fractions(fractions) }
|
|
113
97
|
rule(mini_intermediate_exp: simple(:mini_expr)) { mini_expr }
|
|
114
98
|
|
|
115
99
|
rule(combined_symbols: simple(:combined_symbols)) do
|
|
@@ -145,9 +129,9 @@ module Plurimath
|
|
|
145
129
|
|
|
146
130
|
rule(negated_operator: simple(:operator)) do
|
|
147
131
|
Math::Formula.new([
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
132
|
+
Utility.symbols_class(operator, lang: :unicodemath),
|
|
133
|
+
Math::Symbols::Symbol.new("̸"),
|
|
134
|
+
])
|
|
151
135
|
end
|
|
152
136
|
|
|
153
137
|
rule(ordinary_symbols: simple(:ordinary)) do
|
|
@@ -188,16 +172,16 @@ module Plurimath
|
|
|
188
172
|
nary_function = if Constants::NARY_CLASSES.key?(nary_class.to_sym)
|
|
189
173
|
nary_class
|
|
190
174
|
else
|
|
191
|
-
Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class
|
|
175
|
+
(Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class)
|
|
192
176
|
end
|
|
193
177
|
Utility.get_class(nary_function).new
|
|
194
178
|
end
|
|
195
179
|
|
|
196
180
|
rule(ordinary_negated_operator: simple(:operator)) do
|
|
197
181
|
Math::Formula.new([
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
182
|
+
Utility.symbols_class(operator, lang: :unicodemath),
|
|
183
|
+
Math::Symbols::Symbol.new("̸"),
|
|
184
|
+
])
|
|
201
185
|
end
|
|
202
186
|
|
|
203
187
|
rule(decimal: simple(:decimal),
|
|
@@ -242,7 +226,7 @@ module Plurimath
|
|
|
242
226
|
unicoded.to_sym,
|
|
243
227
|
symbol.to_sym,
|
|
244
228
|
)
|
|
245
|
-
Utility.symbols_class(unicode || symbol, lang: :unicodemath)
|
|
229
|
+
Utility.symbols_class((unicode || symbol), lang: :unicodemath)
|
|
246
230
|
end
|
|
247
231
|
|
|
248
232
|
rule(font_class: simple(:fonts),
|
|
@@ -271,45 +255,43 @@ module Plurimath
|
|
|
271
255
|
|
|
272
256
|
rule(binary_symbols: simple(:symbols),
|
|
273
257
|
expr: simple(:expr)) do
|
|
274
|
-
symbol = Constants::BINARY_SYMBOLS[symbols.to_sym] || symbols
|
|
258
|
+
symbol = (Constants::BINARY_SYMBOLS[symbols.to_sym] || symbols)
|
|
275
259
|
[Utility.symbols_class(symbol, lang: :unicodemath), expr]
|
|
276
260
|
end
|
|
277
261
|
|
|
278
262
|
rule(binary_symbols: simple(:symbols),
|
|
279
263
|
exp: sequence(:exp)) do
|
|
280
|
-
symbol = Constants::BINARY_SYMBOLS[symbols.to_sym] || symbols
|
|
264
|
+
symbol = (Constants::BINARY_SYMBOLS[symbols.to_sym] || symbols)
|
|
281
265
|
[Utility.symbols_class(symbol, lang: :unicodemath)] + exp
|
|
282
266
|
end
|
|
283
267
|
|
|
284
268
|
rule(binary_symbols: simple(:symbols),
|
|
285
269
|
expr: sequence(:expr)) do
|
|
286
|
-
symbol = Constants::BINARY_SYMBOLS[symbols.to_sym] || symbols
|
|
270
|
+
symbol = (Constants::BINARY_SYMBOLS[symbols.to_sym] || symbols)
|
|
287
271
|
[Utility.symbols_class(symbol, lang: :unicodemath)] + expr
|
|
288
272
|
end
|
|
289
273
|
|
|
290
274
|
rule(binary_symbols: simple(:symbols),
|
|
291
275
|
naryand_recursion: simple(:naryand_recursion)) do
|
|
292
|
-
symbol = Constants::BINARY_SYMBOLS[symbols.to_sym] || symbols
|
|
276
|
+
symbol = (Constants::BINARY_SYMBOLS[symbols.to_sym] || symbols)
|
|
293
277
|
[Utility.symbols_class(symbol, lang: :unicodemath), naryand_recursion]
|
|
294
278
|
end
|
|
295
279
|
|
|
296
280
|
rule(binary_symbols: simple(:symbols),
|
|
297
281
|
recursive_denominator: simple(:recursive_denominator)) do
|
|
298
|
-
symbol = Constants::BINARY_SYMBOLS[symbols.to_sym] || symbols
|
|
299
|
-
[Utility.symbols_class(symbol, lang: :unicodemath),
|
|
300
|
-
recursive_denominator]
|
|
282
|
+
symbol = (Constants::BINARY_SYMBOLS[symbols.to_sym] || symbols)
|
|
283
|
+
[Utility.symbols_class(symbol, lang: :unicodemath), recursive_denominator]
|
|
301
284
|
end
|
|
302
285
|
|
|
303
286
|
rule(binary_symbols: simple(:symbols),
|
|
304
287
|
recursive_denominator: sequence(:recursive_denominator)) do
|
|
305
|
-
symbol = Constants::BINARY_SYMBOLS[symbols.to_sym] || symbols
|
|
306
|
-
[Utility.symbols_class(symbol,
|
|
307
|
-
lang: :unicodemath)] + recursive_denominator
|
|
288
|
+
symbol = (Constants::BINARY_SYMBOLS[symbols.to_sym] || symbols)
|
|
289
|
+
[Utility.symbols_class(symbol, lang: :unicodemath)] + recursive_denominator
|
|
308
290
|
end
|
|
309
291
|
|
|
310
292
|
rule(binary_symbols: simple(:symbols),
|
|
311
293
|
recursive_numerator: simple(:recursive_numerator)) do
|
|
312
|
-
symbol = Constants::BINARY_SYMBOLS[symbols.to_sym] || symbols
|
|
294
|
+
symbol = (Constants::BINARY_SYMBOLS[symbols.to_sym] || symbols)
|
|
313
295
|
[Utility.symbols_class(symbol, lang: :unicodemath), recursive_numerator]
|
|
314
296
|
end
|
|
315
297
|
|
|
@@ -324,10 +306,9 @@ module Plurimath
|
|
|
324
306
|
expr: simple(:expr)) do
|
|
325
307
|
[
|
|
326
308
|
Math::Formula.new([
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
]),
|
|
309
|
+
Utility.symbols_class(operator, lang: :unicodemath),
|
|
310
|
+
Math::Symbols::Symbol.new("̸"),
|
|
311
|
+
]),
|
|
331
312
|
expr,
|
|
332
313
|
]
|
|
333
314
|
end
|
|
@@ -336,10 +317,9 @@ module Plurimath
|
|
|
336
317
|
expr: sequence(:expr)) do
|
|
337
318
|
[
|
|
338
319
|
Math::Formula.new([
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
]),
|
|
320
|
+
Utility.symbols_class(operator, lang: :unicodemath),
|
|
321
|
+
Math::Symbols::Symbol.new("̸"),
|
|
322
|
+
]),
|
|
343
323
|
] + expr
|
|
344
324
|
end
|
|
345
325
|
|
|
@@ -347,10 +327,9 @@ module Plurimath
|
|
|
347
327
|
expr: simple(:expr)) do
|
|
348
328
|
[
|
|
349
329
|
Math::Formula.new([
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
]),
|
|
330
|
+
Utility.symbols_class(operator, lang: :unicodemath),
|
|
331
|
+
Math::Symbols::Symbol.new("̸"),
|
|
332
|
+
]),
|
|
354
333
|
expr,
|
|
355
334
|
]
|
|
356
335
|
end
|
|
@@ -571,7 +550,7 @@ module Plurimath
|
|
|
571
550
|
sub_recursion_expr: sequence(:sub_recursion_expr)) do
|
|
572
551
|
digit = Constants::SUB_DIGITS.key(sub_digits).to_s
|
|
573
552
|
[
|
|
574
|
-
Math::Number.new(digit, mini_sub_sized: true)
|
|
553
|
+
Math::Number.new(digit, mini_sub_sized: true)
|
|
575
554
|
] + sub_recursion_expr
|
|
576
555
|
end
|
|
577
556
|
|
|
@@ -585,7 +564,7 @@ module Plurimath
|
|
|
585
564
|
sup_recursion_expr: sequence(:sup_recursion_expr)) do
|
|
586
565
|
alpha = Constants::SUP_ALPHABETS.key(sup_alpha)
|
|
587
566
|
[
|
|
588
|
-
Math::Symbols::Symbol.new(alpha.to_s, mini_sup_sized: true)
|
|
567
|
+
Math::Symbols::Symbol.new(alpha.to_s, mini_sup_sized: true)
|
|
589
568
|
] + sup_recursion_expr
|
|
590
569
|
end
|
|
591
570
|
|
|
@@ -602,7 +581,7 @@ module Plurimath
|
|
|
602
581
|
sup_recursion_expr: sequence(:sup_recursion_expr)) do
|
|
603
582
|
digit = Constants::SUP_DIGITS.key(digits).to_s
|
|
604
583
|
[
|
|
605
|
-
Math::Number.new(digit, mini_sup_sized: true)
|
|
584
|
+
Math::Number.new(digit, mini_sup_sized: true)
|
|
606
585
|
] + sup_recursion_expr
|
|
607
586
|
end
|
|
608
587
|
|
|
@@ -1035,12 +1014,11 @@ module Plurimath
|
|
|
1035
1014
|
|
|
1036
1015
|
rule(base: simple(:base),
|
|
1037
1016
|
sub: simple(:sub)) do
|
|
1038
|
-
if Constants::BINARY_FUNCTIONS.include?(base.class_name) && !base.parameter_one
|
|
1017
|
+
if (Constants::BINARY_FUNCTIONS.include?(base.class_name) && !base.parameter_one)
|
|
1039
1018
|
if sub.class_name == "underset"
|
|
1040
1019
|
base.parameter_one = sub.parameter_one
|
|
1041
1020
|
else
|
|
1042
|
-
base.parameter_one = Utility.unfenced_value(sub,
|
|
1043
|
-
paren_specific: true)
|
|
1021
|
+
base.parameter_one = Utility.unfenced_value(sub, paren_specific: true)
|
|
1044
1022
|
end
|
|
1045
1023
|
base
|
|
1046
1024
|
elsif sub.class_name == "underset"
|
|
@@ -1053,17 +1031,19 @@ module Plurimath
|
|
|
1053
1031
|
base.parameter_two,
|
|
1054
1032
|
)
|
|
1055
1033
|
|
|
1056
|
-
elsif (base.is_a?(Math::Function::Underset) && Constants::HORIZONTAL_BRACKETS.key(base.parameter_one.value.to_s)) ||
|
|
1057
|
-
(base.class_name == "ubrace" && !base.parameter_one.is_a?(Math::Formula))
|
|
1058
|
-
Math::Function::Underset.new(
|
|
1059
|
-
Utility.unfenced_value(sub, paren_specific: true),
|
|
1060
|
-
base,
|
|
1061
|
-
)
|
|
1062
1034
|
else
|
|
1063
|
-
Math::Function::
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1035
|
+
if (base.is_a?(Math::Function::Underset) && Constants::HORIZONTAL_BRACKETS.key(base.parameter_one.value.to_s)) ||
|
|
1036
|
+
("ubrace" == base.class_name && !base.parameter_one.is_a?(Math::Formula))
|
|
1037
|
+
Math::Function::Underset.new(
|
|
1038
|
+
Utility.unfenced_value(sub, paren_specific: true),
|
|
1039
|
+
base,
|
|
1040
|
+
)
|
|
1041
|
+
else
|
|
1042
|
+
Math::Function::Base.new(
|
|
1043
|
+
base,
|
|
1044
|
+
Utility.unfenced_value(sub, paren_specific: true),
|
|
1045
|
+
)
|
|
1046
|
+
end
|
|
1067
1047
|
end
|
|
1068
1048
|
end
|
|
1069
1049
|
|
|
@@ -1093,7 +1073,7 @@ module Plurimath
|
|
|
1093
1073
|
|
|
1094
1074
|
rule(base: simple(:base),
|
|
1095
1075
|
sub: sequence(:sub)) do
|
|
1096
|
-
if Constants::BINARY_FUNCTIONS.include?(base.class_name) && !base.parameter_one
|
|
1076
|
+
if (Constants::BINARY_FUNCTIONS.include?(base.class_name) && !base.parameter_one)
|
|
1097
1077
|
base.parameter_one = sub_value
|
|
1098
1078
|
base
|
|
1099
1079
|
elsif base.is_a?(Math::Function::Power) && Utility.base_is_prime?(base)
|
|
@@ -1131,22 +1111,24 @@ module Plurimath
|
|
|
1131
1111
|
|
|
1132
1112
|
rule(base: simple(:base),
|
|
1133
1113
|
sup: simple(:sup)) do
|
|
1134
|
-
if sup.class_name
|
|
1114
|
+
if "overset" == sup.class_name && !sup.parameter_two
|
|
1135
1115
|
sup.parameter_two = Utility.unfenced_value(base, paren_specific: true)
|
|
1136
1116
|
sup
|
|
1137
|
-
elsif Constants::BINARY_FUNCTIONS.include?(base.class_name) && !base.parameter_one
|
|
1117
|
+
elsif (Constants::BINARY_FUNCTIONS.include?(base.class_name) && !base.parameter_one)
|
|
1138
1118
|
base.parameter_two = Utility.unfenced_value(sup, paren_specific: true)
|
|
1139
1119
|
base
|
|
1140
|
-
elsif (base.is_a?(Math::Function::Overset) && Constants::HORIZONTAL_BRACKETS.key(base.parameter_one.value.to_s)) || base.class_name == "obrace"
|
|
1141
|
-
Math::Function::Overset.new(
|
|
1142
|
-
Utility.unfenced_value(sup, paren_specific: true),
|
|
1143
|
-
base,
|
|
1144
|
-
)
|
|
1145
1120
|
else
|
|
1146
|
-
Math::Function::
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1121
|
+
if base.is_a?(Math::Function::Overset) && Constants::HORIZONTAL_BRACKETS.key(base.parameter_one.value.to_s) || "obrace" == base.class_name
|
|
1122
|
+
Math::Function::Overset.new(
|
|
1123
|
+
Utility.unfenced_value(sup, paren_specific: true),
|
|
1124
|
+
base,
|
|
1125
|
+
)
|
|
1126
|
+
else
|
|
1127
|
+
Math::Function::Power.new(
|
|
1128
|
+
base,
|
|
1129
|
+
Utility.unfenced_value(sup, paren_specific: true),
|
|
1130
|
+
)
|
|
1131
|
+
end
|
|
1150
1132
|
end
|
|
1151
1133
|
end
|
|
1152
1134
|
|
|
@@ -1154,18 +1136,18 @@ module Plurimath
|
|
|
1154
1136
|
sup: simple(:sup)) do
|
|
1155
1137
|
power = Math::Function::Power.new(
|
|
1156
1138
|
base.pop,
|
|
1157
|
-
Utility.unfenced_value(sup, paren_specific: true)
|
|
1139
|
+
Utility.unfenced_value(sup, paren_specific: true)
|
|
1158
1140
|
)
|
|
1159
1141
|
Math::Formula.new(base << power)
|
|
1160
1142
|
end
|
|
1161
1143
|
|
|
1162
1144
|
rule(base: simple(:base),
|
|
1163
1145
|
sup: sequence(:sup)) do
|
|
1164
|
-
if base.class_name == "base" && Utility.base_is_sub_or_sup?(base.parameter_two)
|
|
1146
|
+
if (base.class_name == "base" && Utility.base_is_sub_or_sup?(base.parameter_two))
|
|
1165
1147
|
Math::Function::PowerBase.new(
|
|
1166
1148
|
base.parameter_one,
|
|
1167
1149
|
base.parameter_two,
|
|
1168
|
-
Utility.unfenced_value(sup, paren_specific: true)
|
|
1150
|
+
Utility.unfenced_value(sup, paren_specific: true)
|
|
1169
1151
|
)
|
|
1170
1152
|
else
|
|
1171
1153
|
Math::Function::Power.new(
|
|
@@ -1224,7 +1206,7 @@ module Plurimath
|
|
|
1224
1206
|
first_value: simple(:first_value)) do
|
|
1225
1207
|
if ["abs", "⒜"].any?(function)
|
|
1226
1208
|
Math::Function::Abs.new(
|
|
1227
|
-
Utility.unfenced_value(first_value, paren_specific: true)
|
|
1209
|
+
Utility.unfenced_value(first_value, paren_specific: true)
|
|
1228
1210
|
)
|
|
1229
1211
|
else
|
|
1230
1212
|
unary = Constants::UNARY_ARG_FUNCTIONS.key(function) || function.to_sym
|
|
@@ -1237,15 +1219,13 @@ module Plurimath
|
|
|
1237
1219
|
|
|
1238
1220
|
rule(unary_symbols: simple(:unary),
|
|
1239
1221
|
first_value: simple(:first_value)) do
|
|
1240
|
-
unary_symbol = Constants::UNARY_SYMBOLS.key(unary.to_s) || unary.to_sym
|
|
1222
|
+
unary_symbol = (Constants::UNARY_SYMBOLS.key(unary.to_s) || unary.to_sym)
|
|
1241
1223
|
if Constants::PHANTOM_SYMBOLS.key?(unary_symbol)
|
|
1242
1224
|
new_value = nil
|
|
1243
1225
|
Constants::PHANTOM_SYMBOLS[unary_symbol].map do |function_name, attributes|
|
|
1244
1226
|
if function_name == :phantom && attributes
|
|
1245
1227
|
new_value = Math::Function::Phantom.new(
|
|
1246
|
-
Utility.unfenced_value(
|
|
1247
|
-
(new_value.nil? ? first_value : new_value), paren_specific: true
|
|
1248
|
-
),
|
|
1228
|
+
Utility.unfenced_value((new_value.nil? ? first_value : new_value), paren_specific: true)
|
|
1249
1229
|
)
|
|
1250
1230
|
elsif function_name == :mpadded
|
|
1251
1231
|
new_value = Math::Function::Mpadded.new(
|
|
@@ -1257,7 +1237,7 @@ module Plurimath
|
|
|
1257
1237
|
new_value
|
|
1258
1238
|
else
|
|
1259
1239
|
notation = Utility::UNICODEMATH_MENCLOSE_FUNCTIONS[unary.to_sym] ||
|
|
1260
|
-
|
|
1240
|
+
Utility::UNICODEMATH_MENCLOSE_FUNCTIONS[unary_symbol.to_sym]
|
|
1261
1241
|
Math::Function::Menclose.new(
|
|
1262
1242
|
notation,
|
|
1263
1243
|
Utility.unfenced_value(first_value, paren_specific: true),
|
|
@@ -1267,19 +1247,19 @@ module Plurimath
|
|
|
1267
1247
|
|
|
1268
1248
|
rule(backcolor_value: simple(:color),
|
|
1269
1249
|
first_value: simple(:first_value)) do
|
|
1270
|
-
Math::Function::Color.new(
|
|
1250
|
+
color_obj = Math::Function::Color.new(
|
|
1271
1251
|
Math::Symbols::Symbol.new(color),
|
|
1272
1252
|
first_value,
|
|
1273
|
-
{ backgroundcolor: true }
|
|
1253
|
+
{ backgroundcolor: true }
|
|
1274
1254
|
)
|
|
1275
1255
|
end
|
|
1276
1256
|
|
|
1277
1257
|
rule(backcolor_value: simple(:color),
|
|
1278
1258
|
first_value: sequence(:first_value)) do
|
|
1279
|
-
Math::Function::Color.new(
|
|
1259
|
+
color_obj = Math::Function::Color.new(
|
|
1280
1260
|
Math::Symbols::Symbol.new(color),
|
|
1281
1261
|
Utility.filter_values(first_value),
|
|
1282
|
-
{ backgroundcolor: true }
|
|
1262
|
+
{ backgroundcolor: true }
|
|
1283
1263
|
)
|
|
1284
1264
|
end
|
|
1285
1265
|
|
|
@@ -1308,21 +1288,23 @@ module Plurimath
|
|
|
1308
1288
|
if value.is_a?(Math::Function::Base) && !value.parameter_one.is_a?(Math::Formula)
|
|
1309
1289
|
Math::Function::Underset.new(
|
|
1310
1290
|
value.parameter_two,
|
|
1311
|
-
Math::Function::Ubrace.new(value.parameter_one)
|
|
1291
|
+
Math::Function::Ubrace.new(value.parameter_one)
|
|
1312
1292
|
)
|
|
1313
1293
|
else
|
|
1314
1294
|
Math::Function::Ubrace.new(value)
|
|
1315
1295
|
end
|
|
1316
|
-
elsif Constants::UNDER_HORIZONTAL_BRACKETS[hbrack.to_sym] || Constants::UNDER_HORIZONTAL_BRACKETS.key(hbrack)
|
|
1317
|
-
Math::Function::Underset.new(
|
|
1318
|
-
Math::Symbols::Symbol.new(Constants::HORIZONTAL_BRACKETS[hbrack.to_sym] || hbrack),
|
|
1319
|
-
value,
|
|
1320
|
-
)
|
|
1321
1296
|
else
|
|
1322
|
-
|
|
1323
|
-
Math::
|
|
1324
|
-
|
|
1325
|
-
|
|
1297
|
+
if Constants::UNDER_HORIZONTAL_BRACKETS[hbrack.to_sym] || Constants::UNDER_HORIZONTAL_BRACKETS.key(hbrack)
|
|
1298
|
+
Math::Function::Underset.new(
|
|
1299
|
+
Math::Symbols::Symbol.new(Constants::HORIZONTAL_BRACKETS[hbrack.to_sym] || hbrack),
|
|
1300
|
+
value,
|
|
1301
|
+
)
|
|
1302
|
+
else
|
|
1303
|
+
Math::Function::Overset.new(
|
|
1304
|
+
Math::Symbols::Symbol.new(Constants::HORIZONTAL_BRACKETS[hbrack.to_sym] || hbrack),
|
|
1305
|
+
value,
|
|
1306
|
+
)
|
|
1307
|
+
end
|
|
1326
1308
|
end
|
|
1327
1309
|
end
|
|
1328
1310
|
|
|
@@ -1335,28 +1317,29 @@ module Plurimath
|
|
|
1335
1317
|
if value.is_a?(Math::Function::Base) && !value.parameter_one.is_a?(Math::Formula)
|
|
1336
1318
|
Math::Function::Underset.new(
|
|
1337
1319
|
value.parameter_two,
|
|
1338
|
-
Math::Function::Ubrace.new(value.parameter_one)
|
|
1320
|
+
Math::Function::Ubrace.new(value.parameter_one)
|
|
1339
1321
|
)
|
|
1340
1322
|
else
|
|
1341
1323
|
Math::Function::Ubrace.new(value)
|
|
1342
1324
|
end
|
|
1343
|
-
elsif Constants::UNDER_HORIZONTAL_BRACKETS[hbrack.to_sym] || Constants::UNDER_HORIZONTAL_BRACKETS.key(hbrack)
|
|
1344
|
-
Math::Function::Underset.new(
|
|
1345
|
-
Math::Symbols::Symbol.new(Constants::HORIZONTAL_BRACKETS[hbrack.to_sym] || hbrack),
|
|
1346
|
-
value,
|
|
1347
|
-
)
|
|
1348
1325
|
else
|
|
1349
|
-
|
|
1350
|
-
Math::
|
|
1351
|
-
|
|
1352
|
-
|
|
1326
|
+
if Constants::UNDER_HORIZONTAL_BRACKETS[hbrack.to_sym] || Constants::UNDER_HORIZONTAL_BRACKETS.key(hbrack)
|
|
1327
|
+
Math::Function::Underset.new(
|
|
1328
|
+
Math::Symbols::Symbol.new(Constants::HORIZONTAL_BRACKETS[hbrack.to_sym] || hbrack),
|
|
1329
|
+
value,
|
|
1330
|
+
)
|
|
1331
|
+
else
|
|
1332
|
+
Math::Function::Overset.new(
|
|
1333
|
+
Math::Symbols::Symbol.new(Constants::HORIZONTAL_BRACKETS[hbrack.to_sym] || hbrack),
|
|
1334
|
+
value,
|
|
1335
|
+
)
|
|
1336
|
+
end
|
|
1353
1337
|
end
|
|
1354
1338
|
end
|
|
1355
1339
|
|
|
1356
1340
|
rule(hbracket_class: simple(:hbrack),
|
|
1357
1341
|
scripted_first_value: simple(:scripted_first_value)) do
|
|
1358
|
-
value = Utility.unfenced_value(scripted_first_value,
|
|
1359
|
-
paren_specific: true)
|
|
1342
|
+
value = Utility.unfenced_value(scripted_first_value, paren_specific: true)
|
|
1360
1343
|
if hbrack == "⏞"
|
|
1361
1344
|
Math::Function::Obrace.new(value)
|
|
1362
1345
|
elsif hbrack == "⏟"
|
|
@@ -1364,51 +1347,53 @@ module Plurimath
|
|
|
1364
1347
|
Math::Function::Underset.new(
|
|
1365
1348
|
value.parameter_two,
|
|
1366
1349
|
Math::Function::Ubrace.new(
|
|
1367
|
-
Utility.unfenced_value(value.parameter_one,
|
|
1368
|
-
|
|
1369
|
-
),
|
|
1350
|
+
Utility.unfenced_value(value.parameter_one, paren_specific: true),
|
|
1351
|
+
)
|
|
1370
1352
|
)
|
|
1371
1353
|
else
|
|
1372
1354
|
Math::Function::Ubrace.new(value)
|
|
1373
1355
|
end
|
|
1374
|
-
elsif Constants::UNDER_HORIZONTAL_BRACKETS[hbrack.to_sym] || Constants::UNDER_HORIZONTAL_BRACKETS.key(hbrack)
|
|
1375
|
-
Math::Function::Underset.new(
|
|
1376
|
-
Math::Symbols::Symbol.new(Constants::HORIZONTAL_BRACKETS[hbrack.to_sym] || hbrack),
|
|
1377
|
-
value,
|
|
1378
|
-
)
|
|
1379
1356
|
else
|
|
1380
|
-
|
|
1381
|
-
Math::
|
|
1382
|
-
|
|
1383
|
-
|
|
1357
|
+
if Constants::UNDER_HORIZONTAL_BRACKETS[hbrack.to_sym] || Constants::UNDER_HORIZONTAL_BRACKETS.key(hbrack)
|
|
1358
|
+
Math::Function::Underset.new(
|
|
1359
|
+
Math::Symbols::Symbol.new(Constants::HORIZONTAL_BRACKETS[hbrack.to_sym] || hbrack),
|
|
1360
|
+
value,
|
|
1361
|
+
)
|
|
1362
|
+
else
|
|
1363
|
+
Math::Function::Overset.new(
|
|
1364
|
+
Math::Symbols::Symbol.new(Constants::HORIZONTAL_BRACKETS[hbrack.to_sym] || hbrack),
|
|
1365
|
+
value,
|
|
1366
|
+
)
|
|
1367
|
+
end
|
|
1384
1368
|
end
|
|
1385
1369
|
end
|
|
1386
1370
|
|
|
1387
1371
|
rule(hbracket_class: simple(:hbrack),
|
|
1388
1372
|
scripted_first_value: sequence(:scripted_first_value)) do
|
|
1389
|
-
value = Utility.unfenced_value(scripted_first_value,
|
|
1390
|
-
paren_specific: true)
|
|
1373
|
+
value = Utility.unfenced_value(scripted_first_value, paren_specific: true)
|
|
1391
1374
|
if hbrack == "⏞"
|
|
1392
1375
|
Math::Function::Obrace.new(value)
|
|
1393
1376
|
elsif hbrack == "⏟"
|
|
1394
1377
|
if value.is_a?(Math::Function::Base) && !value.parameter_one.is_a?(Math::Formula)
|
|
1395
1378
|
Math::Function::Underset.new(
|
|
1396
1379
|
value.parameter_two,
|
|
1397
|
-
Math::Function::Ubrace.new(value.parameter_one)
|
|
1380
|
+
Math::Function::Ubrace.new(value.parameter_one)
|
|
1398
1381
|
)
|
|
1399
1382
|
else
|
|
1400
1383
|
Math::Function::Ubrace.new(value)
|
|
1401
1384
|
end
|
|
1402
|
-
elsif Constants::UNDER_HORIZONTAL_BRACKETS[hbrack.to_sym] || Constants::UNDER_HORIZONTAL_BRACKETS.key(hbrack)
|
|
1403
|
-
Math::Function::Underset.new(
|
|
1404
|
-
Math::Symbols::Symbol.new(Constants::HORIZONTAL_BRACKETS[hbrack.to_sym] || hbrack),
|
|
1405
|
-
value,
|
|
1406
|
-
)
|
|
1407
1385
|
else
|
|
1408
|
-
|
|
1409
|
-
Math::
|
|
1410
|
-
|
|
1411
|
-
|
|
1386
|
+
if Constants::UNDER_HORIZONTAL_BRACKETS[hbrack.to_sym] || Constants::UNDER_HORIZONTAL_BRACKETS.key(hbrack)
|
|
1387
|
+
Math::Function::Underset.new(
|
|
1388
|
+
Math::Symbols::Symbol.new(Constants::HORIZONTAL_BRACKETS[hbrack.to_sym] || hbrack),
|
|
1389
|
+
value,
|
|
1390
|
+
)
|
|
1391
|
+
else
|
|
1392
|
+
Math::Function::Overset.new(
|
|
1393
|
+
Math::Symbols::Symbol.new(Constants::HORIZONTAL_BRACKETS[hbrack.to_sym] || hbrack),
|
|
1394
|
+
value,
|
|
1395
|
+
)
|
|
1396
|
+
end
|
|
1412
1397
|
end
|
|
1413
1398
|
end
|
|
1414
1399
|
|
|
@@ -1431,27 +1416,26 @@ module Plurimath
|
|
|
1431
1416
|
rule(first_value: sequence(:first_value),
|
|
1432
1417
|
overlay_after: simple(:overlay)) do
|
|
1433
1418
|
notation = Constants::OVERLAYS_NOTATIONS[overlay.to_sym]
|
|
1434
|
-
overlay_value = Utility.unfenced_value(first_value.pop,
|
|
1435
|
-
paren_specific: true)
|
|
1419
|
+
overlay_value = Utility.unfenced_value(first_value.pop, paren_specific: true)
|
|
1436
1420
|
overlay_object = if notation == "mover"
|
|
1437
1421
|
Math::Function::Overset.new(
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
)
|
|
1443
|
-
elsif overlay == "̄"
|
|
1444
|
-
Math::Function::Overset.new(
|
|
1445
|
-
Utility.symbols_class(overlay,
|
|
1446
|
-
lang: :unicodemath),
|
|
1447
|
-
overlay_value,
|
|
1448
|
-
{ accent: true },
|
|
1449
|
-
)
|
|
1422
|
+
Utility.symbols_class(overlay, lang: :unicodemath),
|
|
1423
|
+
overlay_value,
|
|
1424
|
+
{ accent: true },
|
|
1425
|
+
)
|
|
1450
1426
|
else
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1427
|
+
if overlay == "̄"
|
|
1428
|
+
Math::Function::Overset.new(
|
|
1429
|
+
Utility.symbols_class(overlay, lang: :unicodemath),
|
|
1430
|
+
overlay_value,
|
|
1431
|
+
{ accent: true },
|
|
1432
|
+
)
|
|
1433
|
+
else
|
|
1434
|
+
Math::Function::Menclose.new(
|
|
1435
|
+
notation,
|
|
1436
|
+
overlay_value
|
|
1437
|
+
)
|
|
1438
|
+
end
|
|
1455
1439
|
end
|
|
1456
1440
|
Math::Formula.new(first_value << overlay_object)
|
|
1457
1441
|
end
|
|
@@ -1459,33 +1443,33 @@ module Plurimath
|
|
|
1459
1443
|
rule(first_value: simple(:first_value),
|
|
1460
1444
|
overlay_after: simple(:overlay)) do
|
|
1461
1445
|
notation = Constants::OVERLAYS_NOTATIONS[overlay.to_sym]
|
|
1462
|
-
overlay_value = Utility.unfenced_value(first_value,
|
|
1463
|
-
paren_specific: true)
|
|
1446
|
+
overlay_value = Utility.unfenced_value(first_value, paren_specific: true)
|
|
1464
1447
|
if notation == "mover"
|
|
1465
1448
|
Math::Function::Overset.new(
|
|
1466
1449
|
Utility.symbols_class(overlay, lang: :unicodemath),
|
|
1467
1450
|
overlay_value,
|
|
1468
1451
|
{ accent: true },
|
|
1469
1452
|
)
|
|
1470
|
-
elsif overlay == "̄"
|
|
1471
|
-
Math::Function::Overset.new(
|
|
1472
|
-
Utility.symbols_class(overlay, lang: :unicodemath),
|
|
1473
|
-
overlay_value,
|
|
1474
|
-
{ accent: true },
|
|
1475
|
-
)
|
|
1476
1453
|
else
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1454
|
+
if overlay == "̄"
|
|
1455
|
+
Math::Function::Overset.new(
|
|
1456
|
+
Utility.symbols_class(overlay, lang: :unicodemath),
|
|
1457
|
+
overlay_value,
|
|
1458
|
+
{ accent: true },
|
|
1459
|
+
)
|
|
1460
|
+
else
|
|
1461
|
+
Math::Function::Menclose.new(
|
|
1462
|
+
notation,
|
|
1463
|
+
overlay_value
|
|
1464
|
+
)
|
|
1465
|
+
end
|
|
1481
1466
|
end
|
|
1482
1467
|
end
|
|
1483
1468
|
|
|
1484
1469
|
rule(overlay_before: simple(:overlay),
|
|
1485
1470
|
first_value: simple(:first_value)) do
|
|
1486
1471
|
notation = Constants::OVERLAYS_NOTATIONS[overlay.to_sym]
|
|
1487
|
-
overlay_value = Utility.unfenced_value(first_value,
|
|
1488
|
-
paren_specific: true)
|
|
1472
|
+
overlay_value = Utility.unfenced_value(first_value, paren_specific: true)
|
|
1489
1473
|
if notation == "mover"
|
|
1490
1474
|
Math::Function::Overset.new(
|
|
1491
1475
|
Utility.symbols_class(overlay, lang: :unicodemath),
|
|
@@ -1495,7 +1479,7 @@ module Plurimath
|
|
|
1495
1479
|
else
|
|
1496
1480
|
Math::Function::Menclose.new(
|
|
1497
1481
|
notation,
|
|
1498
|
-
overlay_value
|
|
1482
|
+
overlay_value
|
|
1499
1483
|
)
|
|
1500
1484
|
end
|
|
1501
1485
|
end
|
|
@@ -1503,8 +1487,7 @@ module Plurimath
|
|
|
1503
1487
|
rule(below_after: simple(:overlay),
|
|
1504
1488
|
first_value: simple(:first_value)) do
|
|
1505
1489
|
notation = Constants::BELOWS_NOTATIONS[overlay.to_sym]
|
|
1506
|
-
overlay_value = Utility.unfenced_value(first_value,
|
|
1507
|
-
paren_specific: true)
|
|
1490
|
+
overlay_value = Utility.unfenced_value(first_value, paren_specific: true)
|
|
1508
1491
|
if notation == "munder"
|
|
1509
1492
|
Math::Function::Underset.new(
|
|
1510
1493
|
Utility.symbols_class(overlay, lang: :unicodemath),
|
|
@@ -1556,13 +1539,14 @@ module Plurimath
|
|
|
1556
1539
|
)
|
|
1557
1540
|
end
|
|
1558
1541
|
|
|
1542
|
+
|
|
1559
1543
|
rule(unary_functions: simple(:unary),
|
|
1560
1544
|
first_value: simple(:first_value)) do
|
|
1561
1545
|
if Constants::UNDEF_UNARY_FUNCTIONS.include?(unary.to_s)
|
|
1562
1546
|
Math::Formula.new([
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1547
|
+
Utility.symbols_class(unary, lang: :unicodemath),
|
|
1548
|
+
first_value,
|
|
1549
|
+
])
|
|
1566
1550
|
elsif unary == "mod"
|
|
1567
1551
|
Math::Function::Mod.new(nil, first_value)
|
|
1568
1552
|
else
|
|
@@ -1661,19 +1645,18 @@ module Plurimath
|
|
|
1661
1645
|
rule(matrixs: simple(:matrixs),
|
|
1662
1646
|
array: sequence(:array)) do
|
|
1663
1647
|
matrix = Constants::MATRIXS.key(matrixs) || matrixs.to_sym
|
|
1664
|
-
|
|
1665
|
-
when :Vmatrix
|
|
1648
|
+
if :Vmatrix == matrix
|
|
1666
1649
|
Utility.get_table_class(matrix).new(
|
|
1667
1650
|
array,
|
|
1668
1651
|
Plurimath::Math::Symbols::Paren::Norm.new,
|
|
1669
1652
|
)
|
|
1670
|
-
|
|
1653
|
+
elsif :Bmatrix == matrix
|
|
1671
1654
|
Utility.get_table_class(matrix).new(
|
|
1672
1655
|
array,
|
|
1673
1656
|
Plurimath::Math::Symbols::Paren::Lcurly.new,
|
|
1674
1657
|
Plurimath::Math::Symbols::Paren::Rcurly.new,
|
|
1675
1658
|
)
|
|
1676
|
-
|
|
1659
|
+
elsif :matrix == matrix
|
|
1677
1660
|
Math::Function::Table.new(array)
|
|
1678
1661
|
else
|
|
1679
1662
|
Utility.get_table_class(matrix).new(array)
|
|
@@ -1683,19 +1666,18 @@ module Plurimath
|
|
|
1683
1666
|
rule(matrixs: simple(:matrixs),
|
|
1684
1667
|
array: simple(:array)) do
|
|
1685
1668
|
matrix = Constants::MATRIXS.key(matrixs) || matrixs.to_sym
|
|
1686
|
-
|
|
1687
|
-
when :Vmatrix
|
|
1669
|
+
if :Vmatrix == matrix
|
|
1688
1670
|
Utility.get_table_class(matrix).new(
|
|
1689
1671
|
[array],
|
|
1690
1672
|
Plurimath::Math::Symbols::Paren::Norm.new,
|
|
1691
1673
|
)
|
|
1692
|
-
|
|
1674
|
+
elsif :Bmatrix == matrix
|
|
1693
1675
|
Utility.get_table_class(matrix).new(
|
|
1694
1676
|
[array],
|
|
1695
1677
|
Plurimath::Math::Symbols::Paren::Lcurly.new,
|
|
1696
1678
|
Plurimath::Math::Symbols::Paren::Rcurly.new,
|
|
1697
1679
|
)
|
|
1698
|
-
|
|
1680
|
+
elsif :matrix == matrix
|
|
1699
1681
|
Math::Function::Table.new([array])
|
|
1700
1682
|
else
|
|
1701
1683
|
Utility.get_table_class(matrix).new([array])
|
|
@@ -1705,25 +1687,24 @@ module Plurimath
|
|
|
1705
1687
|
rule(matrixs: simple(:matrixs),
|
|
1706
1688
|
identity_matrix_number: simple(:number)) do
|
|
1707
1689
|
matrix = Constants::MATRIXS.key(matrixs) || matrixs.to_sym
|
|
1708
|
-
|
|
1709
|
-
when :Vmatrix
|
|
1690
|
+
if :Vmatrix == matrix
|
|
1710
1691
|
Utility.get_table_class(matrix).new(
|
|
1711
1692
|
Utility.identity_matrix(number.to_i),
|
|
1712
1693
|
Plurimath::Math::Symbols::Paren::Norm.new,
|
|
1713
1694
|
)
|
|
1714
|
-
|
|
1695
|
+
elsif :Bmatrix == matrix
|
|
1715
1696
|
Utility.get_table_class(matrix).new(
|
|
1716
1697
|
Utility.identity_matrix(number.to_i),
|
|
1717
1698
|
Plurimath::Math::Symbols::Paren::Lcurly.new,
|
|
1718
1699
|
Plurimath::Math::Symbols::Paren::Rcurly.new,
|
|
1719
1700
|
)
|
|
1720
|
-
|
|
1701
|
+
elsif :matrix == matrix
|
|
1721
1702
|
Math::Function::Table.new(
|
|
1722
|
-
Utility.identity_matrix(number.to_i)
|
|
1703
|
+
Utility.identity_matrix(number.to_i)
|
|
1723
1704
|
)
|
|
1724
1705
|
else
|
|
1725
1706
|
Utility.get_table_class(matrix).new(
|
|
1726
|
-
Utility.identity_matrix(number.to_i)
|
|
1707
|
+
Utility.identity_matrix(number.to_i)
|
|
1727
1708
|
)
|
|
1728
1709
|
end
|
|
1729
1710
|
end
|
|
@@ -1901,7 +1882,7 @@ module Plurimath
|
|
|
1901
1882
|
subsup_exp.parameter_one,
|
|
1902
1883
|
subsup_exp.parameter_two,
|
|
1903
1884
|
subsup_exp.parameter_three,
|
|
1904
|
-
Utility.filter_values(naryand)
|
|
1885
|
+
Utility.filter_values(naryand)
|
|
1905
1886
|
)
|
|
1906
1887
|
end
|
|
1907
1888
|
end
|
|
@@ -1936,7 +1917,7 @@ module Plurimath
|
|
|
1936
1917
|
nary_function = if Constants::NARY_CLASSES.key?(nary_class.to_sym)
|
|
1937
1918
|
nary_class
|
|
1938
1919
|
else
|
|
1939
|
-
Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class
|
|
1920
|
+
(Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class)
|
|
1940
1921
|
end
|
|
1941
1922
|
Utility.get_class(nary_function).new(
|
|
1942
1923
|
Utility.filter_values(sub),
|
|
@@ -1948,7 +1929,7 @@ module Plurimath
|
|
|
1948
1929
|
nary_function = if Constants::NARY_CLASSES.key?(nary_class.to_sym)
|
|
1949
1930
|
nary_class
|
|
1950
1931
|
else
|
|
1951
|
-
Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class
|
|
1932
|
+
(Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class)
|
|
1952
1933
|
end
|
|
1953
1934
|
if Constants::NARY_CLASSES.key?(nary_function.to_sym)
|
|
1954
1935
|
nary_value = if sub.class_name == "underset"
|
|
@@ -1960,7 +1941,7 @@ module Plurimath
|
|
|
1960
1941
|
else
|
|
1961
1942
|
Math::Function::Nary.new(
|
|
1962
1943
|
Utility.symbols_class(nary_function, lang: :unicodemath),
|
|
1963
|
-
Utility.unfenced_value(sub, paren_specific: true)
|
|
1944
|
+
Utility.unfenced_value(sub, paren_specific: true)
|
|
1964
1945
|
)
|
|
1965
1946
|
end
|
|
1966
1947
|
end
|
|
@@ -1970,7 +1951,7 @@ module Plurimath
|
|
|
1970
1951
|
nary_function = if Constants::NARY_CLASSES.key?(nary_class.to_sym)
|
|
1971
1952
|
nary_class
|
|
1972
1953
|
else
|
|
1973
|
-
Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class
|
|
1954
|
+
(Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class)
|
|
1974
1955
|
end
|
|
1975
1956
|
nary_value = if sup.class_name == "overset"
|
|
1976
1957
|
sup.parameter_one
|
|
@@ -1985,7 +1966,7 @@ module Plurimath
|
|
|
1985
1966
|
nary_function = if Constants::NARY_CLASSES.key?(nary_class.to_sym)
|
|
1986
1967
|
nary_class
|
|
1987
1968
|
else
|
|
1988
|
-
Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class
|
|
1969
|
+
(Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class)
|
|
1989
1970
|
end
|
|
1990
1971
|
if Constants::NARY_CLASSES.key?(nary_function.to_sym)
|
|
1991
1972
|
nary_value = if naryand.class_name == "underset"
|
|
@@ -2025,23 +2006,21 @@ module Plurimath
|
|
|
2025
2006
|
rule(paren_close_prefix: simple(:prefix),
|
|
2026
2007
|
open_paren: simple(:paren)) do
|
|
2027
2008
|
[Math::Number.new(""), paren]
|
|
2028
|
-
|
|
2009
|
+
end
|
|
2029
2010
|
|
|
2030
2011
|
rule(paren_open_prefix: simple(:prefix),
|
|
2031
2012
|
close_paren: simple(:paren)) do
|
|
2032
2013
|
[Math::Number.new(""), paren]
|
|
2033
|
-
|
|
2014
|
+
end
|
|
2034
2015
|
|
|
2035
2016
|
rule(open_paren: simple(:open_paren),
|
|
2036
2017
|
close_paren: simple(:close_paren)) do
|
|
2037
2018
|
Math::Function::Fenced.new(
|
|
2038
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
2039
|
-
lang: :unicodemath) : open_paren,
|
|
2019
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
2040
2020
|
[],
|
|
2041
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
2042
|
-
lang: :unicodemath) : close_paren,
|
|
2021
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren
|
|
2043
2022
|
)
|
|
2044
|
-
|
|
2023
|
+
end
|
|
2045
2024
|
|
|
2046
2025
|
rule(factor: simple(:factor),
|
|
2047
2026
|
mini_sup: simple(:mini_sup),
|
|
@@ -2058,14 +2037,14 @@ module Plurimath
|
|
|
2058
2037
|
rule(atom: simple(:atom),
|
|
2059
2038
|
binary_symbols: simple(:symbols),
|
|
2060
2039
|
factor: simple(:factor)) do
|
|
2061
|
-
symbol = Constants::BINARY_SYMBOLS[symbols.to_sym] || symbols
|
|
2040
|
+
symbol = (Constants::BINARY_SYMBOLS[symbols.to_sym] || symbols)
|
|
2062
2041
|
[atom, Utility.symbols_class(symbol, lang: :unicodemath), factor]
|
|
2063
2042
|
end
|
|
2064
2043
|
|
|
2065
2044
|
rule(atom: simple(:atom),
|
|
2066
2045
|
binary_symbols: simple(:symbols),
|
|
2067
2046
|
recursive_numerator: simple(:numerator)) do
|
|
2068
|
-
symbol = Constants::BINARY_SYMBOLS[symbols.to_sym] || symbols
|
|
2047
|
+
symbol = (Constants::BINARY_SYMBOLS[symbols.to_sym] || symbols)
|
|
2069
2048
|
[atom, Utility.symbols_class(symbol, lang: :unicodemath), numerator]
|
|
2070
2049
|
end
|
|
2071
2050
|
|
|
@@ -2142,7 +2121,7 @@ module Plurimath
|
|
|
2142
2121
|
Math::Function::Base.new(
|
|
2143
2122
|
base,
|
|
2144
2123
|
Utility.filter_values(sub),
|
|
2145
|
-
{ size: Constants::SIZE_OVERRIDES_SYMBOLS[size_overrides.to_sym] }
|
|
2124
|
+
{ size: Constants::SIZE_OVERRIDES_SYMBOLS[size_overrides.to_sym] }
|
|
2146
2125
|
)
|
|
2147
2126
|
end
|
|
2148
2127
|
|
|
@@ -2152,7 +2131,7 @@ module Plurimath
|
|
|
2152
2131
|
Math::Function::Base.new(
|
|
2153
2132
|
base,
|
|
2154
2133
|
Utility.unfenced_value(sub, paren_specific: true),
|
|
2155
|
-
{ size: Constants::SIZE_OVERRIDES_SYMBOLS[size_overrides.to_sym] }
|
|
2134
|
+
{ size: Constants::SIZE_OVERRIDES_SYMBOLS[size_overrides.to_sym] }
|
|
2156
2135
|
)
|
|
2157
2136
|
end
|
|
2158
2137
|
|
|
@@ -2203,7 +2182,7 @@ module Plurimath
|
|
|
2203
2182
|
nary_function = if Constants::NARY_CLASSES.key?(nary_class.to_sym)
|
|
2204
2183
|
nary_class
|
|
2205
2184
|
else
|
|
2206
|
-
Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class
|
|
2185
|
+
(Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class)
|
|
2207
2186
|
end
|
|
2208
2187
|
Utility.get_class(nary_function).new(
|
|
2209
2188
|
Utility.filter_values(sub),
|
|
@@ -2229,8 +2208,7 @@ module Plurimath
|
|
|
2229
2208
|
Math::Function::Fenced.new(
|
|
2230
2209
|
Math::Symbols::Paren::Lround.new,
|
|
2231
2210
|
[
|
|
2232
|
-
Utility.fractions(numerator, denominator,
|
|
2233
|
-
{ linethickness: "0", choose: true }),
|
|
2211
|
+
Utility.fractions(numerator, denominator, { linethickness: "0", choose: true }),
|
|
2234
2212
|
],
|
|
2235
2213
|
Math::Symbols::Paren::Rround.new,
|
|
2236
2214
|
)
|
|
@@ -2421,7 +2399,7 @@ module Plurimath
|
|
|
2421
2399
|
rule(base: simple(:base),
|
|
2422
2400
|
sub: sequence(:sub),
|
|
2423
2401
|
sub_recursion: simple(:sub_recursion)) do
|
|
2424
|
-
if Constants::BINARY_FUNCTIONS.include?(base.class_name) && !base.parameter_one
|
|
2402
|
+
if (Constants::BINARY_FUNCTIONS.include?(base.class_name) && !base.parameter_one)
|
|
2425
2403
|
base.parameter_one = sub_value
|
|
2426
2404
|
base
|
|
2427
2405
|
elsif base.is_a?(Math::Function::Power) && Utility.base_is_prime?(base)
|
|
@@ -2454,14 +2432,11 @@ module Plurimath
|
|
|
2454
2432
|
rule(opener: simple(:opener),
|
|
2455
2433
|
operand: simple(:operand),
|
|
2456
2434
|
closer: simple(:closer)) do
|
|
2457
|
-
Utility.unfenced_value(operand, paren_specific: true) if [opener,
|
|
2458
|
-
closer].include?("|")
|
|
2435
|
+
Utility.unfenced_value(operand, paren_specific: true) if [opener, closer].include?("|")
|
|
2459
2436
|
Math::Function::Fenced.new(
|
|
2460
|
-
opener.is_a?(Slice) ? Utility.symbols_class(opener,
|
|
2461
|
-
lang: :unicodemath) : opener,
|
|
2437
|
+
opener.is_a?(Slice) ? Utility.symbols_class(opener, lang: :unicodemath) : opener,
|
|
2462
2438
|
[operand],
|
|
2463
|
-
closer.is_a?(Slice) ? Utility.symbols_class(closer,
|
|
2464
|
-
lang: :unicodemath) : closer,
|
|
2439
|
+
closer.is_a?(Slice) ? Utility.symbols_class(closer, lang: :unicodemath) : closer,
|
|
2465
2440
|
)
|
|
2466
2441
|
end
|
|
2467
2442
|
|
|
@@ -2469,11 +2444,9 @@ module Plurimath
|
|
|
2469
2444
|
operand: sequence(:operand),
|
|
2470
2445
|
closer: simple(:closer)) do
|
|
2471
2446
|
Math::Function::Fenced.new(
|
|
2472
|
-
opener.is_a?(Slice) ? Utility.symbols_class(opener,
|
|
2473
|
-
lang: :unicodemath) : opener,
|
|
2447
|
+
opener.is_a?(Slice) ? Utility.symbols_class(opener, lang: :unicodemath) : opener,
|
|
2474
2448
|
operand,
|
|
2475
|
-
closer.is_a?(Slice) ? Utility.symbols_class(closer,
|
|
2476
|
-
lang: :unicodemath) : closer,
|
|
2449
|
+
closer.is_a?(Slice) ? Utility.symbols_class(closer, lang: :unicodemath) : closer,
|
|
2477
2450
|
)
|
|
2478
2451
|
end
|
|
2479
2452
|
|
|
@@ -2484,18 +2457,13 @@ module Plurimath
|
|
|
2484
2457
|
if opener.first.is_a?(Math::Number)
|
|
2485
2458
|
mask = "#{1.25**opener[0].value.to_i}em"
|
|
2486
2459
|
options[:open_prefixed] = true
|
|
2487
|
-
unless opener.first.value == ""
|
|
2488
|
-
options[:open_paren] =
|
|
2489
|
-
{ minsize: mask, maxsize: mask }
|
|
2490
|
-
end
|
|
2460
|
+
options[:open_paren] = { minsize: mask, maxsize: mask } unless opener.first.value == ""
|
|
2491
2461
|
end
|
|
2492
|
-
Utility.unfenced_value(operand, paren_specific: true) if [opener,
|
|
2493
|
-
closer].include?("|")
|
|
2462
|
+
Utility.unfenced_value(operand, paren_specific: true) if [opener, closer].include?("|")
|
|
2494
2463
|
Math::Function::Fenced.new(
|
|
2495
2464
|
Utility.symbols_class(opener.last, lang: :unicodemath),
|
|
2496
2465
|
[operand],
|
|
2497
|
-
closer.is_a?(Slice) ? Utility.symbols_class(closer,
|
|
2498
|
-
lang: :unicodemath) : closer,
|
|
2466
|
+
closer.is_a?(Slice) ? Utility.symbols_class(closer, lang: :unicodemath) : closer,
|
|
2499
2467
|
options,
|
|
2500
2468
|
)
|
|
2501
2469
|
end
|
|
@@ -2504,11 +2472,9 @@ module Plurimath
|
|
|
2504
2472
|
frac: simple(:frac),
|
|
2505
2473
|
close_paren: simple(:close_paren)) do
|
|
2506
2474
|
Math::Function::Fenced.new(
|
|
2507
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
2508
|
-
lang: :unicodemath) : open_paren,
|
|
2475
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
2509
2476
|
[frac],
|
|
2510
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
2511
|
-
lang: :unicodemath) : close_paren,
|
|
2477
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
2512
2478
|
)
|
|
2513
2479
|
end
|
|
2514
2480
|
|
|
@@ -2516,11 +2482,9 @@ module Plurimath
|
|
|
2516
2482
|
slashed_value: sequence(:values),
|
|
2517
2483
|
close_paren: simple(:close_paren)) do
|
|
2518
2484
|
Math::Function::Fenced.new(
|
|
2519
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
2520
|
-
lang: :unicodemath) : open_paren,
|
|
2485
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
2521
2486
|
Utility.sequence_slashed_values(values, lang: :unicodemath),
|
|
2522
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
2523
|
-
lang: :unicodemath) : close_paren,
|
|
2487
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
2524
2488
|
)
|
|
2525
2489
|
end
|
|
2526
2490
|
|
|
@@ -2528,11 +2492,9 @@ module Plurimath
|
|
|
2528
2492
|
phantom: simple(:phantom),
|
|
2529
2493
|
close_paren: simple(:close_paren)) do
|
|
2530
2494
|
Math::Function::Fenced.new(
|
|
2531
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
2532
|
-
lang: :unicodemath) : open_paren,
|
|
2495
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
2533
2496
|
[phantom],
|
|
2534
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
2535
|
-
lang: :unicodemath) : close_paren,
|
|
2497
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
2536
2498
|
)
|
|
2537
2499
|
end
|
|
2538
2500
|
|
|
@@ -2540,11 +2502,9 @@ module Plurimath
|
|
|
2540
2502
|
unary_function: simple(:unary_function),
|
|
2541
2503
|
close_paren: simple(:close_paren)) do
|
|
2542
2504
|
Math::Function::Fenced.new(
|
|
2543
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
2544
|
-
lang: :unicodemath) : open_paren,
|
|
2505
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
2545
2506
|
[unary_function],
|
|
2546
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
2547
|
-
lang: :unicodemath) : close_paren,
|
|
2507
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
2548
2508
|
)
|
|
2549
2509
|
end
|
|
2550
2510
|
|
|
@@ -2552,11 +2512,9 @@ module Plurimath
|
|
|
2552
2512
|
rect: simple(:rect),
|
|
2553
2513
|
close_paren: simple(:close_paren)) do
|
|
2554
2514
|
Math::Function::Fenced.new(
|
|
2555
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
2556
|
-
lang: :unicodemath) : open_paren,
|
|
2515
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
2557
2516
|
[rect],
|
|
2558
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
2559
|
-
lang: :unicodemath) : close_paren,
|
|
2517
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
2560
2518
|
)
|
|
2561
2519
|
end
|
|
2562
2520
|
|
|
@@ -2564,11 +2522,10 @@ module Plurimath
|
|
|
2564
2522
|
factor: simple(:factor),
|
|
2565
2523
|
paren_close_prefix: simple(:close_prefix)) do
|
|
2566
2524
|
Math::Function::Fenced.new(
|
|
2567
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
2568
|
-
lang: :unicodemath) : open_paren,
|
|
2525
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
2569
2526
|
[factor],
|
|
2570
2527
|
Utility.symbols_class(close_prefix, lang: :unicodemath),
|
|
2571
|
-
{ close_prefixed: true }
|
|
2528
|
+
{ close_prefixed: true }
|
|
2572
2529
|
)
|
|
2573
2530
|
end
|
|
2574
2531
|
|
|
@@ -2578,9 +2535,8 @@ module Plurimath
|
|
|
2578
2535
|
Math::Function::Fenced.new(
|
|
2579
2536
|
Utility.symbols_class(open_paren, lang: :unicodemath),
|
|
2580
2537
|
[factor],
|
|
2581
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
2582
|
-
|
|
2583
|
-
{ open_prefixed: true },
|
|
2538
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
2539
|
+
{ open_prefixed: true }
|
|
2584
2540
|
)
|
|
2585
2541
|
end
|
|
2586
2542
|
|
|
@@ -2588,11 +2544,9 @@ module Plurimath
|
|
|
2588
2544
|
nary: simple(:nary),
|
|
2589
2545
|
close_paren: simple(:close_paren)) do
|
|
2590
2546
|
Math::Function::Fenced.new(
|
|
2591
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
2592
|
-
lang: :unicodemath) : open_paren,
|
|
2547
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
2593
2548
|
[nary],
|
|
2594
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
2595
|
-
lang: :unicodemath) : close_paren,
|
|
2549
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
2596
2550
|
)
|
|
2597
2551
|
end
|
|
2598
2552
|
|
|
@@ -2600,11 +2554,9 @@ module Plurimath
|
|
|
2600
2554
|
sub_exp: simple(:sub_exp),
|
|
2601
2555
|
close_paren: simple(:close_paren)) do
|
|
2602
2556
|
Math::Function::Fenced.new(
|
|
2603
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
2604
|
-
lang: :unicodemath) : open_paren,
|
|
2557
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
2605
2558
|
[sub_exp],
|
|
2606
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
2607
|
-
lang: :unicodemath) : close_paren,
|
|
2559
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
2608
2560
|
)
|
|
2609
2561
|
end
|
|
2610
2562
|
|
|
@@ -2612,11 +2564,9 @@ module Plurimath
|
|
|
2612
2564
|
subsup_exp: simple(:subsup_exp),
|
|
2613
2565
|
close_paren: simple(:close_paren)) do
|
|
2614
2566
|
Math::Function::Fenced.new(
|
|
2615
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
2616
|
-
lang: :unicodemath) : open_paren,
|
|
2567
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
2617
2568
|
[subsup_exp],
|
|
2618
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
2619
|
-
lang: :unicodemath) : close_paren,
|
|
2569
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
2620
2570
|
)
|
|
2621
2571
|
end
|
|
2622
2572
|
|
|
@@ -2624,11 +2574,9 @@ module Plurimath
|
|
|
2624
2574
|
unary_subsup: simple(:subsup),
|
|
2625
2575
|
close_paren: simple(:close_paren)) do
|
|
2626
2576
|
Math::Function::Fenced.new(
|
|
2627
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
2628
|
-
lang: :unicodemath) : open_paren,
|
|
2577
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
2629
2578
|
[subsup],
|
|
2630
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
2631
|
-
lang: :unicodemath) : close_paren,
|
|
2579
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
2632
2580
|
)
|
|
2633
2581
|
end
|
|
2634
2582
|
|
|
@@ -2636,11 +2584,9 @@ module Plurimath
|
|
|
2636
2584
|
mini_sup: simple(:mini_sup),
|
|
2637
2585
|
close_paren: simple(:close_paren)) do
|
|
2638
2586
|
Math::Function::Fenced.new(
|
|
2639
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
2640
|
-
lang: :unicodemath) : open_paren,
|
|
2587
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
2641
2588
|
[mini_sup],
|
|
2642
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
2643
|
-
lang: :unicodemath) : close_paren,
|
|
2589
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
2644
2590
|
)
|
|
2645
2591
|
end
|
|
2646
2592
|
|
|
@@ -2660,30 +2606,20 @@ module Plurimath
|
|
|
2660
2606
|
text: simple(:text),
|
|
2661
2607
|
close_paren: simple(:close_paren)) do
|
|
2662
2608
|
Math::Function::Fenced.new(
|
|
2663
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
2664
|
-
lang: :unicodemath) : open_paren,
|
|
2609
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
2665
2610
|
[Math::Function::Text.new(text)],
|
|
2666
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
2667
|
-
lang: :unicodemath) : close_paren,
|
|
2611
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
2668
2612
|
)
|
|
2669
2613
|
end
|
|
2670
2614
|
|
|
2671
2615
|
rule(open_paren: simple(:open_paren),
|
|
2672
2616
|
factor: simple(:factor),
|
|
2673
2617
|
close_paren: simple(:close_paren)) do
|
|
2674
|
-
new_factor =
|
|
2675
|
-
close_paren].include?("|")
|
|
2676
|
-
Utility.unfenced_value(factor,
|
|
2677
|
-
paren_specific: true)
|
|
2678
|
-
else
|
|
2679
|
-
factor
|
|
2680
|
-
end
|
|
2618
|
+
new_factor = [open_paren, close_paren].include?("|") ? Utility.unfenced_value(factor, paren_specific: true) : factor
|
|
2681
2619
|
Math::Function::Fenced.new(
|
|
2682
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
2683
|
-
lang: :unicodemath) : open_paren,
|
|
2620
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
2684
2621
|
[new_factor],
|
|
2685
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
2686
|
-
lang: :unicodemath) : close_paren,
|
|
2622
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
2687
2623
|
)
|
|
2688
2624
|
end
|
|
2689
2625
|
|
|
@@ -2691,11 +2627,9 @@ module Plurimath
|
|
|
2691
2627
|
sup_exp: simple(:sup_exp),
|
|
2692
2628
|
close_paren: simple(:close_paren)) do
|
|
2693
2629
|
Math::Function::Fenced.new(
|
|
2694
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
2695
|
-
lang: :unicodemath) : open_paren,
|
|
2630
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
2696
2631
|
[sup_exp],
|
|
2697
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
2698
|
-
lang: :unicodemath) : close_paren,
|
|
2632
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
2699
2633
|
)
|
|
2700
2634
|
end
|
|
2701
2635
|
|
|
@@ -2703,11 +2637,9 @@ module Plurimath
|
|
|
2703
2637
|
accents: subtree(:accents),
|
|
2704
2638
|
close_paren: simple(:close_paren)) do
|
|
2705
2639
|
Math::Function::Fenced.new(
|
|
2706
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
2707
|
-
lang: :unicodemath) : open_paren,
|
|
2640
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
2708
2641
|
[Utility.unicode_accents(accents)],
|
|
2709
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
2710
|
-
lang: :unicodemath) : close_paren,
|
|
2642
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
2711
2643
|
)
|
|
2712
2644
|
end
|
|
2713
2645
|
|
|
@@ -2718,24 +2650,14 @@ module Plurimath
|
|
|
2718
2650
|
if open_paren.first.is_a?(Math::Number)
|
|
2719
2651
|
mask = "#{1.25**open_paren.first.value.to_i}em"
|
|
2720
2652
|
options[:open_prefixed] = true
|
|
2721
|
-
unless open_paren.first.value == ""
|
|
2722
|
-
options[:open_paren] =
|
|
2723
|
-
{ minsize: mask, maxsize: mask }
|
|
2724
|
-
end
|
|
2653
|
+
options[:open_paren] = { minsize: mask, maxsize: mask } unless open_paren.first.value == ""
|
|
2725
2654
|
end
|
|
2726
|
-
new_factor =
|
|
2727
|
-
close_paren].include?("|")
|
|
2728
|
-
Utility.unfenced_value(factor,
|
|
2729
|
-
paren_specific: true)
|
|
2730
|
-
else
|
|
2731
|
-
factor
|
|
2732
|
-
end
|
|
2655
|
+
new_factor = [open_paren, close_paren].include?("|") ? Utility.unfenced_value(factor, paren_specific: true) : factor
|
|
2733
2656
|
Math::Function::Fenced.new(
|
|
2734
2657
|
Utility.symbols_class(open_paren.last, lang: :unicodemath),
|
|
2735
2658
|
[new_factor],
|
|
2736
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
2737
|
-
|
|
2738
|
-
options,
|
|
2659
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
2660
|
+
options
|
|
2739
2661
|
)
|
|
2740
2662
|
end
|
|
2741
2663
|
|
|
@@ -2746,16 +2668,13 @@ module Plurimath
|
|
|
2746
2668
|
if open_paren.first.is_a?(Math::Number)
|
|
2747
2669
|
mask = "#{1.25**open_paren.first.value.to_i}em"
|
|
2748
2670
|
options[:open_prefixed] = true
|
|
2749
|
-
unless open_paren.first.value == ""
|
|
2750
|
-
options[:open_paren] =
|
|
2751
|
-
{ minsize: mask, maxsize: mask }
|
|
2752
|
-
end
|
|
2671
|
+
options[:open_paren] = { minsize: mask, maxsize: mask } unless open_paren.first.value == ""
|
|
2753
2672
|
end
|
|
2754
2673
|
Math::Function::Fenced.new(
|
|
2755
2674
|
Utility.symbols_class(open_paren.last, lang: :unicodemath),
|
|
2756
2675
|
[factor],
|
|
2757
2676
|
Utility.symbols_class(close_prefix, lang: :unicodemath),
|
|
2758
|
-
options
|
|
2677
|
+
options
|
|
2759
2678
|
)
|
|
2760
2679
|
end
|
|
2761
2680
|
|
|
@@ -2766,25 +2685,18 @@ module Plurimath
|
|
|
2766
2685
|
if open_paren.first.is_a?(Math::Number)
|
|
2767
2686
|
mask = "#{1.25**open_paren.first.value.to_i}em"
|
|
2768
2687
|
options[:open_prefixed] = true
|
|
2769
|
-
unless open_paren.first.value == ""
|
|
2770
|
-
options[:open_paren] =
|
|
2771
|
-
{ minsize: mask, maxsize: mask }
|
|
2772
|
-
end
|
|
2688
|
+
options[:open_paren] = { minsize: mask, maxsize: mask } unless open_paren.first.value == ""
|
|
2773
2689
|
end
|
|
2774
2690
|
if close_paren.first.is_a?(Math::Number)
|
|
2775
2691
|
mask = "#{1.25**close_paren.first.value.to_i}em"
|
|
2776
2692
|
options[:close_prefixed] = true
|
|
2777
|
-
unless close_paren.first.value == ""
|
|
2778
|
-
options[:close_paren] =
|
|
2779
|
-
{ minsize: mask,
|
|
2780
|
-
maxsize: mask }
|
|
2781
|
-
end
|
|
2693
|
+
options[:close_paren] = { minsize: mask, maxsize: mask } unless close_paren.first.value == ""
|
|
2782
2694
|
end
|
|
2783
2695
|
Math::Function::Fenced.new(
|
|
2784
2696
|
Utility.symbols_class(open_paren.last, lang: :unicodemath),
|
|
2785
2697
|
[frac],
|
|
2786
2698
|
Utility.symbols_class(close_paren.last, lang: :unicodemath),
|
|
2787
|
-
options
|
|
2699
|
+
options
|
|
2788
2700
|
)
|
|
2789
2701
|
end
|
|
2790
2702
|
|
|
@@ -2795,18 +2707,13 @@ module Plurimath
|
|
|
2795
2707
|
if close_paren.first.is_a?(Math::Number)
|
|
2796
2708
|
mask = "#{1.25**close_paren.first.value.to_i}em"
|
|
2797
2709
|
options[:close_prefixed] = true
|
|
2798
|
-
unless close_paren.first.value == ""
|
|
2799
|
-
options[:close_paren] =
|
|
2800
|
-
{ minsize: mask,
|
|
2801
|
-
maxsize: mask }
|
|
2802
|
-
end
|
|
2710
|
+
options[:close_paren] = { minsize: mask, maxsize: mask } unless close_paren.first.value == ""
|
|
2803
2711
|
end
|
|
2804
2712
|
Math::Function::Fenced.new(
|
|
2805
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
2806
|
-
lang: :unicodemath) : open_paren,
|
|
2713
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
2807
2714
|
[frac],
|
|
2808
2715
|
Utility.symbols_class(close_paren.last, lang: :unicodemath),
|
|
2809
|
-
options
|
|
2716
|
+
options
|
|
2810
2717
|
)
|
|
2811
2718
|
end
|
|
2812
2719
|
|
|
@@ -2817,25 +2724,18 @@ module Plurimath
|
|
|
2817
2724
|
if open_paren.first.is_a?(Math::Number)
|
|
2818
2725
|
mask = "#{1.25**open_paren.first.value.to_i}em"
|
|
2819
2726
|
options[:open_prefixed] = true
|
|
2820
|
-
unless open_paren.first.value == ""
|
|
2821
|
-
options[:open_paren] =
|
|
2822
|
-
{ minsize: mask, maxsize: mask }
|
|
2823
|
-
end
|
|
2727
|
+
options[:open_paren] = { minsize: mask, maxsize: mask } unless open_paren.first.value == ""
|
|
2824
2728
|
end
|
|
2825
2729
|
if close_paren.first.is_a?(Math::Number)
|
|
2826
2730
|
mask = "#{1.25**close_paren.first.value.to_i}em"
|
|
2827
2731
|
options[:close_prefixed] = true
|
|
2828
|
-
unless close_paren.first.value == ""
|
|
2829
|
-
options[:close_paren] =
|
|
2830
|
-
{ minsize: mask,
|
|
2831
|
-
maxsize: mask }
|
|
2832
|
-
end
|
|
2732
|
+
options[:close_paren] = { minsize: mask, maxsize: mask } unless close_paren.first.value == ""
|
|
2833
2733
|
end
|
|
2834
2734
|
Math::Function::Fenced.new(
|
|
2835
2735
|
Utility.symbols_class(open_paren.last, lang: :unicodemath),
|
|
2836
2736
|
[factor],
|
|
2837
2737
|
Utility.symbols_class(close_paren.last, lang: :unicodemath),
|
|
2838
|
-
options
|
|
2738
|
+
options
|
|
2839
2739
|
)
|
|
2840
2740
|
end
|
|
2841
2741
|
|
|
@@ -2843,38 +2743,31 @@ module Plurimath
|
|
|
2843
2743
|
negated_operator: simple(:operator),
|
|
2844
2744
|
close_paren: simple(:close_paren)) do
|
|
2845
2745
|
Math::Function::Fenced.new(
|
|
2846
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
2847
|
-
lang: :unicodemath) : open_paren,
|
|
2746
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
2848
2747
|
[
|
|
2849
2748
|
Math::Formula.new([
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
]),
|
|
2749
|
+
Utility.symbols_class(operator, lang: :unicodemath),
|
|
2750
|
+
Math::Symbols::Symbol.new("̸"),
|
|
2751
|
+
])
|
|
2854
2752
|
],
|
|
2855
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
2856
|
-
lang: :unicodemath) : close_paren,
|
|
2753
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
2857
2754
|
)
|
|
2858
2755
|
end
|
|
2859
2756
|
|
|
2860
2757
|
rule(open_paren: simple(:open_paren),
|
|
2861
2758
|
table: simple(:table),
|
|
2862
2759
|
paren_close_prefix: simple(:close_paren)) do
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
lang: :unicodemath)
|
|
2867
|
-
table
|
|
2760
|
+
table.open_paren = Utility.symbols_class(open_paren, lang: :unicodemath)
|
|
2761
|
+
table.close_paren = Utility.symbols_class(close_paren, lang: :unicodemath)
|
|
2762
|
+
table
|
|
2868
2763
|
end
|
|
2869
2764
|
|
|
2870
2765
|
rule(open_paren: simple(:open_paren),
|
|
2871
2766
|
table: simple(:table),
|
|
2872
2767
|
close_paren: simple(:close_paren)) do
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
lang: :unicodemath)
|
|
2877
|
-
table
|
|
2768
|
+
table.open_paren = Utility.symbols_class(open_paren, lang: :unicodemath)
|
|
2769
|
+
table.close_paren = Utility.symbols_class(close_paren, lang: :unicodemath)
|
|
2770
|
+
table
|
|
2878
2771
|
end
|
|
2879
2772
|
|
|
2880
2773
|
rule(intermediate_exp: simple(:intermediate_exp),
|
|
@@ -2912,23 +2805,11 @@ module Plurimath
|
|
|
2912
2805
|
nary_function = if Constants::NARY_CLASSES.key?(nary_class.to_sym)
|
|
2913
2806
|
nary_class
|
|
2914
2807
|
else
|
|
2915
|
-
Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class
|
|
2808
|
+
(Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class)
|
|
2916
2809
|
end
|
|
2917
2810
|
if Constants::NARY_CLASSES.key?(nary_function.to_sym)
|
|
2918
|
-
new_sub = (
|
|
2919
|
-
|
|
2920
|
-
else
|
|
2921
|
-
Utility.unfenced_value(
|
|
2922
|
-
sub, paren_specific: true
|
|
2923
|
-
)
|
|
2924
|
-
end)
|
|
2925
|
-
new_sup = (if sup.class_name == "overset"
|
|
2926
|
-
sup.parameter_one
|
|
2927
|
-
else
|
|
2928
|
-
Utility.unfenced_value(
|
|
2929
|
-
sup, paren_specific: true
|
|
2930
|
-
)
|
|
2931
|
-
end)
|
|
2811
|
+
new_sub = (sub.class_name == "underset" ? sub.parameter_one : Utility.unfenced_value(sub, paren_specific: true))
|
|
2812
|
+
new_sup = (sup.class_name == "overset" ? sup.parameter_one : Utility.unfenced_value(sup, paren_specific: true))
|
|
2932
2813
|
Utility.get_class(nary_function).new(new_sub, new_sup)
|
|
2933
2814
|
else
|
|
2934
2815
|
Math::Function::Nary.new(
|
|
@@ -2945,7 +2826,7 @@ module Plurimath
|
|
|
2945
2826
|
nary_function = if Constants::NARY_CLASSES.key?(nary_class.to_sym)
|
|
2946
2827
|
nary_class
|
|
2947
2828
|
else
|
|
2948
|
-
Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class
|
|
2829
|
+
(Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class)
|
|
2949
2830
|
end
|
|
2950
2831
|
Utility.get_class(nary_function).new(
|
|
2951
2832
|
Utility.unfenced_value(sub, paren_specific: true),
|
|
@@ -2959,15 +2840,9 @@ module Plurimath
|
|
|
2959
2840
|
nary_function = if Constants::NARY_CLASSES.key?(nary_class.to_sym)
|
|
2960
2841
|
nary_class
|
|
2961
2842
|
else
|
|
2962
|
-
Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class
|
|
2843
|
+
(Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class)
|
|
2963
2844
|
end
|
|
2964
|
-
sub_value =
|
|
2965
|
-
sub.parameter_one
|
|
2966
|
-
else
|
|
2967
|
-
Utility.unfenced_value(
|
|
2968
|
-
sub, paren_specific: true
|
|
2969
|
-
)
|
|
2970
|
-
end
|
|
2845
|
+
sub_value = sub.is_a?(Math::Function::Underset) ? sub.parameter_one : Utility.unfenced_value(sub, paren_specific: true)
|
|
2971
2846
|
Utility.get_class(nary_function).new(
|
|
2972
2847
|
sub_value,
|
|
2973
2848
|
Utility.unfenced_value(sup, paren_specific: true),
|
|
@@ -2980,22 +2855,16 @@ module Plurimath
|
|
|
2980
2855
|
nary_function = if Constants::NARY_CLASSES.key?(nary_class.to_sym)
|
|
2981
2856
|
nary_class
|
|
2982
2857
|
else
|
|
2983
|
-
Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class
|
|
2858
|
+
(Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class)
|
|
2984
2859
|
end
|
|
2985
|
-
sub_value =
|
|
2986
|
-
sub.parameter_one
|
|
2987
|
-
else
|
|
2988
|
-
Utility.unfenced_value(
|
|
2989
|
-
sub, paren_specific: true
|
|
2990
|
-
)
|
|
2991
|
-
end
|
|
2860
|
+
sub_value = sub.is_a?(Math::Function::Underset) ? sub.parameter_one : Utility.unfenced_value(sub, paren_specific: true)
|
|
2992
2861
|
options = { mask: mask.value }
|
|
2993
2862
|
if Constants::NARY_CLASSES.key?(nary_function.to_sym)
|
|
2994
2863
|
Utility.get_class(nary_function).new(
|
|
2995
2864
|
sub_value,
|
|
2996
2865
|
nil,
|
|
2997
2866
|
nil,
|
|
2998
|
-
options
|
|
2867
|
+
options
|
|
2999
2868
|
)
|
|
3000
2869
|
else
|
|
3001
2870
|
Math::Function::Nary.new(
|
|
@@ -3003,7 +2872,7 @@ module Plurimath
|
|
|
3003
2872
|
sub_value,
|
|
3004
2873
|
nil,
|
|
3005
2874
|
nil,
|
|
3006
|
-
options
|
|
2875
|
+
options
|
|
3007
2876
|
)
|
|
3008
2877
|
end
|
|
3009
2878
|
end
|
|
@@ -3014,7 +2883,7 @@ module Plurimath
|
|
|
3014
2883
|
nary_function = if Constants::NARY_CLASSES.key?(nary_class.to_sym)
|
|
3015
2884
|
nary_class
|
|
3016
2885
|
else
|
|
3017
|
-
Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class
|
|
2886
|
+
(Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class)
|
|
3018
2887
|
end
|
|
3019
2888
|
options = { mask: mask.value }
|
|
3020
2889
|
if Constants::NARY_CLASSES.key?(nary_function.to_sym)
|
|
@@ -3022,7 +2891,7 @@ module Plurimath
|
|
|
3022
2891
|
Utility.unfenced_value(sub, paren_specific: true),
|
|
3023
2892
|
nil,
|
|
3024
2893
|
nil,
|
|
3025
|
-
options
|
|
2894
|
+
options
|
|
3026
2895
|
)
|
|
3027
2896
|
else
|
|
3028
2897
|
Math::Function::Nary.new(
|
|
@@ -3030,7 +2899,7 @@ module Plurimath
|
|
|
3030
2899
|
Utility.unfenced_value(sub, paren_specific: true),
|
|
3031
2900
|
nil,
|
|
3032
2901
|
nil,
|
|
3033
|
-
options
|
|
2902
|
+
options
|
|
3034
2903
|
)
|
|
3035
2904
|
end
|
|
3036
2905
|
end
|
|
@@ -3041,7 +2910,7 @@ module Plurimath
|
|
|
3041
2910
|
nary_function = if Constants::NARY_CLASSES.key?(nary_class.to_sym)
|
|
3042
2911
|
nary_class
|
|
3043
2912
|
else
|
|
3044
|
-
Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class
|
|
2913
|
+
(Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class)
|
|
3045
2914
|
end
|
|
3046
2915
|
options = { mask: mask.value }
|
|
3047
2916
|
if Constants::NARY_CLASSES.key?(nary_function.to_sym)
|
|
@@ -3049,7 +2918,7 @@ module Plurimath
|
|
|
3049
2918
|
nil,
|
|
3050
2919
|
Utility.unfenced_value(sup, paren_specific: true),
|
|
3051
2920
|
nil,
|
|
3052
|
-
options
|
|
2921
|
+
options
|
|
3053
2922
|
)
|
|
3054
2923
|
else
|
|
3055
2924
|
Math::Function::Nary.new(
|
|
@@ -3057,7 +2926,7 @@ module Plurimath
|
|
|
3057
2926
|
nil,
|
|
3058
2927
|
Utility.unfenced_value(sup, paren_specific: true),
|
|
3059
2928
|
nil,
|
|
3060
|
-
options
|
|
2929
|
+
options
|
|
3061
2930
|
)
|
|
3062
2931
|
end
|
|
3063
2932
|
end
|
|
@@ -3111,11 +2980,9 @@ module Plurimath
|
|
|
3111
2980
|
pre_script: simple(:pre_script),
|
|
3112
2981
|
close_paren: simple(:close_paren)) do
|
|
3113
2982
|
Math::Function::Fenced.new(
|
|
3114
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3115
|
-
lang: :unicodemath) : open_paren,
|
|
2983
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3116
2984
|
[pre_script],
|
|
3117
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3118
|
-
lang: :unicodemath) : close_paren,
|
|
2985
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3119
2986
|
)
|
|
3120
2987
|
end
|
|
3121
2988
|
|
|
@@ -3126,14 +2993,14 @@ module Plurimath
|
|
|
3126
2993
|
nary_function = if Constants::NARY_CLASSES.key?(nary_class.to_sym)
|
|
3127
2994
|
nary_class
|
|
3128
2995
|
else
|
|
3129
|
-
Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class
|
|
2996
|
+
(Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class)
|
|
3130
2997
|
end
|
|
3131
2998
|
options = { mask: mask.value }
|
|
3132
2999
|
if Constants::NARY_CLASSES.key?(nary_function&.to_sym)
|
|
3133
3000
|
Utility.get_class(nary_function).new(
|
|
3134
3001
|
Utility.filter_values(sub),
|
|
3135
3002
|
Utility.filter_values(sup),
|
|
3136
|
-
options
|
|
3003
|
+
options
|
|
3137
3004
|
)
|
|
3138
3005
|
else
|
|
3139
3006
|
Math::Function::Nary.new(
|
|
@@ -3141,7 +3008,7 @@ module Plurimath
|
|
|
3141
3008
|
Utility.filter_values(sub),
|
|
3142
3009
|
Utility.filter_values(sup),
|
|
3143
3010
|
nil,
|
|
3144
|
-
options
|
|
3011
|
+
options
|
|
3145
3012
|
)
|
|
3146
3013
|
end
|
|
3147
3014
|
end
|
|
@@ -3153,14 +3020,14 @@ module Plurimath
|
|
|
3153
3020
|
nary_function = if Constants::NARY_CLASSES.key?(nary_class.to_sym)
|
|
3154
3021
|
nary_class
|
|
3155
3022
|
else
|
|
3156
|
-
Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class
|
|
3023
|
+
(Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class)
|
|
3157
3024
|
end
|
|
3158
3025
|
options = { mask: mask.value }
|
|
3159
3026
|
if Constants::NARY_CLASSES.key?(nary_function&.to_sym)
|
|
3160
3027
|
Utility.get_class(nary_function).new(
|
|
3161
3028
|
Utility.unfenced_value(sub, paren_specific: true),
|
|
3162
3029
|
Utility.filter_values(sup),
|
|
3163
|
-
options
|
|
3030
|
+
options
|
|
3164
3031
|
)
|
|
3165
3032
|
else
|
|
3166
3033
|
Math::Function::Nary.new(
|
|
@@ -3168,7 +3035,7 @@ module Plurimath
|
|
|
3168
3035
|
Utility.unfenced_value(sub, paren_specific: true),
|
|
3169
3036
|
Utility.filter_values(sup),
|
|
3170
3037
|
nil,
|
|
3171
|
-
options
|
|
3038
|
+
options
|
|
3172
3039
|
)
|
|
3173
3040
|
end
|
|
3174
3041
|
end
|
|
@@ -3180,14 +3047,14 @@ module Plurimath
|
|
|
3180
3047
|
nary_function = if Constants::NARY_CLASSES.key?(nary_class.to_sym)
|
|
3181
3048
|
nary_class
|
|
3182
3049
|
else
|
|
3183
|
-
Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class
|
|
3050
|
+
(Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class)
|
|
3184
3051
|
end
|
|
3185
3052
|
options = { mask: mask.value }
|
|
3186
3053
|
if Constants::NARY_CLASSES.key?(nary_function&.to_sym)
|
|
3187
3054
|
Utility.get_class(nary_function).new(
|
|
3188
3055
|
Utility.filter_values(sub),
|
|
3189
3056
|
Utility.unfenced_value(sup, paren_specific: true),
|
|
3190
|
-
options
|
|
3057
|
+
options
|
|
3191
3058
|
)
|
|
3192
3059
|
else
|
|
3193
3060
|
Math::Function::Nary.new(
|
|
@@ -3195,7 +3062,7 @@ module Plurimath
|
|
|
3195
3062
|
Utility.filter_values(sub),
|
|
3196
3063
|
Utility.unfenced_value(sup, paren_specific: true),
|
|
3197
3064
|
nil,
|
|
3198
|
-
options
|
|
3065
|
+
options
|
|
3199
3066
|
)
|
|
3200
3067
|
end
|
|
3201
3068
|
end
|
|
@@ -3219,25 +3086,18 @@ module Plurimath
|
|
|
3219
3086
|
if open_paren.first.is_a?(Math::Number)
|
|
3220
3087
|
mask = "#{1.25**open_paren.first.value.to_i}em"
|
|
3221
3088
|
options[:open_prefixed] = true
|
|
3222
|
-
unless open_paren.first.value == ""
|
|
3223
|
-
options[:open_paren] =
|
|
3224
|
-
{ minsize: mask, maxsize: mask }
|
|
3225
|
-
end
|
|
3089
|
+
options[:open_paren] = { minsize: mask, maxsize: mask } unless open_paren.first.value == ""
|
|
3226
3090
|
end
|
|
3227
3091
|
if close_paren.first.is_a?(Math::Number)
|
|
3228
3092
|
mask = "#{1.25**close_paren.first.value.to_i}em"
|
|
3229
3093
|
options[:close_prefixed] = true
|
|
3230
|
-
unless close_paren.first.value == ""
|
|
3231
|
-
options[:close_paren] =
|
|
3232
|
-
{ minsize: mask,
|
|
3233
|
-
maxsize: mask }
|
|
3234
|
-
end
|
|
3094
|
+
options[:close_paren] = { minsize: mask, maxsize: mask } unless close_paren.first.value == ""
|
|
3235
3095
|
end
|
|
3236
3096
|
Math::Function::Fenced.new(
|
|
3237
3097
|
Utility.symbols_class(open_paren.last, lang: :unicodemath),
|
|
3238
|
-
[factor] + exp,
|
|
3098
|
+
([factor] + exp),
|
|
3239
3099
|
Utility.symbols_class(close_paren.last, lang: :unicodemath),
|
|
3240
|
-
options
|
|
3100
|
+
options
|
|
3241
3101
|
)
|
|
3242
3102
|
end
|
|
3243
3103
|
|
|
@@ -3246,11 +3106,9 @@ module Plurimath
|
|
|
3246
3106
|
exp: sequence(:exp),
|
|
3247
3107
|
close_paren: simple(:close_paren)) do
|
|
3248
3108
|
Math::Function::Fenced.new(
|
|
3249
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3253
|
-
lang: :unicodemath) : close_paren,
|
|
3109
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3110
|
+
([unary] + exp),
|
|
3111
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3254
3112
|
)
|
|
3255
3113
|
end
|
|
3256
3114
|
|
|
@@ -3258,19 +3116,11 @@ module Plurimath
|
|
|
3258
3116
|
factor: simple(:factor),
|
|
3259
3117
|
close_paren: simple(:close_paren),
|
|
3260
3118
|
naryand_recursion: sequence(:naryand_recursion)) do
|
|
3261
|
-
new_factor =
|
|
3262
|
-
close_paren].include?("|")
|
|
3263
|
-
Utility.unfenced_value(factor,
|
|
3264
|
-
paren_specific: true)
|
|
3265
|
-
else
|
|
3266
|
-
factor
|
|
3267
|
-
end
|
|
3119
|
+
new_factor = [open_paren, close_paren].include?("|") ? Utility.unfenced_value(factor, paren_specific: true) : factor
|
|
3268
3120
|
fenced = Math::Function::Fenced.new(
|
|
3269
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3270
|
-
lang: :unicodemath) : open_paren,
|
|
3121
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3271
3122
|
[new_factor],
|
|
3272
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3273
|
-
lang: :unicodemath) : close_paren,
|
|
3123
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3274
3124
|
)
|
|
3275
3125
|
[fenced] + naryand_recursion
|
|
3276
3126
|
end
|
|
@@ -3280,11 +3130,9 @@ module Plurimath
|
|
|
3280
3130
|
exp: simple(:exp),
|
|
3281
3131
|
close_paren: simple(:close_paren)) do
|
|
3282
3132
|
Math::Function::Fenced.new(
|
|
3283
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3284
|
-
lang: :unicodemath) : open_paren,
|
|
3133
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3285
3134
|
[unary_subsup, exp],
|
|
3286
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3287
|
-
lang: :unicodemath) : close_paren,
|
|
3135
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3288
3136
|
)
|
|
3289
3137
|
end
|
|
3290
3138
|
|
|
@@ -3292,19 +3140,11 @@ module Plurimath
|
|
|
3292
3140
|
factor: simple(:factor),
|
|
3293
3141
|
close_paren: simple(:close_paren),
|
|
3294
3142
|
naryand_recursion: simple(:naryand_recursion)) do
|
|
3295
|
-
new_factor =
|
|
3296
|
-
close_paren].include?("|")
|
|
3297
|
-
Utility.unfenced_value(factor,
|
|
3298
|
-
paren_specific: true)
|
|
3299
|
-
else
|
|
3300
|
-
factor
|
|
3301
|
-
end
|
|
3143
|
+
new_factor = [open_paren, close_paren].include?("|") ? Utility.unfenced_value(factor, paren_specific: true) : factor
|
|
3302
3144
|
fenced = Math::Function::Fenced.new(
|
|
3303
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3304
|
-
lang: :unicodemath) : open_paren,
|
|
3145
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3305
3146
|
[new_factor],
|
|
3306
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3307
|
-
lang: :unicodemath) : close_paren,
|
|
3147
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3308
3148
|
)
|
|
3309
3149
|
[fenced, naryand_recursion]
|
|
3310
3150
|
end
|
|
@@ -3314,11 +3154,9 @@ module Plurimath
|
|
|
3314
3154
|
expr: sequence(:expr),
|
|
3315
3155
|
close_paren: simple(:close_paren)) do
|
|
3316
3156
|
Math::Function::Fenced.new(
|
|
3317
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3321
|
-
lang: :unicodemath) : close_paren,
|
|
3157
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3158
|
+
([mini_sub] + expr),
|
|
3159
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3322
3160
|
)
|
|
3323
3161
|
end
|
|
3324
3162
|
|
|
@@ -3327,11 +3165,9 @@ module Plurimath
|
|
|
3327
3165
|
exp: sequence(:exp),
|
|
3328
3166
|
close_paren: simple(:close_paren)) do
|
|
3329
3167
|
Math::Function::Fenced.new(
|
|
3330
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3334
|
-
lang: :unicodemath) : close_paren,
|
|
3168
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3169
|
+
([mini_sub] + exp),
|
|
3170
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3335
3171
|
)
|
|
3336
3172
|
end
|
|
3337
3173
|
|
|
@@ -3340,11 +3176,9 @@ module Plurimath
|
|
|
3340
3176
|
exp: sequence(:exp),
|
|
3341
3177
|
close_paren: simple(:close_paren)) do
|
|
3342
3178
|
Math::Function::Fenced.new(
|
|
3343
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3347
|
-
lang: :unicodemath) : close_paren,
|
|
3179
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3180
|
+
([mini_sub_sup] + exp),
|
|
3181
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3348
3182
|
)
|
|
3349
3183
|
end
|
|
3350
3184
|
|
|
@@ -3353,11 +3187,9 @@ module Plurimath
|
|
|
3353
3187
|
expr: sequence(:expr),
|
|
3354
3188
|
close_paren: simple(:close_paren)) do
|
|
3355
3189
|
Math::Function::Fenced.new(
|
|
3356
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3360
|
-
lang: :unicodemath) : close_paren,
|
|
3190
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3191
|
+
([mini_sup] + expr),
|
|
3192
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3361
3193
|
)
|
|
3362
3194
|
end
|
|
3363
3195
|
|
|
@@ -3366,11 +3198,9 @@ module Plurimath
|
|
|
3366
3198
|
exp: sequence(:exp),
|
|
3367
3199
|
close_paren: simple(:close_paren)) do
|
|
3368
3200
|
Math::Function::Fenced.new(
|
|
3369
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3373
|
-
lang: :unicodemath) : close_paren,
|
|
3201
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3202
|
+
([mini_sup] + exp),
|
|
3203
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3374
3204
|
)
|
|
3375
3205
|
end
|
|
3376
3206
|
|
|
@@ -3379,11 +3209,9 @@ module Plurimath
|
|
|
3379
3209
|
expr: sequence(:expr),
|
|
3380
3210
|
close_paren: simple(:close_paren)) do
|
|
3381
3211
|
Math::Function::Fenced.new(
|
|
3382
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3386
|
-
lang: :unicodemath) : close_paren,
|
|
3212
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3213
|
+
([intermediate_exp] + expr),
|
|
3214
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3387
3215
|
)
|
|
3388
3216
|
end
|
|
3389
3217
|
|
|
@@ -3392,11 +3220,9 @@ module Plurimath
|
|
|
3392
3220
|
expr: simple(:expr),
|
|
3393
3221
|
close_paren: simple(:close_paren)) do
|
|
3394
3222
|
Math::Function::Fenced.new(
|
|
3395
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3396
|
-
lang: :unicodemath) : open_paren,
|
|
3223
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3397
3224
|
[factor, expr],
|
|
3398
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3399
|
-
lang: :unicodemath) : close_paren,
|
|
3225
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3400
3226
|
)
|
|
3401
3227
|
end
|
|
3402
3228
|
|
|
@@ -3405,11 +3231,9 @@ module Plurimath
|
|
|
3405
3231
|
exp: simple(:exp),
|
|
3406
3232
|
close_paren: simple(:close_paren)) do
|
|
3407
3233
|
Math::Function::Fenced.new(
|
|
3408
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3409
|
-
lang: :unicodemath) : open_paren,
|
|
3234
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3410
3235
|
[factor, exp],
|
|
3411
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3412
|
-
lang: :unicodemath) : close_paren,
|
|
3236
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3413
3237
|
)
|
|
3414
3238
|
end
|
|
3415
3239
|
|
|
@@ -3418,11 +3242,9 @@ module Plurimath
|
|
|
3418
3242
|
expr: sequence(:expr),
|
|
3419
3243
|
close_paren: simple(:close_paren)) do
|
|
3420
3244
|
Math::Function::Fenced.new(
|
|
3421
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3425
|
-
lang: :unicodemath) : close_paren,
|
|
3245
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3246
|
+
([Utility.unicode_accents(accent)] + expr),
|
|
3247
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3426
3248
|
)
|
|
3427
3249
|
end
|
|
3428
3250
|
|
|
@@ -3431,11 +3253,9 @@ module Plurimath
|
|
|
3431
3253
|
exp: sequence(:exp),
|
|
3432
3254
|
close_paren: simple(:close_paren)) do
|
|
3433
3255
|
Math::Function::Fenced.new(
|
|
3434
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3438
|
-
lang: :unicodemath) : close_paren,
|
|
3256
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3257
|
+
([Utility.unicode_accents(accent)] + exp),
|
|
3258
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3439
3259
|
)
|
|
3440
3260
|
end
|
|
3441
3261
|
|
|
@@ -3444,11 +3264,9 @@ module Plurimath
|
|
|
3444
3264
|
expr: sequence(:expr),
|
|
3445
3265
|
close_paren: simple(:close_paren)) do
|
|
3446
3266
|
Math::Function::Fenced.new(
|
|
3447
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3451
|
-
lang: :unicodemath) : close_paren,
|
|
3267
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3268
|
+
([Utility.unicode_fractions(fraction)] + expr),
|
|
3269
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3452
3270
|
)
|
|
3453
3271
|
end
|
|
3454
3272
|
|
|
@@ -3457,11 +3275,9 @@ module Plurimath
|
|
|
3457
3275
|
exp: sequence(:exp),
|
|
3458
3276
|
close_paren: simple(:close_paren)) do
|
|
3459
3277
|
Math::Function::Fenced.new(
|
|
3460
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3464
|
-
lang: :unicodemath) : close_paren,
|
|
3278
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3279
|
+
([Utility.unicode_fractions(fraction)] + exp),
|
|
3280
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3465
3281
|
)
|
|
3466
3282
|
end
|
|
3467
3283
|
|
|
@@ -3470,11 +3286,9 @@ module Plurimath
|
|
|
3470
3286
|
exp: sequence(:exp),
|
|
3471
3287
|
close_paren: simple(:close_paren)) do
|
|
3472
3288
|
Math::Function::Fenced.new(
|
|
3473
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3477
|
-
lang: :unicodemath) : close_paren,
|
|
3289
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3290
|
+
([Utility.symbols_class(symbol, lang: :unicodemath)] + exp),
|
|
3291
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3478
3292
|
)
|
|
3479
3293
|
end
|
|
3480
3294
|
|
|
@@ -3483,11 +3297,9 @@ module Plurimath
|
|
|
3483
3297
|
exp: simple(:exp),
|
|
3484
3298
|
close_paren: simple(:close_paren)) do
|
|
3485
3299
|
Math::Function::Fenced.new(
|
|
3486
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3487
|
-
lang: :unicodemath) : open_paren,
|
|
3300
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3488
3301
|
[Utility.symbols_class(symbol, lang: :unicodemath), exp],
|
|
3489
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3490
|
-
lang: :unicodemath) : close_paren,
|
|
3302
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3491
3303
|
)
|
|
3492
3304
|
end
|
|
3493
3305
|
|
|
@@ -3497,11 +3309,9 @@ module Plurimath
|
|
|
3497
3309
|
close_paren: simple(:close_paren),
|
|
3498
3310
|
sup: simple(:sup)) do
|
|
3499
3311
|
fenced = Math::Function::Fenced.new(
|
|
3500
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3501
|
-
lang: :unicodemath) : open_paren,
|
|
3312
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3502
3313
|
[Utility.symbols_class(symbol, lang: :unicodemath), exp],
|
|
3503
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3504
|
-
lang: :unicodemath) : close_paren,
|
|
3314
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3505
3315
|
)
|
|
3506
3316
|
Math::Function::Power.new(fenced, sup)
|
|
3507
3317
|
end
|
|
@@ -3511,11 +3321,9 @@ module Plurimath
|
|
|
3511
3321
|
expr: simple(:expr),
|
|
3512
3322
|
close_paren: simple(:close_paren)) do
|
|
3513
3323
|
Math::Function::Fenced.new(
|
|
3514
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3515
|
-
lang: :unicodemath) : open_paren,
|
|
3324
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3516
3325
|
[Utility.symbols_class(operator, lang: :unicodemath), expr],
|
|
3517
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3518
|
-
lang: :unicodemath) : close_paren,
|
|
3326
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3519
3327
|
)
|
|
3520
3328
|
end
|
|
3521
3329
|
|
|
@@ -3524,11 +3332,9 @@ module Plurimath
|
|
|
3524
3332
|
expr: sequence(:expr),
|
|
3525
3333
|
close_paren: simple(:close_paren)) do
|
|
3526
3334
|
Math::Function::Fenced.new(
|
|
3527
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3531
|
-
lang: :unicodemath) : close_paren,
|
|
3335
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3336
|
+
([sub_exp] + expr),
|
|
3337
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3532
3338
|
)
|
|
3533
3339
|
end
|
|
3534
3340
|
|
|
@@ -3537,11 +3343,9 @@ module Plurimath
|
|
|
3537
3343
|
exp: sequence(:exp),
|
|
3538
3344
|
close_paren: simple(:close_paren)) do
|
|
3539
3345
|
Math::Function::Fenced.new(
|
|
3540
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3544
|
-
lang: :unicodemath) : close_paren,
|
|
3346
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3347
|
+
([sub_exp] + exp),
|
|
3348
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3545
3349
|
)
|
|
3546
3350
|
end
|
|
3547
3351
|
|
|
@@ -3550,11 +3354,9 @@ module Plurimath
|
|
|
3550
3354
|
expr: simple(:expr),
|
|
3551
3355
|
close_paren: simple(:close_paren)) do
|
|
3552
3356
|
Math::Function::Fenced.new(
|
|
3553
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3557
|
-
lang: :unicodemath) : close_paren,
|
|
3357
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3358
|
+
([sub_exp, expr]),
|
|
3359
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3558
3360
|
)
|
|
3559
3361
|
end
|
|
3560
3362
|
|
|
@@ -3563,11 +3365,9 @@ module Plurimath
|
|
|
3563
3365
|
exp: simple(:exp),
|
|
3564
3366
|
close_paren: simple(:close_paren)) do
|
|
3565
3367
|
Math::Function::Fenced.new(
|
|
3566
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3570
|
-
lang: :unicodemath) : close_paren,
|
|
3368
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3369
|
+
([sub_exp, exp]),
|
|
3370
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3571
3371
|
)
|
|
3572
3372
|
end
|
|
3573
3373
|
|
|
@@ -3576,11 +3376,9 @@ module Plurimath
|
|
|
3576
3376
|
expr: simple(:expr),
|
|
3577
3377
|
close_paren: simple(:close_paren)) do
|
|
3578
3378
|
Math::Function::Fenced.new(
|
|
3579
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3583
|
-
lang: :unicodemath) : close_paren,
|
|
3379
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3380
|
+
([sup_exp, expr]),
|
|
3381
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3584
3382
|
)
|
|
3585
3383
|
end
|
|
3586
3384
|
|
|
@@ -3589,11 +3387,9 @@ module Plurimath
|
|
|
3589
3387
|
exp: simple(:exp),
|
|
3590
3388
|
close_paren: simple(:close_paren)) do
|
|
3591
3389
|
Math::Function::Fenced.new(
|
|
3592
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3596
|
-
lang: :unicodemath) : close_paren,
|
|
3390
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3391
|
+
([sup_exp, exp]),
|
|
3392
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3597
3393
|
)
|
|
3598
3394
|
end
|
|
3599
3395
|
|
|
@@ -3602,11 +3398,9 @@ module Plurimath
|
|
|
3602
3398
|
exp: sequence(:exp),
|
|
3603
3399
|
close_paren: simple(:close_paren)) do
|
|
3604
3400
|
Math::Function::Fenced.new(
|
|
3605
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3609
|
-
lang: :unicodemath) : close_paren,
|
|
3401
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3402
|
+
([monospace] + exp),
|
|
3403
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3610
3404
|
)
|
|
3611
3405
|
end
|
|
3612
3406
|
|
|
@@ -3615,11 +3409,9 @@ module Plurimath
|
|
|
3615
3409
|
exp: simple(:exp),
|
|
3616
3410
|
close_paren: simple(:close_paren)) do
|
|
3617
3411
|
Math::Function::Fenced.new(
|
|
3618
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3622
|
-
lang: :unicodemath) : close_paren,
|
|
3412
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3413
|
+
([frac, exp]),
|
|
3414
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3623
3415
|
)
|
|
3624
3416
|
end
|
|
3625
3417
|
|
|
@@ -3628,11 +3420,9 @@ module Plurimath
|
|
|
3628
3420
|
exp: sequence(:exp),
|
|
3629
3421
|
close_paren: simple(:close_paren)) do
|
|
3630
3422
|
Math::Function::Fenced.new(
|
|
3631
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3635
|
-
lang: :unicodemath) : close_paren,
|
|
3423
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3424
|
+
([frac] + exp),
|
|
3425
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3636
3426
|
)
|
|
3637
3427
|
end
|
|
3638
3428
|
|
|
@@ -3641,11 +3431,9 @@ module Plurimath
|
|
|
3641
3431
|
exp: sequence(:exp),
|
|
3642
3432
|
close_paren: simple(:close_paren)) do
|
|
3643
3433
|
Math::Function::Fenced.new(
|
|
3644
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3648
|
-
lang: :unicodemath) : close_paren,
|
|
3434
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3435
|
+
([sup_exp] + exp),
|
|
3436
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3649
3437
|
)
|
|
3650
3438
|
end
|
|
3651
3439
|
|
|
@@ -3654,11 +3442,9 @@ module Plurimath
|
|
|
3654
3442
|
expr: sequence(:expr),
|
|
3655
3443
|
close_paren: simple(:close_paren)) do
|
|
3656
3444
|
Math::Function::Fenced.new(
|
|
3657
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3661
|
-
lang: :unicodemath) : close_paren,
|
|
3445
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3446
|
+
([subsup_exp] + expr),
|
|
3447
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3662
3448
|
)
|
|
3663
3449
|
end
|
|
3664
3450
|
|
|
@@ -3667,11 +3453,9 @@ module Plurimath
|
|
|
3667
3453
|
exp: sequence(:exp),
|
|
3668
3454
|
close_paren: simple(:close_paren)) do
|
|
3669
3455
|
Math::Function::Fenced.new(
|
|
3670
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3674
|
-
lang: :unicodemath) : close_paren,
|
|
3456
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3457
|
+
([subsup_exp] + exp),
|
|
3458
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3675
3459
|
)
|
|
3676
3460
|
end
|
|
3677
3461
|
|
|
@@ -3680,11 +3464,9 @@ module Plurimath
|
|
|
3680
3464
|
expr: sequence(:expr),
|
|
3681
3465
|
close_paren: simple(:close_paren)) do
|
|
3682
3466
|
Math::Function::Fenced.new(
|
|
3683
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3687
|
-
lang: :unicodemath) : close_paren,
|
|
3467
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3468
|
+
([factor] + expr),
|
|
3469
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3688
3470
|
)
|
|
3689
3471
|
end
|
|
3690
3472
|
|
|
@@ -3693,11 +3475,9 @@ module Plurimath
|
|
|
3693
3475
|
exp: sequence(:exp),
|
|
3694
3476
|
close_paren: simple(:close_paren)) do
|
|
3695
3477
|
Math::Function::Fenced.new(
|
|
3696
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3700
|
-
lang: :unicodemath) : close_paren,
|
|
3478
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3479
|
+
([factor] + exp),
|
|
3480
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3701
3481
|
)
|
|
3702
3482
|
end
|
|
3703
3483
|
|
|
@@ -3706,11 +3486,9 @@ module Plurimath
|
|
|
3706
3486
|
expr: sequence(:expr),
|
|
3707
3487
|
close_paren: simple(:close_paren)) do
|
|
3708
3488
|
Math::Function::Fenced.new(
|
|
3709
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3713
|
-
lang: :unicodemath) : close_paren,
|
|
3489
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3490
|
+
(factor + expr),
|
|
3491
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3714
3492
|
)
|
|
3715
3493
|
end
|
|
3716
3494
|
|
|
@@ -3719,11 +3497,9 @@ module Plurimath
|
|
|
3719
3497
|
expr: sequence(:expr),
|
|
3720
3498
|
close_paren: simple(:close_paren)) do
|
|
3721
3499
|
Math::Function::Fenced.new(
|
|
3722
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3726
|
-
lang: :unicodemath) : close_paren,
|
|
3500
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3501
|
+
([Utility.symbols_class(symbol, lang: :unicodemath)] + expr),
|
|
3502
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3727
3503
|
)
|
|
3728
3504
|
end
|
|
3729
3505
|
|
|
@@ -3732,11 +3508,9 @@ module Plurimath
|
|
|
3732
3508
|
exp: sequence(:exp),
|
|
3733
3509
|
close_paren: simple(:close_paren)) do
|
|
3734
3510
|
Math::Function::Fenced.new(
|
|
3735
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3739
|
-
lang: :unicodemath) : close_paren,
|
|
3511
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3512
|
+
(factor + exp),
|
|
3513
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3740
3514
|
)
|
|
3741
3515
|
end
|
|
3742
3516
|
|
|
@@ -3744,11 +3518,9 @@ module Plurimath
|
|
|
3744
3518
|
factor: sequence(:factor),
|
|
3745
3519
|
close_paren: simple(:close_paren)) do
|
|
3746
3520
|
Math::Function::Fenced.new(
|
|
3747
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3748
|
-
lang: :unicodemath) : open_paren,
|
|
3521
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3749
3522
|
factor,
|
|
3750
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3751
|
-
lang: :unicodemath) : close_paren,
|
|
3523
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3752
3524
|
)
|
|
3753
3525
|
end
|
|
3754
3526
|
|
|
@@ -3757,11 +3529,9 @@ module Plurimath
|
|
|
3757
3529
|
operand: simple(:operand),
|
|
3758
3530
|
close_paren: simple(:close_paren)) do
|
|
3759
3531
|
Math::Function::Fenced.new(
|
|
3760
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3764
|
-
lang: :unicodemath) : close_paren,
|
|
3532
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3533
|
+
([factor, operand]),
|
|
3534
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3765
3535
|
)
|
|
3766
3536
|
end
|
|
3767
3537
|
|
|
@@ -3770,11 +3540,9 @@ module Plurimath
|
|
|
3770
3540
|
operand: sequence(:operand),
|
|
3771
3541
|
close_paren: simple(:close_paren)) do
|
|
3772
3542
|
Math::Function::Fenced.new(
|
|
3773
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3777
|
-
lang: :unicodemath) : close_paren,
|
|
3543
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3544
|
+
([factor] + operand),
|
|
3545
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3778
3546
|
)
|
|
3779
3547
|
end
|
|
3780
3548
|
|
|
@@ -3783,11 +3551,9 @@ module Plurimath
|
|
|
3783
3551
|
operand: sequence(:operand),
|
|
3784
3552
|
close_paren: simple(:close_paren)) do
|
|
3785
3553
|
Math::Function::Fenced.new(
|
|
3786
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3790
|
-
lang: :unicodemath) : close_paren,
|
|
3554
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3555
|
+
(factor + operand),
|
|
3556
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3791
3557
|
)
|
|
3792
3558
|
end
|
|
3793
3559
|
|
|
@@ -3797,11 +3563,9 @@ module Plurimath
|
|
|
3797
3563
|
exp: simple(:exp),
|
|
3798
3564
|
close_paren: simple(:close_paren)) do
|
|
3799
3565
|
Math::Function::Fenced.new(
|
|
3800
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3801
|
-
lang: :unicodemath) : open_paren,
|
|
3566
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3802
3567
|
[Math::Function::Text.new(text), operand, exp],
|
|
3803
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3804
|
-
lang: :unicodemath) : close_paren,
|
|
3568
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3805
3569
|
)
|
|
3806
3570
|
end
|
|
3807
3571
|
|
|
@@ -3811,11 +3575,9 @@ module Plurimath
|
|
|
3811
3575
|
exp: sequence(:exp),
|
|
3812
3576
|
close_paren: simple(:close_paren)) do
|
|
3813
3577
|
Math::Function::Fenced.new(
|
|
3814
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3815
|
-
lang: :unicodemath) : open_paren,
|
|
3578
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3816
3579
|
[Math::Function::Text.new(text), operand] + exp,
|
|
3817
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3818
|
-
lang: :unicodemath) : close_paren,
|
|
3580
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3819
3581
|
)
|
|
3820
3582
|
end
|
|
3821
3583
|
|
|
@@ -3826,29 +3588,17 @@ module Plurimath
|
|
|
3826
3588
|
nary_function = if Constants::NARY_CLASSES.key?(nary_class.to_sym)
|
|
3827
3589
|
nary_class
|
|
3828
3590
|
else
|
|
3829
|
-
Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class
|
|
3591
|
+
(Constants::NARY_CLASSES.invert[nary_class.to_s] || Constants::NARY_SYMBOLS[nary_class.to_sym] || nary_class)
|
|
3830
3592
|
end
|
|
3831
|
-
sub_value =
|
|
3832
|
-
|
|
3833
|
-
else
|
|
3834
|
-
Utility.unfenced_value(
|
|
3835
|
-
sub, paren_specific: true
|
|
3836
|
-
)
|
|
3837
|
-
end
|
|
3838
|
-
sup_value = if sup.is_a?(Math::Function::Overset)
|
|
3839
|
-
sup.parameter_one
|
|
3840
|
-
else
|
|
3841
|
-
Utility.unfenced_value(
|
|
3842
|
-
sup, paren_specific: true
|
|
3843
|
-
)
|
|
3844
|
-
end
|
|
3593
|
+
sub_value = sub.is_a?(Math::Function::Underset) ? sub.parameter_one : Utility.unfenced_value(sub, paren_specific: true)
|
|
3594
|
+
sup_value = sup.is_a?(Math::Function::Overset) ? sup.parameter_one : Utility.unfenced_value(sup, paren_specific: true)
|
|
3845
3595
|
options = { mask: mask.value }
|
|
3846
3596
|
if Constants::NARY_CLASSES.key?(nary_function.to_sym)
|
|
3847
3597
|
Utility.get_class(nary_function).new(
|
|
3848
3598
|
sub_value,
|
|
3849
3599
|
sup_value,
|
|
3850
3600
|
nil,
|
|
3851
|
-
options
|
|
3601
|
+
options
|
|
3852
3602
|
)
|
|
3853
3603
|
else
|
|
3854
3604
|
Math::Function::Nary.new(
|
|
@@ -3856,7 +3606,7 @@ module Plurimath
|
|
|
3856
3606
|
sub_value,
|
|
3857
3607
|
sup_value,
|
|
3858
3608
|
nil,
|
|
3859
|
-
options
|
|
3609
|
+
options
|
|
3860
3610
|
)
|
|
3861
3611
|
end
|
|
3862
3612
|
end
|
|
@@ -3866,11 +3616,9 @@ module Plurimath
|
|
|
3866
3616
|
expr: sequence(:expr),
|
|
3867
3617
|
close_paren: simple(:close_paren)) do
|
|
3868
3618
|
Math::Function::Fenced.new(
|
|
3869
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3873
|
-
lang: :unicodemath) : close_paren,
|
|
3619
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3620
|
+
([Utility.symbols_class(operator, lang: :unicodemath)] + expr),
|
|
3621
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3874
3622
|
)
|
|
3875
3623
|
end
|
|
3876
3624
|
|
|
@@ -3879,11 +3627,9 @@ module Plurimath
|
|
|
3879
3627
|
expr: simple(:expr),
|
|
3880
3628
|
close_paren: simple(:close_paren)) do
|
|
3881
3629
|
Math::Function::Fenced.new(
|
|
3882
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3883
|
-
lang: :unicodemath) : open_paren,
|
|
3630
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3884
3631
|
[fonts, expr],
|
|
3885
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3886
|
-
lang: :unicodemath) : close_paren,
|
|
3632
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3887
3633
|
)
|
|
3888
3634
|
end
|
|
3889
3635
|
|
|
@@ -3892,11 +3638,9 @@ module Plurimath
|
|
|
3892
3638
|
exp: simple(:exp),
|
|
3893
3639
|
close_paren: simple(:close_paren)) do
|
|
3894
3640
|
Math::Function::Fenced.new(
|
|
3895
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3896
|
-
lang: :unicodemath) : open_paren,
|
|
3641
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3897
3642
|
[fonts, exp],
|
|
3898
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3899
|
-
lang: :unicodemath) : close_paren,
|
|
3643
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3900
3644
|
)
|
|
3901
3645
|
end
|
|
3902
3646
|
|
|
@@ -3905,11 +3649,9 @@ module Plurimath
|
|
|
3905
3649
|
exp: sequence(:exp),
|
|
3906
3650
|
close_paren: simple(:close_paren)) do
|
|
3907
3651
|
Math::Function::Fenced.new(
|
|
3908
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3912
|
-
lang: :unicodemath) : close_paren,
|
|
3652
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3653
|
+
([Utility.symbols_class(operator, lang: :unicodemath)] + exp),
|
|
3654
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3913
3655
|
)
|
|
3914
3656
|
end
|
|
3915
3657
|
|
|
@@ -3932,11 +3674,9 @@ module Plurimath
|
|
|
3932
3674
|
exp: simple(:exp),
|
|
3933
3675
|
close_paren: simple(:close_paren)) do
|
|
3934
3676
|
Math::Function::Fenced.new(
|
|
3935
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3939
|
-
lang: :unicodemath) : close_paren,
|
|
3677
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3678
|
+
([Utility.symbols_class(operator, lang: :unicodemath), exp]),
|
|
3679
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3940
3680
|
)
|
|
3941
3681
|
end
|
|
3942
3682
|
|
|
@@ -3957,11 +3697,9 @@ module Plurimath
|
|
|
3957
3697
|
close_paren: simple(:close_paren),
|
|
3958
3698
|
sup: simple(:sup)) do
|
|
3959
3699
|
fenced = Math::Function::Fenced.new(
|
|
3960
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3961
|
-
lang: :unicodemath) : open_paren,
|
|
3700
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3962
3701
|
[Utility.symbols_class(operator, lang: :unicodemath), expr],
|
|
3963
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3964
|
-
lang: :unicodemath) : close_paren,
|
|
3702
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3965
3703
|
)
|
|
3966
3704
|
Math::Function::Power.new(fenced, sup)
|
|
3967
3705
|
end
|
|
@@ -3972,11 +3710,9 @@ module Plurimath
|
|
|
3972
3710
|
exp: sequence(:exp),
|
|
3973
3711
|
close_paren: simple(:close_paren)) do
|
|
3974
3712
|
Math::Function::Fenced.new(
|
|
3975
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3979
|
-
lang: :unicodemath) : close_paren,
|
|
3713
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3714
|
+
([factor, sup_exp] + exp),
|
|
3715
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3980
3716
|
)
|
|
3981
3717
|
end
|
|
3982
3718
|
|
|
@@ -3986,15 +3722,13 @@ module Plurimath
|
|
|
3986
3722
|
close_paren: simple(:close_paren),
|
|
3987
3723
|
sup: simple(:sup)) do
|
|
3988
3724
|
fenced = Math::Function::Fenced.new(
|
|
3989
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
3993
|
-
lang: :unicodemath) : close_paren,
|
|
3725
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3726
|
+
([sub_exp, exp]),
|
|
3727
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
3994
3728
|
)
|
|
3995
3729
|
Math::Function::Power.new(
|
|
3996
3730
|
fenced,
|
|
3997
|
-
Utility.unfenced_value(sup, paren_specific: true)
|
|
3731
|
+
Utility.unfenced_value(sup, paren_specific: true)
|
|
3998
3732
|
)
|
|
3999
3733
|
end
|
|
4000
3734
|
|
|
@@ -4004,15 +3738,13 @@ module Plurimath
|
|
|
4004
3738
|
close_paren: simple(:close_paren),
|
|
4005
3739
|
sup: simple(:sup)) do
|
|
4006
3740
|
fenced = Math::Function::Fenced.new(
|
|
4007
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
4011
|
-
lang: :unicodemath) : close_paren,
|
|
3741
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3742
|
+
([sub_exp] + exp),
|
|
3743
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
4012
3744
|
)
|
|
4013
3745
|
Math::Function::Power.new(
|
|
4014
3746
|
fenced,
|
|
4015
|
-
Utility.unfenced_value(sup, paren_specific: true)
|
|
3747
|
+
Utility.unfenced_value(sup, paren_specific: true)
|
|
4016
3748
|
)
|
|
4017
3749
|
end
|
|
4018
3750
|
|
|
@@ -4022,11 +3754,9 @@ module Plurimath
|
|
|
4022
3754
|
close_paren: simple(:close_paren),
|
|
4023
3755
|
sup: simple(:sup)) do
|
|
4024
3756
|
fenced = Math::Function::Fenced.new(
|
|
4025
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
4026
|
-
lang: :unicodemath) : open_paren,
|
|
3757
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
4027
3758
|
[Utility.symbols_class(operator, lang: :unicodemath), exp],
|
|
4028
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
4029
|
-
lang: :unicodemath) : close_paren,
|
|
3759
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
4030
3760
|
)
|
|
4031
3761
|
Math::Function::Power.new(fenced, sup)
|
|
4032
3762
|
end
|
|
@@ -4049,11 +3779,9 @@ module Plurimath
|
|
|
4049
3779
|
expr: sequence(:expr),
|
|
4050
3780
|
close_paren: simple(:close_paren)) do
|
|
4051
3781
|
Math::Function::Fenced.new(
|
|
4052
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
4056
|
-
lang: :unicodemath) : close_paren,
|
|
3782
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3783
|
+
([factor, operand] + expr),
|
|
3784
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
4057
3785
|
)
|
|
4058
3786
|
end
|
|
4059
3787
|
|
|
@@ -4063,11 +3791,9 @@ module Plurimath
|
|
|
4063
3791
|
exp: sequence(:exp),
|
|
4064
3792
|
close_paren: simple(:close_paren)) do
|
|
4065
3793
|
Math::Function::Fenced.new(
|
|
4066
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
4070
|
-
lang: :unicodemath) : close_paren,
|
|
3794
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3795
|
+
([factor, operand] + exp),
|
|
3796
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
4071
3797
|
)
|
|
4072
3798
|
end
|
|
4073
3799
|
|
|
@@ -4077,11 +3803,9 @@ module Plurimath
|
|
|
4077
3803
|
exp: sequence(:exp),
|
|
4078
3804
|
close_paren: simple(:close_paren)) do
|
|
4079
3805
|
Math::Function::Fenced.new(
|
|
4080
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
4084
|
-
lang: :unicodemath) : close_paren,
|
|
3806
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3807
|
+
([factor] + operand + exp),
|
|
3808
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
4085
3809
|
)
|
|
4086
3810
|
end
|
|
4087
3811
|
|
|
@@ -4091,11 +3815,9 @@ module Plurimath
|
|
|
4091
3815
|
expr: simple(:expr),
|
|
4092
3816
|
close_paren: simple(:close_paren)) do
|
|
4093
3817
|
Math::Function::Fenced.new(
|
|
4094
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
4098
|
-
lang: :unicodemath) : close_paren,
|
|
3818
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3819
|
+
([factor, operand, expr]),
|
|
3820
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
4099
3821
|
)
|
|
4100
3822
|
end
|
|
4101
3823
|
|
|
@@ -4105,11 +3827,9 @@ module Plurimath
|
|
|
4105
3827
|
exp: simple(:exp),
|
|
4106
3828
|
close_paren: simple(:close_paren)) do
|
|
4107
3829
|
Math::Function::Fenced.new(
|
|
4108
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
4112
|
-
lang: :unicodemath) : close_paren,
|
|
3830
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3831
|
+
([factor] + sub_exp + [exp]),
|
|
3832
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
4113
3833
|
)
|
|
4114
3834
|
end
|
|
4115
3835
|
|
|
@@ -4120,12 +3840,9 @@ module Plurimath
|
|
|
4120
3840
|
exp: sequence(:exp),
|
|
4121
3841
|
close_paren: simple(:close_paren)) do
|
|
4122
3842
|
Math::Function::Fenced.new(
|
|
4123
|
-
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren,
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
expr] + exp,
|
|
4127
|
-
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren,
|
|
4128
|
-
lang: :unicodemath) : close_paren,
|
|
3843
|
+
open_paren.is_a?(Slice) ? Utility.symbols_class(open_paren, lang: :unicodemath) : open_paren,
|
|
3844
|
+
([monospace, Utility.symbols_class(symbol, lang: :unicodemath), expr] + exp),
|
|
3845
|
+
close_paren.is_a?(Slice) ? Utility.symbols_class(close_paren, lang: :unicodemath) : close_paren,
|
|
4129
3846
|
)
|
|
4130
3847
|
end
|
|
4131
3848
|
|
|
@@ -4180,8 +3897,7 @@ module Plurimath
|
|
|
4180
3897
|
close_paren: simple(:close_paren)) do
|
|
4181
3898
|
Math::Function::Fenced.new(
|
|
4182
3899
|
Utility.symbols_class(open_paren, lang: :unicodemath),
|
|
4183
|
-
[left_value, Utility.symbols_class(comma, lang: :unicodemath),
|
|
4184
|
-
right_value],
|
|
3900
|
+
[left_value, Utility.symbols_class(comma, lang: :unicodemath), right_value],
|
|
4185
3901
|
Utility.symbols_class(close_paren, lang: :unicodemath),
|
|
4186
3902
|
)
|
|
4187
3903
|
end
|
|
@@ -4191,11 +3907,10 @@ module Plurimath
|
|
|
4191
3907
|
comma: simple(:comma),
|
|
4192
3908
|
right_value: sequence(:right_value),
|
|
4193
3909
|
close_paren: simple(:close_paren)) do
|
|
4194
|
-
fence_value = [left_value,
|
|
4195
|
-
Utility.symbols_class(comma, lang: :unicodemath)]
|
|
3910
|
+
fence_value = [left_value, Utility.symbols_class(comma, lang: :unicodemath)]
|
|
4196
3911
|
Math::Function::Fenced.new(
|
|
4197
3912
|
Utility.symbols_class(open_paren, lang: :unicodemath),
|
|
4198
|
-
fence_value.
|
|
3913
|
+
fence_value.concat([Utility.filter_values(right_value)]),
|
|
4199
3914
|
Utility.symbols_class(close_paren, lang: :unicodemath),
|
|
4200
3915
|
)
|
|
4201
3916
|
end
|
|
@@ -4205,8 +3920,7 @@ module Plurimath
|
|
|
4205
3920
|
comma: simple(:comma),
|
|
4206
3921
|
right_value: simple(:right_value),
|
|
4207
3922
|
close_paren: simple(:close_paren)) do
|
|
4208
|
-
fence_value = [Utility.symbols_class(comma, lang: :unicodemath),
|
|
4209
|
-
right_value]
|
|
3923
|
+
fence_value = [Utility.symbols_class(comma, lang: :unicodemath), right_value]
|
|
4210
3924
|
Math::Function::Fenced.new(
|
|
4211
3925
|
Utility.symbols_class(open_paren, lang: :unicodemath),
|
|
4212
3926
|
fence_value.insert(0, Utility.filter_values(left_value)),
|