rsyntaxtree 0.7.3 → 0.7.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: '0586aec9488760401c729ef70db38c730883341e'
4
- data.tar.gz: f9f95b8713cbcef850c3be737e5cd2cd2c3babe5
3
+ metadata.gz: f3943676da7a1329b22b9cc0eadd8e02f9386a2a
4
+ data.tar.gz: 85d11c50038206a19b0bcff9c2b644b9d9c6b36b
5
5
  SHA512:
6
- metadata.gz: cbbe7a1e063d5098f40b0f67b1fe832b92ff58b3bb7d9b3823ccafae6979dd1930c7b7ac5f787b0cdf17eeda267c15faf5c2305b843576cff15b83f062bd6be3
7
- data.tar.gz: dfa583dbcf971ccaab04ce2db7f3dd633e0110e575063ab82cf80b740e73348397d41afa6922595d2a12c0a709b717f48ac7949f626d0235a907eb14223f1e76
6
+ metadata.gz: a0e71eeff8ab7f0242059efb5e32a06bd0b53c08b1454bf60aaedbf4d60bdfd0d6aeb66ec5959ab0c63da33055597d8ae23f3bf5e262d42e322cf2cf927f85af
7
+ data.tar.gz: 422647a20c14a9f985a31e89de81e0a5159477dab18e4e09bb573fce7284d8e3ce91fb159995dceca12d604b49a7a22eac08a8ea92f90b70997d90695bad7678
data/README.md CHANGED
@@ -45,6 +45,8 @@ There are several modes in which the connectors between terminal nodes and their
45
45
 
46
46
  You can put a subscript to any node by putting the _ character between the main label and the subscript. For example, NP_TOP will be rendered as NP<sub>TOP</sub>. Or you can select the &#8220;Auto subscript&#8221; option so that nodes of the same label will be automatically numbered. (e.g. NP<sub>1</sub>, NP<sub>2</sub>)</p>
47
47
 
48
+ See https://yohasebe.com/rsyntaxtree for more detailed info about the syntax.
49
+
48
50
  ### Example
49
51
 
50
52
  Bracket notation (auto-subscript-on):
@@ -203,8 +203,12 @@ class StringParser
203
203
 
204
204
  if spaceat
205
205
  parts[0] = token_r[0, spaceat].join
206
+ parts[0] = parts[0].gsub("<>", " ")
207
+
206
208
  tl =token_r.length
207
209
  parts[1] = token_r[spaceat, tl - spaceat].join
210
+ parts[1] = parts[1].gsub("<>", " ")
211
+
208
212
  element = Element.new(@id, parent, parts[0], @level)
209
213
  @id += 1
210
214
  @elist.add(element)
@@ -215,11 +219,12 @@ class StringParser
215
219
  @id += 1
216
220
  @elist.add(element)
217
221
  else
218
- element = Element.new(@id, parent, token_r.join, @level)
222
+ joined = token_r.join.gsub("<>", " ")
223
+ element = Element.new(@id, parent, joined, @level)
219
224
  @id += 1
220
225
  newparent = element.id
221
226
  @elist.add(element)
222
- count_node(token_r.join)
227
+ count_node(joined)
223
228
  end
224
229
 
225
230
  @level += 1
@@ -109,17 +109,17 @@ class TreeGraph < Graph
109
109
 
110
110
  if /\A\*\*\*(.+)\*\*\*\z/ =~ main
111
111
  main = $1
112
- if !@multibyte || !main.contains_cjk?
112
+ if !@multibyte
113
113
  main_font = @font_itbd
114
114
  end
115
115
  elsif /\A\*\*(.+)\*\*\z/ =~ main
116
116
  main = $1
117
- if !@multibyte || !main.contains_cjk?
117
+ if !@multibyte
118
118
  main_font = @font_bd
119
119
  end
120
120
  elsif /\A\*(.+)\*\z/ =~ main
121
121
  main = $1
122
- if !@multibyte || !main.contains_cjk?
122
+ if !@multibyte
123
123
  main_font = @font_it
124
124
  end
125
125
  else
@@ -150,17 +150,17 @@ class TreeGraph < Graph
150
150
 
151
151
  if /\A\*\*\*(.+)\*\*\*\z/ =~ sub
152
152
  sub = $1
153
- if !@multibyte || !sub.contains_cjk?
153
+ if !@multibyte
154
154
  sub_font = @font_itbd
155
155
  end
156
156
  elsif /\A\*\*(.+)\*\*\z/ =~ sub
157
157
  sub = $1
158
- if !@multibyte || !sub.contains_cjk?
158
+ if !@multibyte
159
159
  sub_font = @font_bd
160
160
  end
161
161
  elsif /\A\*(.+)\*\z/ =~ sub
162
162
  sub = $1
163
- if !@multibyte || !sub.contains_cjk?
163
+ if !@multibyte
164
164
  sub_font = @font_it
165
165
  end
166
166
  else
@@ -1,4 +1,4 @@
1
1
  module RSyntaxTree
2
- VERSION = "0.7.3"
2
+ VERSION = "0.7.5"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsyntaxtree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3
4
+ version: 0.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoichiro Hasebe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-21 00:00:00.000000000 Z
11
+ date: 2018-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rmagick