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.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/.rubocop_todo.yml +108 -175
  4. data/Gemfile +1 -0
  5. data/README.adoc +282 -6
  6. data/lib/plurimath/asciimath/parse.rb +6 -1
  7. data/lib/plurimath/asciimath/transform.rb +2 -0
  8. data/lib/plurimath/base_number_prefix.rb +43 -0
  9. data/lib/plurimath/configuration.rb +9 -1
  10. data/lib/plurimath/errors/evaluation/division_by_zero_error.rb +13 -0
  11. data/lib/plurimath/errors/evaluation/error.rb +9 -0
  12. data/lib/plurimath/errors/evaluation/invalid_binding_error.rb +14 -0
  13. data/lib/plurimath/errors/evaluation/invalid_binding_key_error.rb +14 -0
  14. data/lib/plurimath/errors/evaluation/math_domain_error.rb +9 -0
  15. data/lib/plurimath/errors/evaluation/missing_variable_error.rb +13 -0
  16. data/lib/plurimath/errors/evaluation/non_finite_result_error.rb +13 -0
  17. data/lib/plurimath/errors/evaluation/unsupported_expression_error.rb +13 -0
  18. data/lib/plurimath/errors/evaluation.rb +18 -0
  19. data/lib/plurimath/errors.rb +1 -0
  20. data/lib/plurimath/formatter/numbers/base_notation.rb +54 -31
  21. data/lib/plurimath/formatter/numbers/formatted_notation.rb +62 -0
  22. data/lib/plurimath/formatter/numbers/formatted_number.rb +87 -0
  23. data/lib/plurimath/formatter/numbers/fraction.rb +1 -1
  24. data/lib/plurimath/formatter/numbers/mathml_renderer.rb +56 -0
  25. data/lib/plurimath/formatter/numbers/notation_renderer.rb +30 -29
  26. data/lib/plurimath/formatter/numbers/number_renderer.rb +10 -9
  27. data/lib/plurimath/formatter/numbers/omml_renderer.rb +74 -0
  28. data/lib/plurimath/formatter/numbers/source.rb +29 -4
  29. data/lib/plurimath/formatter/numbers/text_renderer.rb +52 -0
  30. data/lib/plurimath/formatter/numbers.rb +6 -2
  31. data/lib/plurimath/html/parse.rb +5 -0
  32. data/lib/plurimath/html/transform.rb +2 -0
  33. data/lib/plurimath/latex/parse.rb +5 -0
  34. data/lib/plurimath/latex/transform.rb +2 -0
  35. data/lib/plurimath/math/core.rb +52 -0
  36. data/lib/plurimath/math/evaluation/evaluator.rb +147 -0
  37. data/lib/plurimath/math/evaluation/expression_parser.rb +215 -0
  38. data/lib/plurimath/math/evaluation/iteration.rb +63 -0
  39. data/lib/plurimath/math/evaluation.rb +13 -0
  40. data/lib/plurimath/math/formula.rb +9 -0
  41. data/lib/plurimath/math/function/abs.rb +4 -0
  42. data/lib/plurimath/math/function/arccos.rb +4 -0
  43. data/lib/plurimath/math/function/arcsin.rb +4 -0
  44. data/lib/plurimath/math/function/arctan.rb +4 -0
  45. data/lib/plurimath/math/function/ceil.rb +4 -0
  46. data/lib/plurimath/math/function/cos.rb +4 -0
  47. data/lib/plurimath/math/function/cosh.rb +4 -0
  48. data/lib/plurimath/math/function/cot.rb +4 -0
  49. data/lib/plurimath/math/function/coth.rb +4 -0
  50. data/lib/plurimath/math/function/csc.rb +4 -0
  51. data/lib/plurimath/math/function/csch.rb +4 -0
  52. data/lib/plurimath/math/function/exp.rb +4 -0
  53. data/lib/plurimath/math/function/fenced.rb +4 -0
  54. data/lib/plurimath/math/function/floor.rb +4 -0
  55. data/lib/plurimath/math/function/frac.rb +7 -0
  56. data/lib/plurimath/math/function/gcd.rb +9 -0
  57. data/lib/plurimath/math/function/lcm.rb +9 -0
  58. data/lib/plurimath/math/function/lg.rb +4 -0
  59. data/lib/plurimath/math/function/ln.rb +4 -0
  60. data/lib/plurimath/math/function/log.rb +19 -0
  61. data/lib/plurimath/math/function/max.rb +4 -0
  62. data/lib/plurimath/math/function/min.rb +4 -0
  63. data/lib/plurimath/math/function/mod.rb +15 -0
  64. data/lib/plurimath/math/function/power.rb +10 -0
  65. data/lib/plurimath/math/function/prod.rb +10 -0
  66. data/lib/plurimath/math/function/root.rb +7 -0
  67. data/lib/plurimath/math/function/sec.rb +4 -0
  68. data/lib/plurimath/math/function/sech.rb +4 -0
  69. data/lib/plurimath/math/function/sin.rb +4 -0
  70. data/lib/plurimath/math/function/sinh.rb +4 -0
  71. data/lib/plurimath/math/function/sqrt.rb +4 -0
  72. data/lib/plurimath/math/function/sum.rb +10 -0
  73. data/lib/plurimath/math/function/tan.rb +4 -0
  74. data/lib/plurimath/math/function/tanh.rb +4 -0
  75. data/lib/plurimath/math/function/text.rb +17 -0
  76. data/lib/plurimath/math/number.rb +40 -29
  77. data/lib/plurimath/math/symbols/cdot.rb +4 -0
  78. data/lib/plurimath/math/symbols/div.rb +4 -0
  79. data/lib/plurimath/math/symbols/hat.rb +4 -0
  80. data/lib/plurimath/math/symbols/minus.rb +4 -0
  81. data/lib/plurimath/math/symbols/pi.rb +5 -1
  82. data/lib/plurimath/math/symbols/plus.rb +4 -0
  83. data/lib/plurimath/math/symbols/slash.rb +4 -0
  84. data/lib/plurimath/math/symbols/symbol.rb +45 -0
  85. data/lib/plurimath/math/symbols/times.rb +4 -0
  86. data/lib/plurimath/math.rb +1 -0
  87. data/lib/plurimath/mathml/constants.rb +18 -0
  88. data/lib/plurimath/number_formatter.rb +47 -28
  89. data/lib/plurimath/setup/opal.rb.erb +13 -0
  90. data/lib/plurimath/unicode_math/parse.rb +5 -1
  91. data/lib/plurimath/unicode_math/transform.rb +469 -755
  92. data/lib/plurimath/utility.rb +1 -1
  93. data/lib/plurimath/version.rb +1 -1
  94. data/lib/plurimath.rb +1 -0
  95. metadata +21 -3
  96. data/lib/plurimath/formatter/numbers/parts_renderer.rb +0 -30
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fa0df74a0b5161e4e9550aa4e16cd63d693c223ca3d2c3458bc4523978fbb399
4
- data.tar.gz: 911b97a2e968e530817baaeb4b6ca547e30a15ff1baf8a0345b5e0b79f705fb9
3
+ metadata.gz: 11ba1229615b89a47433de461270293407f476eb418c25601d69d04bcacc6f2a
4
+ data.tar.gz: 9c8fa073f7edd18ba85a779fd5688c2bb6a8486a7bf668a34458efe543b59041
5
5
  SHA512:
6
- metadata.gz: 168b5906f33a0077e101eaafce29679432b9ec7d0df521f08d32e30f5ab194ab5326e6fadb9d6fce33486cb98a18ce229b28784e8cfe0944dc6cbdc2ec982907
7
- data.tar.gz: b2c6f1da78545d427630cb536cc183552f917a646f3c97d15effa301b54f7fc961d4a49f62cf274f62e9254109c15f24e02ecf299b6fac693efc4eafe3050bf3
6
+ metadata.gz: cabc87c386e4fd384ea4d29984c5dd7df09cd94a9204ae8a4fde4c4e9f8944361e5f04e96740b4d86e77ff9c30fd6fb66fd9ca49a1ea2b05b4a5aac6cab1c53e
7
+ data.tar.gz: 2911f337795f3bf3420721e9760c3cacd9b773b645b08e139b361e5dc9e84b05e6eac91fba820c418e69b1aad83ec72cc38acae3cf94db264da3f9af87943711
data/.gitignore CHANGED
@@ -14,3 +14,6 @@
14
14
 
15
15
  # temp files
16
16
  *.kate-swp
17
+
18
+ # Roadmap/planning notes live in issues or docs/, not the repo
19
+ /TODO.*/
data/.rubocop_todo.yml CHANGED
@@ -1,99 +1,78 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2026-06-21 10:02:00 UTC using RuboCop version 1.86.1.
3
+ # on 2026-06-24 16:29:48 UTC using RuboCop version 1.86.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
+ # Offense count: 8
10
+ # This cop supports safe autocorrection (--autocorrect).
11
+ # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation.
12
+ Bundler/OrderedGems:
13
+ Exclude:
14
+ - 'Gemfile'
15
+
9
16
  # Offense count: 1
10
17
  Gemspec/RequiredRubyVersion:
11
18
  Exclude:
12
19
  - 'plurimath.gemspec'
13
20
 
14
- # Offense count: 279
21
+ # Offense count: 261
15
22
  # This cop supports safe autocorrection (--autocorrect).
16
23
  # Configuration parameters: EnforcedStyle, IndentationWidth.
17
24
  # SupportedStyles: with_first_argument, with_fixed_indentation
18
25
  Layout/ArgumentAlignment:
19
26
  Enabled: false
20
27
 
21
- # Offense count: 29
28
+ # Offense count: 26
22
29
  # This cop supports safe autocorrection (--autocorrect).
23
30
  # Configuration parameters: EnforcedStyle, IndentationWidth.
24
31
  # SupportedStyles: with_first_element, with_fixed_indentation
25
32
  Layout/ArrayAlignment:
26
33
  Exclude:
27
34
  - 'lib/plurimath/formatter/numbers/notation_renderer.rb'
28
- - 'lib/plurimath/formatter/numbers/precision_resolver.rb'
29
35
  - 'lib/plurimath/unicode_math/transform.rb'
30
- - 'spec/plurimath/latex/parser_spec.rb'
31
- - 'spec/plurimath/mathml/parser_spec.rb'
32
- - 'spec/plurimath/number_formatter_spec.rb'
36
+ - 'spec/plurimath/math/evaluation_spec.rb'
33
37
 
34
- # Offense count: 11
38
+ # Offense count: 10
35
39
  # This cop supports safe autocorrection (--autocorrect).
36
40
  # Configuration parameters: IndentationWidth.
37
41
  Layout/AssignmentIndentation:
38
42
  Exclude:
39
- - 'lib/plurimath/unicode_math/parser.rb'
40
43
  - 'lib/plurimath/unicode_math/transform.rb'
41
44
 
42
- # Offense count: 100
45
+ # Offense count: 15
43
46
  # This cop supports safe autocorrection (--autocorrect).
44
47
  # Configuration parameters: EnforcedStyleAlignWith.
45
48
  # SupportedStylesAlignWith: either, start_of_block, start_of_line
46
49
  Layout/BlockAlignment:
47
50
  Exclude:
48
- - 'lib/plurimath/math/core.rb'
49
- - 'lib/plurimath/unicode_math/parse.rb'
50
- - 'lib/plurimath/unicode_math/parser.rb'
51
- - 'lib/plurimath/unicode_math/parsing_rules/absence_rules.rb'
52
- - 'lib/plurimath/unicode_math/parsing_rules/common_rules.rb'
53
- - 'lib/plurimath/unicode_math/parsing_rules/constants_rules.rb'
54
- - 'lib/plurimath/unicode_math/parsing_rules/masked.rb'
55
- - 'lib/plurimath/unicode_math/parsing_rules/sub_sup.rb'
51
+ - 'lib/plurimath/math/evaluation/evaluator.rb'
56
52
  - 'lib/plurimath/unicode_math/transform.rb'
57
- - 'spec/plurimath/formatter/numbers/format_options_spec.rb'
58
- - 'spec/plurimath/formatter/numbers/fraction_spec.rb'
59
- - 'spec/plurimath/formatter/numbers/integer_spec.rb'
60
- - 'spec/plurimath/formatter/numbers/significant_spec.rb'
61
- - 'spec/plurimath/html/parser_spec.rb'
62
- - 'spec/plurimath/number_formatter_spec.rb'
53
+ - 'spec/plurimath/math/evaluation_spec.rb'
63
54
 
64
- # Offense count: 94
55
+ # Offense count: 12
65
56
  # This cop supports safe autocorrection (--autocorrect).
66
57
  Layout/BlockEndNewline:
67
58
  Exclude:
68
- - 'lib/plurimath/unicode_math/parse.rb'
69
- - 'lib/plurimath/unicode_math/parser.rb'
70
- - 'lib/plurimath/unicode_math/parsing_rules/absence_rules.rb'
71
- - 'lib/plurimath/unicode_math/parsing_rules/common_rules.rb'
72
- - 'lib/plurimath/unicode_math/parsing_rules/constants_rules.rb'
73
- - 'lib/plurimath/unicode_math/parsing_rules/masked.rb'
74
- - 'lib/plurimath/unicode_math/parsing_rules/sub_sup.rb'
59
+ - 'lib/plurimath/math/evaluation/evaluator.rb'
75
60
  - 'lib/plurimath/unicode_math/transform.rb'
76
- - 'spec/plurimath/formatter/numbers/format_options_spec.rb'
77
- - 'spec/plurimath/formatter/numbers/fraction_spec.rb'
78
- - 'spec/plurimath/formatter/numbers/integer_spec.rb'
79
- - 'spec/plurimath/formatter/numbers/significant_spec.rb'
80
- - 'spec/plurimath/html/parser_spec.rb'
81
- - 'spec/plurimath/number_formatter_spec.rb'
61
+ - 'spec/plurimath/math/evaluation_spec.rb'
82
62
 
83
- # Offense count: 29
63
+ # Offense count: 35
84
64
  # This cop supports safe autocorrection (--autocorrect).
85
65
  Layout/ClosingParenthesisIndentation:
86
66
  Exclude:
87
67
  - 'lib/plurimath/formatter/numbers/notation_renderer.rb'
88
- - 'lib/plurimath/math/core.rb'
68
+ - 'lib/plurimath/math/number.rb'
89
69
  - 'lib/plurimath/unicode_math/transform.rb'
90
- - 'spec/plurimath/deprecation_spec.rb'
70
+ - 'spec/plurimath/math/evaluation_spec.rb'
91
71
 
92
- # Offense count: 19
72
+ # Offense count: 18
93
73
  # This cop supports safe autocorrection (--autocorrect).
94
74
  Layout/ElseAlignment:
95
75
  Exclude:
96
- - 'lib/plurimath/formatter/numbers/base_notation.rb'
97
76
  - 'lib/plurimath/unicode_math/transform.rb'
98
77
 
99
78
  # Offense count: 1
@@ -102,61 +81,34 @@ Layout/EmptyLines:
102
81
  Exclude:
103
82
  - 'lib/plurimath/unicode_math/transform.rb'
104
83
 
105
- # Offense count: 1
106
- # This cop supports safe autocorrection (--autocorrect).
107
- # Configuration parameters: EnforcedStyle.
108
- # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only
109
- Layout/EmptyLinesAroundClassBody:
110
- Exclude:
111
- - 'lib/plurimath/unicode_math/transform.rb'
112
-
113
- # Offense count: 11
84
+ # Offense count: 10
114
85
  # This cop supports safe autocorrection (--autocorrect).
115
86
  # Configuration parameters: EnforcedStyleAlignWith.
116
87
  # SupportedStylesAlignWith: keyword, variable, start_of_line
117
88
  Layout/EndAlignment:
118
89
  Exclude:
119
- - 'lib/plurimath/formatter/numbers/base_notation.rb'
120
90
  - 'lib/plurimath/unicode_math/transform.rb'
121
91
 
122
- # Offense count: 5
123
- # This cop supports safe autocorrection (--autocorrect).
124
- # Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
125
- Layout/ExtraSpacing:
126
- Exclude:
127
- - 'lib/plurimath/unicode_math/parse.rb'
128
- - 'lib/plurimath/unicode_math/parsing_rules/common_rules.rb'
129
- - 'lib/plurimath/unicode_math/parsing_rules/masked.rb'
130
-
131
- # Offense count: 24
92
+ # Offense count: 35
132
93
  # This cop supports safe autocorrection (--autocorrect).
133
94
  # Configuration parameters: EnforcedStyle, IndentationWidth.
134
95
  # SupportedStyles: consistent, consistent_relative_to_receiver, special_for_inner_method_call, special_for_inner_method_call_in_parentheses
135
96
  Layout/FirstArgumentIndentation:
136
97
  Exclude:
137
98
  - 'lib/plurimath/formatter/numbers/notation_renderer.rb'
99
+ - 'lib/plurimath/math/number.rb'
138
100
  - 'lib/plurimath/unicode_math/transform.rb'
139
- - 'spec/plurimath/deprecation_spec.rb'
101
+ - 'spec/plurimath/math/evaluation_spec.rb'
140
102
 
141
- # Offense count: 20
103
+ # Offense count: 14
142
104
  # This cop supports safe autocorrection (--autocorrect).
143
105
  # Configuration parameters: EnforcedStyle, IndentationWidth.
144
106
  # SupportedStyles: special_inside_parentheses, consistent, align_brackets
145
107
  Layout/FirstArrayElementIndentation:
146
108
  Exclude:
147
109
  - 'lib/plurimath/unicode_math/transform.rb'
148
- - 'spec/plurimath/latex/parser_spec.rb'
149
- - 'spec/plurimath/mathml/parser_spec.rb'
150
110
 
151
- # Offense count: 2
152
- # This cop supports safe autocorrection (--autocorrect).
153
- # Configuration parameters: EnforcedStyle, IndentationWidth.
154
- # SupportedStyles: special_inside_parentheses, consistent, align_braces
155
- Layout/FirstHashElementIndentation:
156
- Exclude:
157
- - 'spec/plurimath/number_formatter_spec.rb'
158
-
159
- # Offense count: 31
111
+ # Offense count: 22
160
112
  # This cop supports safe autocorrection (--autocorrect).
161
113
  # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
162
114
  # SupportedHashRocketStyles: key, separator, table
@@ -164,12 +116,10 @@ Layout/FirstHashElementIndentation:
164
116
  # SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
165
117
  Layout/HashAlignment:
166
118
  Exclude:
167
- - 'lib/plurimath/html/transform.rb'
168
119
  - 'lib/plurimath/unicode_math/transform.rb'
169
120
  - 'spec/plurimath/formatter/numbers/base_notation_spec.rb'
170
- - 'spec/plurimath/formatter/numbers/format_options_spec.rb'
171
- - 'spec/plurimath/formatter/numbers/fraction_spec.rb'
172
- - 'spec/plurimath/number_formatter_spec.rb'
121
+ - 'spec/plurimath/math/evaluation_spec.rb'
122
+ - 'spec/plurimath/math/number_spec.rb'
173
123
 
174
124
  # Offense count: 4
175
125
  # This cop supports safe autocorrection (--autocorrect).
@@ -179,82 +129,52 @@ Layout/IndentationConsistency:
179
129
  Exclude:
180
130
  - 'lib/plurimath/unicode_math/transform.rb'
181
131
 
182
- # Offense count: 231
132
+ # Offense count: 60
183
133
  # This cop supports safe autocorrection (--autocorrect).
184
134
  # Configuration parameters: Width, EnforcedStyleAlignWith, AllowedPatterns.
185
135
  # SupportedStylesAlignWith: start_of_line, relative_to_receiver
186
136
  Layout/IndentationWidth:
187
- Enabled: false
188
-
189
- # Offense count: 2
190
- # This cop supports safe autocorrection (--autocorrect).
191
- # Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment, AllowRBSInlineAnnotation, AllowSteepAnnotation.
192
- Layout/LeadingCommentSpace:
193
137
  Exclude:
194
- - 'Gemfile'
138
+ - 'lib/plurimath/math/evaluation/evaluator.rb'
139
+ - 'lib/plurimath/unicode_math/transform.rb'
140
+ - 'spec/plurimath/math/evaluation_spec.rb'
195
141
 
196
- # Offense count: 29763
142
+ # Offense count: 29707
197
143
  # This cop supports safe autocorrection (--autocorrect).
198
144
  # Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
199
145
  # URISchemes: http, https
200
146
  Layout/LineLength:
201
147
  Enabled: false
202
148
 
203
- # Offense count: 1
204
- # This cop supports safe autocorrection (--autocorrect).
205
- # Configuration parameters: EnforcedStyle.
206
- # SupportedStyles: symmetrical, new_line, same_line
207
- Layout/MultilineHashBraceLayout:
208
- Exclude:
209
- - 'spec/plurimath/number_formatter_spec.rb'
210
-
211
- # Offense count: 9
149
+ # Offense count: 14
212
150
  # This cop supports safe autocorrection (--autocorrect).
213
151
  # Configuration parameters: EnforcedStyle.
214
152
  # SupportedStyles: symmetrical, new_line, same_line
215
153
  Layout/MultilineMethodCallBraceLayout:
216
154
  Exclude:
217
155
  - 'lib/plurimath/formatter/numbers/notation_renderer.rb'
156
+ - 'lib/plurimath/math/number.rb'
218
157
  - 'lib/plurimath/unicode_math/transform.rb'
219
- - 'spec/plurimath/deprecation_spec.rb'
158
+ - 'spec/plurimath/math/evaluation_spec.rb'
220
159
 
221
- # Offense count: 12
160
+ # Offense count: 2
222
161
  # This cop supports safe autocorrection (--autocorrect).
223
162
  # Configuration parameters: EnforcedStyle, IndentationWidth.
224
163
  # SupportedStyles: aligned, indented
225
164
  Layout/MultilineOperationIndentation:
226
165
  Exclude:
227
- - 'lib/plurimath/unicode_math/parse.rb'
228
- - 'lib/plurimath/unicode_math/parsing_rules/sub_sup.rb'
229
166
  - 'lib/plurimath/unicode_math/transform.rb'
230
167
 
231
- # Offense count: 3
232
- # This cop supports safe autocorrection (--autocorrect).
233
- # Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator, EnforcedStyleForRationalLiterals.
234
- # SupportedStylesForExponentOperator: space, no_space
235
- # SupportedStylesForRationalLiterals: space, no_space
236
- Layout/SpaceAroundOperators:
237
- Exclude:
238
- - 'lib/plurimath/unicode_math/parse.rb'
239
- - 'lib/plurimath/unicode_math/parsing_rules/common_rules.rb'
240
- - 'lib/plurimath/unicode_math/parsing_rules/masked.rb'
241
-
242
- # Offense count: 315
168
+ # Offense count: 266
243
169
  # This cop supports safe autocorrection (--autocorrect).
244
170
  # Configuration parameters: AllowInHeredoc.
245
171
  Layout/TrailingWhitespace:
246
172
  Enabled: false
247
173
 
248
- # Offense count: 118
174
+ # Offense count: 1
249
175
  # This cop supports safe autocorrection (--autocorrect).
250
176
  Lint/AmbiguousOperatorPrecedence:
251
177
  Exclude:
252
- - 'lib/plurimath/unicode_math/parse.rb'
253
- - 'lib/plurimath/unicode_math/parsing_rules/absence_rules.rb'
254
- - 'lib/plurimath/unicode_math/parsing_rules/common_rules.rb'
255
- - 'lib/plurimath/unicode_math/parsing_rules/constants_rules.rb'
256
- - 'lib/plurimath/unicode_math/parsing_rules/masked.rb'
257
- - 'lib/plurimath/unicode_math/parsing_rules/sub_sup.rb'
258
178
  - 'lib/plurimath/unicode_math/transform.rb'
259
179
 
260
180
  # Offense count: 1
@@ -338,7 +258,7 @@ Lint/UnmodifiedReduceAccumulator:
338
258
  - 'lib/plurimath/math/formula.rb'
339
259
  - 'lib/plurimath/math/function/fenced.rb'
340
260
 
341
- # Offense count: 4
261
+ # Offense count: 6
342
262
  # This cop supports safe autocorrection (--autocorrect).
343
263
  # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods, NotImplementedExceptions.
344
264
  # NotImplementedExceptions: NotImplementedError
@@ -346,17 +266,17 @@ Lint/UnusedMethodArgument:
346
266
  Exclude:
347
267
  - 'lib/plurimath/math/formula.rb'
348
268
  - 'lib/plurimath/math/function/left.rb'
349
- - 'lib/plurimath/unicode_math/parsing_rules/constants_rules.rb'
269
+ - 'lib/plurimath/number_formatter.rb'
350
270
  - 'lib/plurimath/utility.rb'
271
+ - 'spec/plurimath/math/number_spec.rb'
351
272
 
352
- # Offense count: 3
273
+ # Offense count: 2
353
274
  # This cop supports safe autocorrection (--autocorrect).
354
275
  Lint/UselessAssignment:
355
276
  Exclude:
356
- - 'lib/plurimath/unicode_math/parser.rb'
357
277
  - 'lib/plurimath/unicode_math/transform.rb'
358
278
 
359
- # Offense count: 154
279
+ # Offense count: 161
360
280
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
361
281
  Metrics/AbcSize:
362
282
  Enabled: false
@@ -372,17 +292,17 @@ Metrics/BlockLength:
372
292
  Metrics/BlockNesting:
373
293
  Max: 4
374
294
 
375
- # Offense count: 104
295
+ # Offense count: 106
376
296
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
377
297
  Metrics/CyclomaticComplexity:
378
298
  Enabled: false
379
299
 
380
- # Offense count: 162
300
+ # Offense count: 167
381
301
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
382
302
  Metrics/MethodLength:
383
303
  Max: 50
384
304
 
385
- # Offense count: 13
305
+ # Offense count: 16
386
306
  # Configuration parameters: CountKeywordArgs.
387
307
  Metrics/ParameterLists:
388
308
  Max: 6
@@ -438,19 +358,37 @@ Performance/CollectionLiteralInLoop:
438
358
  - 'lib/plurimath/utility/intent_encoding.rb'
439
359
  - 'spec/plurimath/formatter/numbers/fraction_spec.rb'
440
360
 
441
- # Offense count: 4649
361
+ # Offense count: 1
362
+ # This cop supports unsafe autocorrection (--autocorrect-all).
363
+ # Configuration parameters: SafeMultiline.
364
+ Performance/DeleteSuffix:
365
+ Exclude:
366
+ - 'lib/plurimath/formatter/numbers/source.rb'
367
+
368
+ # Offense count: 2
369
+ # This cop supports unsafe autocorrection (--autocorrect-all).
370
+ RSpec/BeEq:
371
+ Exclude:
372
+ - 'spec/plurimath/math/number_spec.rb'
373
+
374
+ # Offense count: 4650
442
375
  # Configuration parameters: Prefixes, AllowedPatterns.
443
376
  # Prefixes: when, with, without
444
377
  RSpec/ContextWording:
445
378
  Enabled: false
446
379
 
447
380
  # Offense count: 1
448
- # This cop supports safe autocorrection (--autocorrect).
449
- RSpec/EmptyLineAfterSubject:
381
+ # Configuration parameters: IgnoredMetadata.
382
+ RSpec/DescribeClass:
450
383
  Exclude:
451
- - 'spec/plurimath/math/number_spec.rb'
384
+ - '**/spec/features/**/*'
385
+ - '**/spec/requests/**/*'
386
+ - '**/spec/routing/**/*'
387
+ - '**/spec/system/**/*'
388
+ - '**/spec/views/**/*'
389
+ - 'spec/plurimath/base_prefix_parsing_spec.rb'
452
390
 
453
- # Offense count: 1581
391
+ # Offense count: 1635
454
392
  # Configuration parameters: CountAsOne.
455
393
  RSpec/ExampleLength:
456
394
  Max: 394
@@ -463,6 +401,18 @@ RSpec/ExampleWording:
463
401
  Exclude:
464
402
  - 'spec/plurimath/xml_engine_spec.rb'
465
403
 
404
+ # Offense count: 4
405
+ # This cop supports unsafe autocorrection (--autocorrect-all).
406
+ RSpec/IncludeExamples:
407
+ Exclude:
408
+ - 'spec/plurimath/base_prefix_parsing_spec.rb'
409
+
410
+ # Offense count: 1
411
+ # Configuration parameters: AssignmentOnly.
412
+ RSpec/InstanceVariable:
413
+ Exclude:
414
+ - 'spec/plurimath/base_prefix_parsing_spec.rb'
415
+
466
416
  # Offense count: 1
467
417
  RSpec/LeakyConstantDeclaration:
468
418
  Exclude:
@@ -484,7 +434,7 @@ RSpec/MultipleDescribes:
484
434
  Exclude:
485
435
  - 'spec/plurimath/deprecation_spec.rb'
486
436
 
487
- # Offense count: 470
437
+ # Offense count: 498
488
438
  RSpec/MultipleExpectations:
489
439
  Max: 12
490
440
 
@@ -519,13 +469,13 @@ RSpec/RepeatedExampleGroupBody:
519
469
  RSpec/RepeatedExampleGroupDescription:
520
470
  Enabled: false
521
471
 
522
- # Offense count: 26
472
+ # Offense count: 27
523
473
  # Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata, InflectorPath, EnforcedInflector.
524
474
  # SupportedInflectors: default, active_support
525
475
  RSpec/SpecFilePathFormat:
526
476
  Enabled: false
527
477
 
528
- # Offense count: 170
478
+ # Offense count: 21
529
479
  # This cop supports safe autocorrection (--autocorrect).
530
480
  # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
531
481
  # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
@@ -534,21 +484,9 @@ RSpec/SpecFilePathFormat:
534
484
  # AllowedMethods: lambda, proc, it
535
485
  Style/BlockDelimiters:
536
486
  Exclude:
537
- - 'lib/plurimath/math/core.rb'
538
- - 'lib/plurimath/unicode_math/parse.rb'
539
- - 'lib/plurimath/unicode_math/parser.rb'
540
- - 'lib/plurimath/unicode_math/parsing_rules/absence_rules.rb'
541
- - 'lib/plurimath/unicode_math/parsing_rules/common_rules.rb'
542
- - 'lib/plurimath/unicode_math/parsing_rules/constants_rules.rb'
543
- - 'lib/plurimath/unicode_math/parsing_rules/masked.rb'
544
- - 'lib/plurimath/unicode_math/parsing_rules/sub_sup.rb'
487
+ - 'lib/plurimath/math/evaluation/evaluator.rb'
545
488
  - 'lib/plurimath/unicode_math/transform.rb'
546
- - 'spec/plurimath/formatter/numbers/format_options_spec.rb'
547
- - 'spec/plurimath/formatter/numbers/fraction_spec.rb'
548
- - 'spec/plurimath/formatter/numbers/integer_spec.rb'
549
- - 'spec/plurimath/formatter/numbers/significant_spec.rb'
550
- - 'spec/plurimath/html/parser_spec.rb'
551
- - 'spec/plurimath/number_formatter_spec.rb'
489
+ - 'spec/plurimath/math/evaluation_spec.rb'
552
490
 
553
491
  # Offense count: 3
554
492
  # This cop supports unsafe autocorrection (--autocorrect-all).
@@ -578,24 +516,19 @@ Style/IfInsideElse:
578
516
  Exclude:
579
517
  - 'lib/plurimath/unicode_math/transform.rb'
580
518
 
581
- # Offense count: 47
519
+ # Offense count: 43
582
520
  # This cop supports safe autocorrection (--autocorrect).
583
521
  Style/MultilineIfModifier:
584
522
  Exclude:
585
- - 'lib/plurimath/formatter/numbers/format_options.rb'
586
- - 'lib/plurimath/formatter/numbers/fraction.rb'
587
523
  - 'lib/plurimath/formatter/numbers/notation_renderer.rb'
588
- - 'lib/plurimath/formatter/numbers/precision_resolver.rb'
589
- - 'lib/plurimath/math.rb'
590
- - 'lib/plurimath/math/core.rb'
591
- - 'lib/plurimath/omml/translator.rb'
524
+ - 'lib/plurimath/math/evaluation/evaluator.rb'
525
+ - 'lib/plurimath/math/function/log.rb'
592
526
  - 'lib/plurimath/unicode_math/transform.rb'
593
527
 
594
- # Offense count: 31
528
+ # Offense count: 30
595
529
  # This cop supports safe autocorrection (--autocorrect).
596
530
  Style/MultilineTernaryOperator:
597
531
  Exclude:
598
- - 'lib/plurimath/formatter/numbers/base_notation.rb'
599
532
  - 'lib/plurimath/unicode_math/transform.rb'
600
533
 
601
534
  # Offense count: 39
@@ -633,22 +566,12 @@ Style/QuotedSymbols:
633
566
  Exclude:
634
567
  - 'lib/plurimath/unicode_math/constants.rb'
635
568
 
636
- # Offense count: 86
569
+ # Offense count: 77
637
570
  # This cop supports safe autocorrection (--autocorrect).
638
571
  Style/RedundantParentheses:
639
572
  Exclude:
640
- - 'lib/plurimath/unicode_math/parse.rb'
641
- - 'lib/plurimath/unicode_math/parsing_rules/common_rules.rb'
642
- - 'lib/plurimath/unicode_math/parsing_rules/masked.rb'
643
- - 'lib/plurimath/unicode_math/parsing_rules/sub_sup.rb'
644
573
  - 'lib/plurimath/unicode_math/transform.rb'
645
574
 
646
- # Offense count: 1
647
- # This cop supports safe autocorrection (--autocorrect).
648
- Style/RedundantRegexpArgument:
649
- Exclude:
650
- - 'lib/plurimath/unicode_math/parser.rb'
651
-
652
575
  # Offense count: 1
653
576
  # This cop supports safe autocorrection (--autocorrect).
654
577
  Style/RedundantRegexpEscape:
@@ -667,21 +590,32 @@ Style/SafeNavigationChainLength:
667
590
  - 'lib/plurimath/utility.rb'
668
591
  - 'lib/plurimath/utility/intent_encoding.rb'
669
592
 
670
- # Offense count: 75
593
+ # Offense count: 76
671
594
  # This cop supports safe autocorrection (--autocorrect).
672
595
  # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
673
596
  # SupportedStyles: single_quotes, double_quotes
674
597
  Style/StringLiterals:
675
598
  Exclude:
599
+ - 'lib/plurimath/formatter/numbers/source.rb'
676
600
  - 'lib/plurimath/unicode_math/constants.rb'
677
601
 
678
- # Offense count: 44
602
+ # Offense count: 4
603
+ # This cop supports safe autocorrection (--autocorrect).
604
+ # Configuration parameters: .
605
+ # SupportedStyles: percent, brackets
606
+ Style/SymbolArray:
607
+ EnforcedStyle: percent
608
+ MinSize: 3
609
+
610
+ # Offense count: 70
679
611
  # This cop supports safe autocorrection (--autocorrect).
680
612
  # Configuration parameters: EnforcedStyleForMultiline.
681
613
  # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
682
614
  Style/TrailingCommaInArguments:
683
615
  Exclude:
684
616
  - 'lib/plurimath/unicode_math/transform.rb'
617
+ - 'spec/plurimath/formatter/numbers/formatted_notation_spec.rb'
618
+ - 'spec/plurimath/formatter/numbers/formatted_number_spec.rb'
685
619
 
686
620
  # Offense count: 4
687
621
  # This cop supports safe autocorrection (--autocorrect).
@@ -691,14 +625,13 @@ Style/TrailingCommaInArrayLiteral:
691
625
  Exclude:
692
626
  - 'lib/plurimath/unicode_math/transform.rb'
693
627
 
694
- # Offense count: 7
628
+ # Offense count: 6
695
629
  # This cop supports safe autocorrection (--autocorrect).
696
630
  # Configuration parameters: EnforcedStyleForMultiline.
697
631
  # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
698
632
  Style/TrailingCommaInHashLiteral:
699
633
  Exclude:
700
634
  - 'lib/plurimath/unicode_math/constants.rb'
701
- - 'lib/plurimath/unicode_math/parser.rb'
702
635
 
703
636
  # Offense count: 15
704
637
  # This cop supports unsafe autocorrection (--autocorrect-all).
data/Gemfile CHANGED
@@ -15,3 +15,4 @@ gem "rubocop-performance"
15
15
  gem "rubocop-rake"
16
16
  gem "rubocop-rspec"
17
17
  gem "simplecov", require: false, group: :test
18
+ gem "irb", group: :development