asciimath 1.0.9 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +5 -5
  2. data/AST.adoc +457 -0
  3. data/CHANGELOG.adoc +12 -0
  4. data/Gemfile.lock +39 -0
  5. data/README.adoc +27 -3
  6. data/asciimath.gemspec +9 -5
  7. data/lib/asciimath.rb +5 -4
  8. data/lib/asciimath/ast.rb +456 -0
  9. data/lib/asciimath/cli.rb +4 -1
  10. data/lib/asciimath/color_table.rb +21 -0
  11. data/lib/asciimath/html.rb +126 -111
  12. data/lib/asciimath/latex.rb +386 -0
  13. data/lib/asciimath/markup.rb +478 -0
  14. data/lib/asciimath/mathml.rb +189 -87
  15. data/lib/asciimath/parser.rb +498 -343
  16. data/lib/asciimath/symbol_table.rb +25 -0
  17. data/lib/asciimath/version.rb +1 -1
  18. data/spec/ast.rb +144 -0
  19. data/spec/parser_spec.rb +592 -165
  20. data/spec/schema/mathml2/common/common-attribs.xsd +41 -0
  21. data/spec/schema/mathml2/common/math.xsd +126 -0
  22. data/spec/schema/mathml2/common/xlink-href.xsd +20 -0
  23. data/spec/schema/mathml2/content/arith.xsd +90 -0
  24. data/spec/schema/mathml2/content/calculus.xsd +146 -0
  25. data/spec/schema/mathml2/content/common-attrib.xsd +30 -0
  26. data/spec/schema/mathml2/content/constants.xsd +83 -0
  27. data/spec/schema/mathml2/content/constructs.xsd +260 -0
  28. data/spec/schema/mathml2/content/elementary-functions.xsd +117 -0
  29. data/spec/schema/mathml2/content/functions.xsd +73 -0
  30. data/spec/schema/mathml2/content/linear-algebra.xsd +173 -0
  31. data/spec/schema/mathml2/content/logic.xsd +53 -0
  32. data/spec/schema/mathml2/content/relations.xsd +55 -0
  33. data/spec/schema/mathml2/content/semantics.xsd +85 -0
  34. data/spec/schema/mathml2/content/sets.xsd +236 -0
  35. data/spec/schema/mathml2/content/statistics.xsd +136 -0
  36. data/spec/schema/mathml2/content/tokens.xsd +120 -0
  37. data/spec/schema/mathml2/content/vector-calculus.xsd +88 -0
  38. data/spec/schema/mathml2/mathml2.xsd +59 -0
  39. data/spec/schema/mathml2/presentation/action.xsd +44 -0
  40. data/spec/schema/mathml2/presentation/characters.xsd +37 -0
  41. data/spec/schema/mathml2/presentation/common-attribs.xsd +113 -0
  42. data/spec/schema/mathml2/presentation/common-types.xsd +103 -0
  43. data/spec/schema/mathml2/presentation/error.xsd +40 -0
  44. data/spec/schema/mathml2/presentation/layout.xsd +195 -0
  45. data/spec/schema/mathml2/presentation/scripts.xsd +186 -0
  46. data/spec/schema/mathml2/presentation/space.xsd +52 -0
  47. data/spec/schema/mathml2/presentation/style.xsd +69 -0
  48. data/spec/schema/mathml2/presentation/table.xsd +216 -0
  49. data/spec/schema/mathml2/presentation/tokens.xsd +124 -0
  50. data/spec/schema/mathml3/mathml3-common.xsd +99 -0
  51. data/spec/schema/mathml3/mathml3-content.xsd +684 -0
  52. data/spec/schema/mathml3/mathml3-presentation.xsd +2151 -0
  53. data/spec/schema/mathml3/mathml3-strict-content.xsd +186 -0
  54. data/spec/schema/mathml3/mathml3.xsd +9 -0
  55. metadata +102 -10
  56. data/.gitignore +0 -16
  57. data/.travis.yml +0 -18
@@ -0,0 +1,186 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
3
+ xmlns:m="http://www.w3.org/1998/Math/MathML"
4
+ elementFormDefault="qualified"
5
+ targetNamespace="http://www.w3.org/1998/Math/MathML">
6
+ <xs:group name="ContExp">
7
+ <xs:choice>
8
+ <!--Ambiguous content model altered (ContExp)-->
9
+ <xs:element ref="m:apply"/>
10
+ <xs:element ref="m:bind"/>
11
+ <xs:element ref="m:ci"/>
12
+ <xs:element ref="m:cn"/>
13
+ <xs:element ref="m:csymbol"/>
14
+ <xs:element ref="m:cbytes"/>
15
+ <xs:element ref="m:cerror"/>
16
+ <xs:element ref="m:cs"/>
17
+ <xs:element ref="m:share"/>
18
+ <xs:element ref="m:piecewise"/>
19
+ <xs:element ref="m:DeprecatedContExp"/>
20
+ <xs:element ref="m:interval.class"/>
21
+ <xs:element ref="m:unary-functional.class"/>
22
+ <xs:element ref="m:lambda.class"/>
23
+ <xs:element ref="m:nary-functional.class"/>
24
+ <xs:group ref="m:binary-arith.class"/>
25
+ <xs:group ref="m:unary-arith.class"/>
26
+ <xs:element ref="m:nary-minmax.class"/>
27
+ <xs:element ref="m:nary-arith.class"/>
28
+ <xs:element ref="m:nary-logical.class"/>
29
+ <xs:element ref="m:unary-logical.class"/>
30
+ <xs:element ref="m:binary-logical.class"/>
31
+ <xs:element ref="m:quantifier.class"/>
32
+ <xs:element ref="m:nary-reln.class"/>
33
+ <xs:element ref="m:binary-reln.class"/>
34
+ <xs:element ref="m:int.class"/>
35
+ <xs:element ref="m:Differential-Operator.class"/>
36
+ <xs:element ref="m:partialdiff.class"/>
37
+ <xs:element ref="m:unary-veccalc.class"/>
38
+ <xs:element ref="m:nary-setlist-constructor.class"/>
39
+ <xs:element ref="m:nary-set.class"/>
40
+ <xs:element ref="m:binary-set.class"/>
41
+ <xs:element ref="m:nary-set-reln.class"/>
42
+ <xs:element ref="m:unary-set.class"/>
43
+ <xs:element ref="m:sum.class"/>
44
+ <xs:element ref="m:product.class"/>
45
+ <xs:element ref="m:limit.class"/>
46
+ <xs:element ref="m:unary-elementary.class"/>
47
+ <xs:element ref="m:nary-stats.class"/>
48
+ <xs:element ref="m:nary-constructor.class"/>
49
+ <xs:element ref="m:unary-linalg.class"/>
50
+ <xs:element ref="m:nary-linalg.class"/>
51
+ <xs:element ref="m:binary-linalg.class"/>
52
+ <xs:element ref="m:constant-set.class"/>
53
+ <xs:element ref="m:constant-arith.class"/>
54
+ </xs:choice>
55
+ </xs:group>
56
+ <xs:element name="cn">
57
+ <xs:complexType>
58
+ <xs:complexContent>
59
+ <xs:extension base="m:cn.content">
60
+ <xs:attributeGroup ref="m:cn.attributes"/>
61
+ </xs:extension>
62
+ </xs:complexContent>
63
+ </xs:complexType>
64
+ </xs:element>
65
+ <xs:group name="semantics-ci">
66
+ <xs:sequence>
67
+ <xs:element name="semantics">
68
+ <xs:complexType>
69
+ <xs:sequence>
70
+ <xs:choice>
71
+ <xs:element ref="m:ci"/>
72
+ <xs:group ref="m:semantics-ci"/>
73
+ </xs:choice>
74
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
75
+ <xs:element ref="m:annotation"/>
76
+ <xs:element ref="m:annotation-xml"/>
77
+ </xs:choice>
78
+ </xs:sequence>
79
+ <xs:attributeGroup ref="m:semantics.attributes"/>
80
+ </xs:complexType>
81
+ </xs:element>
82
+ </xs:sequence>
83
+ </xs:group>
84
+ <xs:group name="semantics-contexp">
85
+ <xs:sequence>
86
+ <xs:element name="semantics">
87
+ <xs:complexType>
88
+ <xs:sequence>
89
+ <xs:group ref="m:ContExp"/>
90
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
91
+ <xs:element ref="m:annotation"/>
92
+ <xs:element ref="m:annotation-xml"/>
93
+ </xs:choice>
94
+ </xs:sequence>
95
+ <xs:attributeGroup ref="m:semantics.attributes"/>
96
+ </xs:complexType>
97
+ </xs:element>
98
+ </xs:sequence>
99
+ </xs:group>
100
+ <xs:element name="ci">
101
+ <xs:complexType>
102
+ <xs:complexContent>
103
+ <xs:extension base="m:ci.content">
104
+ <xs:attributeGroup ref="m:ci.attributes"/>
105
+ </xs:extension>
106
+ </xs:complexContent>
107
+ </xs:complexType>
108
+ </xs:element>
109
+ <xs:element name="csymbol">
110
+ <xs:complexType>
111
+ <xs:complexContent>
112
+ <xs:extension base="m:csymbol.content">
113
+ <xs:attributeGroup ref="m:csymbol.attributes"/>
114
+ </xs:extension>
115
+ </xs:complexContent>
116
+ </xs:complexType>
117
+ </xs:element>
118
+ <xs:simpleType name="SymbolName">
119
+ <xs:restriction base="xs:NCName"/>
120
+ </xs:simpleType>
121
+ <xs:group name="BvarQ">
122
+ <xs:sequence>
123
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="m:bvar"/>
124
+ </xs:sequence>
125
+ </xs:group>
126
+ <xs:element name="apply">
127
+ <xs:complexType>
128
+ <xs:complexContent>
129
+ <xs:extension base="m:apply.content">
130
+ <xs:attributeGroup ref="m:CommonAtt"/>
131
+ </xs:extension>
132
+ </xs:complexContent>
133
+ </xs:complexType>
134
+ </xs:element>
135
+ <xs:element name="bind">
136
+ <xs:complexType>
137
+ <xs:complexContent>
138
+ <xs:extension base="m:bind.content">
139
+ <xs:attributeGroup ref="m:CommonAtt"/>
140
+ </xs:extension>
141
+ </xs:complexContent>
142
+ </xs:complexType>
143
+ </xs:element>
144
+ <xs:element name="share">
145
+ <xs:complexType>
146
+ <xs:attributeGroup ref="m:CommonAtt"/>
147
+ <xs:attributeGroup ref="m:src"/>
148
+ </xs:complexType>
149
+ </xs:element>
150
+ <xs:element name="cerror">
151
+ <xs:complexType>
152
+ <xs:sequence>
153
+ <xs:element ref="m:csymbol"/>
154
+ <xs:group minOccurs="0" maxOccurs="unbounded" ref="m:ContExp"/>
155
+ </xs:sequence>
156
+ <xs:attributeGroup ref="m:cerror.attributes"/>
157
+ </xs:complexType>
158
+ </xs:element>
159
+ <xs:attributeGroup name="cerror.attributes">
160
+ <xs:attributeGroup ref="m:CommonAtt"/>
161
+ </xs:attributeGroup>
162
+ <xs:element name="cbytes">
163
+ <xs:complexType>
164
+ <xs:simpleContent>
165
+ <xs:extension base="m:base64">
166
+ <xs:attributeGroup ref="m:cbytes.attributes"/>
167
+ </xs:extension>
168
+ </xs:simpleContent>
169
+ </xs:complexType>
170
+ </xs:element>
171
+ <xs:simpleType name="base64">
172
+ <xs:restriction base="xs:base64Binary"/>
173
+ </xs:simpleType>
174
+ <xs:element name="cs">
175
+ <xs:complexType mixed="true">
176
+ <xs:attributeGroup ref="m:cs.attributes"/>
177
+ </xs:complexType>
178
+ </xs:element>
179
+ <xs:group name="MathExpression">
180
+ <xs:choice>
181
+ <xs:group ref="m:ContExp"/>
182
+ <xs:element ref="m:PresentationExpression"/>
183
+ <xs:group ref="m:semantics"/>
184
+ </xs:choice>
185
+ </xs:group>
186
+ </xs:schema>
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
3
+ xmlns:m="http://www.w3.org/1998/Math/MathML"
4
+ elementFormDefault="qualified"
5
+ targetNamespace="http://www.w3.org/1998/Math/MathML">
6
+ <xs:include schemaLocation="mathml3-content.xsd"/>
7
+ <xs:include schemaLocation="mathml3-presentation.xsd"/>
8
+ <xs:include schemaLocation="mathml3-common.xsd"/>
9
+ </xs:schema>
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciimath
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pepijn Van Eeckhoudt
8
+ - Gark Garcia
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2019-10-26 00:00:00.000000000 Z
12
+ date: 2020-05-13 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: bundler
@@ -30,52 +31,108 @@ dependencies:
30
31
  requirements:
31
32
  - - "~>"
32
33
  - !ruby/object:Gem::Version
33
- version: '10.0'
34
+ version: 13.0.0
34
35
  type: :development
35
36
  prerelease: false
36
37
  version_requirements: !ruby/object:Gem::Requirement
37
38
  requirements:
38
39
  - - "~>"
39
40
  - !ruby/object:Gem::Version
40
- version: '10.0'
41
+ version: 13.0.0
41
42
  - !ruby/object:Gem::Dependency
42
43
  name: rspec
43
44
  requirement: !ruby/object:Gem::Requirement
44
45
  requirements:
45
46
  - - "~>"
46
47
  - !ruby/object:Gem::Version
47
- version: 3.1.0
48
+ version: 3.9.0
48
49
  type: :development
49
50
  prerelease: false
50
51
  version_requirements: !ruby/object:Gem::Requirement
51
52
  requirements:
52
53
  - - "~>"
53
54
  - !ruby/object:Gem::Version
54
- version: 3.1.0
55
+ version: 3.9.0
56
+ - !ruby/object:Gem::Dependency
57
+ name: nokogiri
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: 1.10.9
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: 1.10.9
55
70
  description: A pure Ruby AsciiMath parsing and conversion library.
56
71
  email:
57
72
  - pepijn@vaneeckhoudt.net
73
+ - pablo-ecobar@riseup.net
58
74
  executables:
59
75
  - asciimath
60
76
  extensions: []
61
77
  extra_rdoc_files: []
62
78
  files:
63
- - ".gitignore"
64
- - ".travis.yml"
79
+ - AST.adoc
65
80
  - CHANGELOG.adoc
66
81
  - Gemfile
82
+ - Gemfile.lock
67
83
  - LICENSE.txt
68
84
  - README.adoc
69
85
  - Rakefile
70
86
  - asciimath.gemspec
71
87
  - bin/asciimath
72
88
  - lib/asciimath.rb
89
+ - lib/asciimath/ast.rb
73
90
  - lib/asciimath/cli.rb
91
+ - lib/asciimath/color_table.rb
74
92
  - lib/asciimath/html.rb
93
+ - lib/asciimath/latex.rb
94
+ - lib/asciimath/markup.rb
75
95
  - lib/asciimath/mathml.rb
76
96
  - lib/asciimath/parser.rb
97
+ - lib/asciimath/symbol_table.rb
77
98
  - lib/asciimath/version.rb
99
+ - spec/ast.rb
78
100
  - spec/parser_spec.rb
101
+ - spec/schema/mathml2/common/common-attribs.xsd
102
+ - spec/schema/mathml2/common/math.xsd
103
+ - spec/schema/mathml2/common/xlink-href.xsd
104
+ - spec/schema/mathml2/content/arith.xsd
105
+ - spec/schema/mathml2/content/calculus.xsd
106
+ - spec/schema/mathml2/content/common-attrib.xsd
107
+ - spec/schema/mathml2/content/constants.xsd
108
+ - spec/schema/mathml2/content/constructs.xsd
109
+ - spec/schema/mathml2/content/elementary-functions.xsd
110
+ - spec/schema/mathml2/content/functions.xsd
111
+ - spec/schema/mathml2/content/linear-algebra.xsd
112
+ - spec/schema/mathml2/content/logic.xsd
113
+ - spec/schema/mathml2/content/relations.xsd
114
+ - spec/schema/mathml2/content/semantics.xsd
115
+ - spec/schema/mathml2/content/sets.xsd
116
+ - spec/schema/mathml2/content/statistics.xsd
117
+ - spec/schema/mathml2/content/tokens.xsd
118
+ - spec/schema/mathml2/content/vector-calculus.xsd
119
+ - spec/schema/mathml2/mathml2.xsd
120
+ - spec/schema/mathml2/presentation/action.xsd
121
+ - spec/schema/mathml2/presentation/characters.xsd
122
+ - spec/schema/mathml2/presentation/common-attribs.xsd
123
+ - spec/schema/mathml2/presentation/common-types.xsd
124
+ - spec/schema/mathml2/presentation/error.xsd
125
+ - spec/schema/mathml2/presentation/layout.xsd
126
+ - spec/schema/mathml2/presentation/scripts.xsd
127
+ - spec/schema/mathml2/presentation/space.xsd
128
+ - spec/schema/mathml2/presentation/style.xsd
129
+ - spec/schema/mathml2/presentation/table.xsd
130
+ - spec/schema/mathml2/presentation/tokens.xsd
131
+ - spec/schema/mathml3/mathml3-common.xsd
132
+ - spec/schema/mathml3/mathml3-content.xsd
133
+ - spec/schema/mathml3/mathml3-presentation.xsd
134
+ - spec/schema/mathml3/mathml3-strict-content.xsd
135
+ - spec/schema/mathml3/mathml3.xsd
79
136
  - style/math.css
80
137
  homepage: ''
81
138
  licenses:
@@ -96,10 +153,45 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
153
  - !ruby/object:Gem::Version
97
154
  version: '0'
98
155
  requirements: []
99
- rubyforge_project:
100
- rubygems_version: 2.5.1
156
+ rubygems_version: 3.0.3
101
157
  signing_key:
102
158
  specification_version: 4
103
159
  summary: AsciiMath parser and converter
104
160
  test_files:
161
+ - spec/ast.rb
105
162
  - spec/parser_spec.rb
163
+ - spec/schema/mathml2/common/common-attribs.xsd
164
+ - spec/schema/mathml2/common/math.xsd
165
+ - spec/schema/mathml2/common/xlink-href.xsd
166
+ - spec/schema/mathml2/content/arith.xsd
167
+ - spec/schema/mathml2/content/calculus.xsd
168
+ - spec/schema/mathml2/content/common-attrib.xsd
169
+ - spec/schema/mathml2/content/constants.xsd
170
+ - spec/schema/mathml2/content/constructs.xsd
171
+ - spec/schema/mathml2/content/elementary-functions.xsd
172
+ - spec/schema/mathml2/content/functions.xsd
173
+ - spec/schema/mathml2/content/linear-algebra.xsd
174
+ - spec/schema/mathml2/content/logic.xsd
175
+ - spec/schema/mathml2/content/relations.xsd
176
+ - spec/schema/mathml2/content/semantics.xsd
177
+ - spec/schema/mathml2/content/sets.xsd
178
+ - spec/schema/mathml2/content/statistics.xsd
179
+ - spec/schema/mathml2/content/tokens.xsd
180
+ - spec/schema/mathml2/content/vector-calculus.xsd
181
+ - spec/schema/mathml2/mathml2.xsd
182
+ - spec/schema/mathml2/presentation/action.xsd
183
+ - spec/schema/mathml2/presentation/characters.xsd
184
+ - spec/schema/mathml2/presentation/common-attribs.xsd
185
+ - spec/schema/mathml2/presentation/common-types.xsd
186
+ - spec/schema/mathml2/presentation/error.xsd
187
+ - spec/schema/mathml2/presentation/layout.xsd
188
+ - spec/schema/mathml2/presentation/scripts.xsd
189
+ - spec/schema/mathml2/presentation/space.xsd
190
+ - spec/schema/mathml2/presentation/style.xsd
191
+ - spec/schema/mathml2/presentation/table.xsd
192
+ - spec/schema/mathml2/presentation/tokens.xsd
193
+ - spec/schema/mathml3/mathml3-common.xsd
194
+ - spec/schema/mathml3/mathml3-content.xsd
195
+ - spec/schema/mathml3/mathml3-presentation.xsd
196
+ - spec/schema/mathml3/mathml3-strict-content.xsd
197
+ - spec/schema/mathml3/mathml3.xsd
data/.gitignore DELETED
@@ -1,16 +0,0 @@
1
- /.idea/
2
- /.bundle/
3
- /.yardoc
4
- /Gemfile.lock
5
- /_yardoc/
6
- /coverage/
7
- /doc/
8
- /pkg/
9
- /spec/reports/
10
- /tmp/
11
- *.bundle
12
- *.so
13
- *.o
14
- *.a
15
- *.iml
16
- mkmf.log
@@ -1,18 +0,0 @@
1
- language: ruby
2
- cache:
3
- apt: true
4
- directories:
5
- - vendor/bundle
6
- - $HOME/.cache/pip
7
- rvm:
8
- - 1.9
9
- - 2.3
10
- - 2.4
11
- - 2.5
12
- - jruby-1.7.27
13
- - jruby
14
- - truffleruby
15
- before_install:
16
- - type bundle || gem install bundler --version '~> 1.0'
17
- install:
18
- - bundle install --path vendor/bundle --jobs=3 --retry=3