plurimath 0.9.1 → 0.9.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/.github/workflows/dependent-repos.json +5 -0
- data/.github/workflows/dependent-tests.yml +16 -0
- data/lib/plurimath/asciimath/parse.rb +2 -2
- data/lib/plurimath/asciimath/transform.rb +81 -0
- data/lib/plurimath/math/core.rb +1 -0
- data/lib/plurimath/math/formula.rb +1 -1
- data/lib/plurimath/math/function/fenced.rb +1 -1
- data/lib/plurimath/math/function/ms.rb +5 -2
- data/lib/plurimath/version.rb +1 -1
- data/lib/plurimath.rb +1 -2
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 65b30f602bdfb128eb92f4cc3c1677585f8ec721cc3faa187b32f353486b0a10
|
|
4
|
+
data.tar.gz: b9babf5d6792d1f8fc6254ed59f18e48e9e8595051810c7fc2a5fbbbfa228ba2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7f8ea11095e08057dfa814d69b88348a62887d201a212c4761269e4455287ff6142e75015a7b5df83d73228af15b8e8caaf44d9e0371b6c241876994883ced15
|
|
7
|
+
data.tar.gz: a83989cab70e5d880f06e46a027aaecb463286f74800a7e5f89a5ad8536afcc415a17c74687393df514fd50a1474d9d02e774e35e608d90762471a8122cf4c05
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
name: dependent-gems-test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
tags: [ v* ]
|
|
7
|
+
pull_request:
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
repository_dispatch:
|
|
10
|
+
types: [ release-passed ]
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
rake:
|
|
14
|
+
uses: metanorma/ci/.github/workflows/dependent-rake.yml@main
|
|
15
|
+
with:
|
|
16
|
+
command: bundle exec rspec
|
|
@@ -65,7 +65,7 @@ module Plurimath
|
|
|
65
65
|
rule(:left_right) do
|
|
66
66
|
(str("left") >> space? >> left_right_open_paren.as(:left) >> space? >> (iteration.maybe >> sequence.maybe).as(:left_right_value) >> space? >> str("right") >> space? >> left_right_close_paren.as(:right)) |
|
|
67
67
|
((table.as(:numerator) >> space? >> match(/(?<!\/)\/(?!\/)/) >> space? >> iteration.as(:denominator)).as(:frac) >> expression) |
|
|
68
|
-
(table.as(:table) >> expression.maybe)
|
|
68
|
+
(table.as(:table) >> power_base.maybe >> expression.maybe)
|
|
69
69
|
end
|
|
70
70
|
|
|
71
71
|
rule(:quoted_text) do
|
|
@@ -138,7 +138,7 @@ module Plurimath
|
|
|
138
138
|
|
|
139
139
|
rule(:iteration) do
|
|
140
140
|
ternary_classes_rules |
|
|
141
|
-
table.as(:table) |
|
|
141
|
+
table.as(:table) >> power_base.maybe |
|
|
142
142
|
comma.as(:comma) |
|
|
143
143
|
mod |
|
|
144
144
|
(sequence.as(:sequence) >> space? >> str("//").as(:symbol)) |
|
|
@@ -900,6 +900,64 @@ module Plurimath
|
|
|
900
900
|
Math::Formula.new(formula_array)
|
|
901
901
|
end
|
|
902
902
|
|
|
903
|
+
rule(table: simple(:table),
|
|
904
|
+
base: simple(:base)) do
|
|
905
|
+
Math::Function::Base.new(table, base)
|
|
906
|
+
end
|
|
907
|
+
|
|
908
|
+
rule(table: simple(:table),
|
|
909
|
+
power: simple(:power)) do
|
|
910
|
+
Math::Function::Power.new(table, power)
|
|
911
|
+
end
|
|
912
|
+
|
|
913
|
+
rule(table: simple(:table),
|
|
914
|
+
power_value: simple(:power),
|
|
915
|
+
base_value: simple(:base)) do
|
|
916
|
+
Math::Function::PowerBase.new(table, power, base)
|
|
917
|
+
end
|
|
918
|
+
|
|
919
|
+
rule(table: simple(:table),
|
|
920
|
+
power: simple(:power),
|
|
921
|
+
expr: sequence(:expr)) do
|
|
922
|
+
Math::Formula.new(
|
|
923
|
+
[
|
|
924
|
+
Math::Function::Power.new(table, power),
|
|
925
|
+
] + expr.flatten.compact,
|
|
926
|
+
)
|
|
927
|
+
end
|
|
928
|
+
|
|
929
|
+
rule(table: simple(:table),
|
|
930
|
+
power: simple(:power),
|
|
931
|
+
expr: simple(:expr)) do
|
|
932
|
+
Math::Formula.new(
|
|
933
|
+
[
|
|
934
|
+
Math::Function::Power.new(table, power),
|
|
935
|
+
expr,
|
|
936
|
+
],
|
|
937
|
+
)
|
|
938
|
+
end
|
|
939
|
+
|
|
940
|
+
rule(table: simple(:table),
|
|
941
|
+
base: simple(:base),
|
|
942
|
+
expr: sequence(:expr)) do
|
|
943
|
+
Math::Formula.new(
|
|
944
|
+
[
|
|
945
|
+
Math::Function::Base.new(table, base),
|
|
946
|
+
] + expr.flatten.compact,
|
|
947
|
+
)
|
|
948
|
+
end
|
|
949
|
+
|
|
950
|
+
rule(table: simple(:table),
|
|
951
|
+
base: simple(:base),
|
|
952
|
+
expr: simple(:expr)) do
|
|
953
|
+
Math::Formula.new(
|
|
954
|
+
[
|
|
955
|
+
Math::Function::Base.new(table, base),
|
|
956
|
+
expr,
|
|
957
|
+
],
|
|
958
|
+
)
|
|
959
|
+
end
|
|
960
|
+
|
|
903
961
|
rule(table: simple(:table),
|
|
904
962
|
rparen: simple(:rparen),
|
|
905
963
|
expr: sequence(:expr)) do
|
|
@@ -1032,6 +1090,29 @@ module Plurimath
|
|
|
1032
1090
|
)
|
|
1033
1091
|
end
|
|
1034
1092
|
|
|
1093
|
+
rule(table: simple(:table),
|
|
1094
|
+
power_value: simple(:power),
|
|
1095
|
+
base_value: simple(:base),
|
|
1096
|
+
expr: simple(:expr)) do
|
|
1097
|
+
Math::Formula.new(
|
|
1098
|
+
[
|
|
1099
|
+
Math::Function::PowerBase.new(table, power, base),
|
|
1100
|
+
expr,
|
|
1101
|
+
],
|
|
1102
|
+
)
|
|
1103
|
+
end
|
|
1104
|
+
|
|
1105
|
+
rule(table: simple(:table),
|
|
1106
|
+
power_value: simple(:power),
|
|
1107
|
+
base_value: simple(:base),
|
|
1108
|
+
expr: sequence(:expr)) do
|
|
1109
|
+
Math::Formula.new(
|
|
1110
|
+
[
|
|
1111
|
+
Math::Function::PowerBase.new(table, power, base),
|
|
1112
|
+
] + expr.flatten.compact,
|
|
1113
|
+
)
|
|
1114
|
+
end
|
|
1115
|
+
|
|
1035
1116
|
rule(table_left: simple(:table_left),
|
|
1036
1117
|
table_row: simple(:table_row),
|
|
1037
1118
|
expr: simple(:expr),
|
data/lib/plurimath/math/core.rb
CHANGED
|
@@ -36,8 +36,11 @@ module Plurimath
|
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
def value=(content)
|
|
39
|
-
|
|
40
|
-
@parameter_one = [
|
|
39
|
+
temp_content = updated_temp_mathml_values.flatten.map(&:to_ms_value)
|
|
40
|
+
@parameter_one = [
|
|
41
|
+
temp_content,
|
|
42
|
+
content&.empty? ? nil : content,
|
|
43
|
+
].flatten.compact.join(" ")
|
|
41
44
|
end
|
|
42
45
|
|
|
43
46
|
def mi_value=(value)
|
data/lib/plurimath/version.rb
CHANGED
data/lib/plurimath.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: plurimath
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.
|
|
4
|
+
version: 0.9.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-04-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: ox
|
|
@@ -116,6 +116,8 @@ executables:
|
|
|
116
116
|
extensions: []
|
|
117
117
|
extra_rdoc_files: []
|
|
118
118
|
files:
|
|
119
|
+
- ".github/workflows/dependent-repos.json"
|
|
120
|
+
- ".github/workflows/dependent-tests.yml"
|
|
119
121
|
- ".github/workflows/gen_docs.yml"
|
|
120
122
|
- ".github/workflows/rake.yml"
|
|
121
123
|
- ".github/workflows/release.yml"
|