rdoc 6.6.0 → 6.6.1

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
  SHA256:
3
- metadata.gz: 947667e0cc733b38e36c829627ea1cca454420e44124b9536bf7f6ab7c687688
4
- data.tar.gz: ce0d8a98c383e7c6b03138fbb62a31626bb24a20be3967aefa3c29a302b0d9f6
3
+ metadata.gz: 0b065b8eb430d44d3590ff47f2a649fbdde2cd01e1d45690b503e874664c0e35
4
+ data.tar.gz: '0122984ed2155f7455ff3c7229cee18f7e7e57723ef7210c8c3b77453cd05590'
5
5
  SHA512:
6
- metadata.gz: dd6e321fe810da6ed4b5257df5347474adb514b061c9c5ad981c57feef340544e6e51fe9bfe48ef31bc7eaa87fc179883635d5448f6f2ab669443adcd6e98d46
7
- data.tar.gz: 1c7d9158ca93ab8a913f282d6a641bc6d2f69eecf779b452d93fb935f6fde8e0e536d186ca8c2eba90a58a31ffd34cffd9af7a220fd5ff0ed63da6cf68ad8ed2
6
+ metadata.gz: 403154275fe0a89423cb91a84227a5c821c018ed6e5a741b10741768fde727c2721ae4a3bb0ba57baf756d86609248202bcb76a9a505b2b1ad03f76e4e460a4f
7
+ data.tar.gz: 5c4dcb7981173716d2ec6a6282b26da0994e91c9e821fea09cab7a713b974825687e77131418f02cd0317c075fe2c83baf840a60c71649a1307b44f51ca7054c
@@ -87,6 +87,17 @@ pre {
87
87
  border-radius: 0.2em;
88
88
  }
89
89
 
90
+ em {
91
+ text-decoration-color: rgba(52, 48, 64, 0.25);
92
+ text-decoration-line: underline;
93
+ text-decoration-style: dotted;
94
+ }
95
+
96
+ strong,
97
+ em {
98
+ background-color: rgba(158, 178, 255, 0.1);
99
+ }
100
+
90
101
  table {
91
102
  margin: 0;
92
103
  border-spacing: 0;
@@ -64,9 +64,6 @@ class RDoc::Markdown::Literals
64
64
  def current_line(target=pos)
65
65
  if line = position_line_offsets.bsearch_index {|x| x > target }
66
66
  return line + 1
67
- elsif target == string.size
68
- past_last = !string.empty? && string[-1]=="\n" ? 1 : 0
69
- return position_line_offsets.size + past_last
70
67
  end
71
68
  raise "Target position #{target} is outside of string"
72
69
  end
@@ -74,22 +71,17 @@ class RDoc::Markdown::Literals
74
71
  def current_line(target=pos)
75
72
  if line = position_line_offsets.index {|x| x > target }
76
73
  return line + 1
77
- elsif target == string.size
78
- past_last = !string.empty? && string[-1]=="\n" ? 1 : 0
79
- return position_line_offsets.size + past_last
80
74
  end
75
+
81
76
  raise "Target position #{target} is outside of string"
82
77
  end
83
78
  end
84
79
 
85
80
  def current_character(target=pos)
86
- if target < 0 || target > string.size
81
+ if target < 0 || target >= string.size
87
82
  raise "Target position #{target} is outside of string"
88
- elsif target == string.size
89
- ""
90
- else
91
- string[target, 1]
92
83
  end
84
+ string[target, 1]
93
85
  end
94
86
 
95
87
  KpegPosInfo = Struct.new(:pos, :lno, :col, :line, :char)
@@ -208,15 +200,6 @@ class RDoc::Markdown::Literals
208
200
 
209
201
  attr_reader :failed_rule
210
202
 
211
- def match_dot()
212
- if @pos >= @string_size
213
- return nil
214
- end
215
-
216
- @pos += 1
217
- true
218
- end
219
-
220
203
  def match_string(str)
221
204
  len = str.size
222
205
  if @string[pos,len] == str
@@ -237,26 +220,24 @@ class RDoc::Markdown::Literals
237
220
  end
238
221
 
239
222
  if "".respond_to? :ord
240
- def match_char_range(char_range)
223
+ def get_byte
241
224
  if @pos >= @string_size
242
225
  return nil
243
- elsif !char_range.include?(@string[@pos].ord)
244
- return nil
245
226
  end
246
227
 
228
+ s = @string[@pos].ord
247
229
  @pos += 1
248
- true
230
+ s
249
231
  end
250
232
  else
251
- def match_char_range(char_range)
233
+ def get_byte
252
234
  if @pos >= @string_size
253
235
  return nil
254
- elsif !char_range.include?(@string[@pos])
255
- return nil
256
236
  end
257
237
 
238
+ s = @string[@pos]
258
239
  @pos += 1
259
- true
240
+ s
260
241
  end
261
242
  end
262
243
 
@@ -90,7 +90,7 @@ class RDoc::Markup::Formatter
90
90
 
91
91
  def add_regexp_handling_TIDYLINK
92
92
  @markup.add_regexp_handling(/(?:
93
- \{.*?\} | # multi-word label
93
+ \{[^{}]*\} | # multi-word label
94
94
  \b[^\s{}]+? # single-word label
95
95
  )
96
96
 
@@ -218,7 +218,7 @@ class RDoc::Markup::Parser
218
218
 
219
219
  break if peek_token.first == :BREAK
220
220
 
221
- data << ' ' if skip :NEWLINE
221
+ data << ' ' if skip :NEWLINE and /#{SPACE_SEPARATED_LETTER_CLASS}\z/o.match?(data)
222
222
  else
223
223
  unget
224
224
  break
@@ -202,7 +202,9 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
202
202
  def accept_paragraph paragraph
203
203
  @res << "\n<p>"
204
204
  text = paragraph.text @hard_break
205
- text = text.gsub(/\r?\n/, ' ')
205
+ text = text.gsub(/(#{SPACE_SEPARATED_LETTER_CLASS})?\K\r?\n(?=(?(1)(#{SPACE_SEPARATED_LETTER_CLASS})?))/o) {
206
+ defined?($2) && ' '
207
+ }
206
208
  @res << to_html(text)
207
209
  @res << "</p>\n"
208
210
  end
@@ -1,11 +1,659 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
3
  # DO NOT MODIFY!!!!
4
- # This file is automatically generated by Racc 1.7.1
5
- # from Racc grammar file "".
4
+ # This file is automatically generated by Racc 1.7.3
5
+ # from Racc grammar file "inline_parser.ry".
6
6
  #
7
7
 
8
- require 'racc/parser.rb'
8
+ ###### racc/parser.rb begin
9
+ unless $".find {|p| p.end_with?('/racc/parser.rb')}
10
+ $".push "#{__dir__}/racc/parser.rb"
11
+ #--
12
+ # Copyright (c) 1999-2006 Minero Aoki
13
+ #
14
+ # This program is free software.
15
+ # You can distribute/modify this program under the same terms of ruby.
16
+ #
17
+ # As a special exception, when this code is copied by Racc
18
+ # into a Racc output file, you may use that output file
19
+ # without restriction.
20
+ #++
21
+
22
+ unless $".find {|p| p.end_with?('/racc/info.rb')}
23
+ $".push "#{__dir__}/racc/info.rb"
24
+
25
+ module Racc
26
+ VERSION = '1.7.3'
27
+ Version = VERSION
28
+ Copyright = 'Copyright (c) 1999-2006 Minero Aoki'
29
+ end
30
+
31
+ end
32
+
33
+
34
+ unless defined?(NotImplementedError)
35
+ NotImplementedError = NotImplementError # :nodoc:
36
+ end
37
+
38
+ module Racc
39
+ class ParseError < StandardError; end
40
+ end
41
+ unless defined?(::ParseError)
42
+ ParseError = Racc::ParseError # :nodoc:
43
+ end
44
+
45
+ # Racc is a LALR(1) parser generator.
46
+ # It is written in Ruby itself, and generates Ruby programs.
47
+ #
48
+ # == Command-line Reference
49
+ #
50
+ # racc [-o<var>filename</var>] [--output-file=<var>filename</var>]
51
+ # [-e<var>rubypath</var>] [--executable=<var>rubypath</var>]
52
+ # [-v] [--verbose]
53
+ # [-O<var>filename</var>] [--log-file=<var>filename</var>]
54
+ # [-g] [--debug]
55
+ # [-E] [--embedded]
56
+ # [-l] [--no-line-convert]
57
+ # [-c] [--line-convert-all]
58
+ # [-a] [--no-omit-actions]
59
+ # [-C] [--check-only]
60
+ # [-S] [--output-status]
61
+ # [--version] [--copyright] [--help] <var>grammarfile</var>
62
+ #
63
+ # [+grammarfile+]
64
+ # Racc grammar file. Any extension is permitted.
65
+ # [-o+outfile+, --output-file=+outfile+]
66
+ # A filename for output. default is <+filename+>.tab.rb
67
+ # [-O+filename+, --log-file=+filename+]
68
+ # Place logging output in file +filename+.
69
+ # Default log file name is <+filename+>.output.
70
+ # [-e+rubypath+, --executable=+rubypath+]
71
+ # output executable file(mode 755). where +path+ is the Ruby interpreter.
72
+ # [-v, --verbose]
73
+ # verbose mode. create +filename+.output file, like yacc's y.output file.
74
+ # [-g, --debug]
75
+ # add debug code to parser class. To display debugging information,
76
+ # use this '-g' option and set @yydebug true in parser class.
77
+ # [-E, --embedded]
78
+ # Output parser which doesn't need runtime files (racc/parser.rb).
79
+ # [-F, --frozen]
80
+ # Output parser which declares frozen_string_literals: true
81
+ # [-C, --check-only]
82
+ # Check syntax of racc grammar file and quit.
83
+ # [-S, --output-status]
84
+ # Print messages time to time while compiling.
85
+ # [-l, --no-line-convert]
86
+ # turns off line number converting.
87
+ # [-c, --line-convert-all]
88
+ # Convert line number of actions, inner, header and footer.
89
+ # [-a, --no-omit-actions]
90
+ # Call all actions, even if an action is empty.
91
+ # [--version]
92
+ # print Racc version and quit.
93
+ # [--copyright]
94
+ # Print copyright and quit.
95
+ # [--help]
96
+ # Print usage and quit.
97
+ #
98
+ # == Generating Parser Using Racc
99
+ #
100
+ # To compile Racc grammar file, simply type:
101
+ #
102
+ # $ racc parse.y
103
+ #
104
+ # This creates Ruby script file "parse.tab.y". The -o option can change the output filename.
105
+ #
106
+ # == Writing A Racc Grammar File
107
+ #
108
+ # If you want your own parser, you have to write a grammar file.
109
+ # A grammar file contains the name of your parser class, grammar for the parser,
110
+ # user code, and anything else.
111
+ # When writing a grammar file, yacc's knowledge is helpful.
112
+ # If you have not used yacc before, Racc is not too difficult.
113
+ #
114
+ # Here's an example Racc grammar file.
115
+ #
116
+ # class Calcparser
117
+ # rule
118
+ # target: exp { print val[0] }
119
+ #
120
+ # exp: exp '+' exp
121
+ # | exp '*' exp
122
+ # | '(' exp ')'
123
+ # | NUMBER
124
+ # end
125
+ #
126
+ # Racc grammar files resemble yacc files.
127
+ # But (of course), this is Ruby code.
128
+ # yacc's $$ is the 'result', $0, $1... is
129
+ # an array called 'val', and $-1, $-2... is an array called '_values'.
130
+ #
131
+ # See the {Grammar File Reference}[rdoc-ref:lib/racc/rdoc/grammar.en.rdoc] for
132
+ # more information on grammar files.
133
+ #
134
+ # == Parser
135
+ #
136
+ # Then you must prepare the parse entry method. There are two types of
137
+ # parse methods in Racc, Racc::Parser#do_parse and Racc::Parser#yyparse
138
+ #
139
+ # Racc::Parser#do_parse is simple.
140
+ #
141
+ # It's yyparse() of yacc, and Racc::Parser#next_token is yylex().
142
+ # This method must returns an array like [TOKENSYMBOL, ITS_VALUE].
143
+ # EOF is [false, false].
144
+ # (TOKENSYMBOL is a Ruby symbol (taken from String#intern) by default.
145
+ # If you want to change this, see the grammar reference.
146
+ #
147
+ # Racc::Parser#yyparse is little complicated, but useful.
148
+ # It does not use Racc::Parser#next_token, instead it gets tokens from any iterator.
149
+ #
150
+ # For example, <code>yyparse(obj, :scan)</code> causes
151
+ # calling +obj#scan+, and you can return tokens by yielding them from +obj#scan+.
152
+ #
153
+ # == Debugging
154
+ #
155
+ # When debugging, "-v" or/and the "-g" option is helpful.
156
+ #
157
+ # "-v" creates verbose log file (.output).
158
+ # "-g" creates a "Verbose Parser".
159
+ # Verbose Parser prints the internal status when parsing.
160
+ # But it's _not_ automatic.
161
+ # You must use -g option and set +@yydebug+ to +true+ in order to get output.
162
+ # -g option only creates the verbose parser.
163
+ #
164
+ # === Racc reported syntax error.
165
+ #
166
+ # Isn't there too many "end"?
167
+ # grammar of racc file is changed in v0.10.
168
+ #
169
+ # Racc does not use '%' mark, while yacc uses huge number of '%' marks..
170
+ #
171
+ # === Racc reported "XXXX conflicts".
172
+ #
173
+ # Try "racc -v xxxx.y".
174
+ # It causes producing racc's internal log file, xxxx.output.
175
+ #
176
+ # === Generated parsers does not work correctly
177
+ #
178
+ # Try "racc -g xxxx.y".
179
+ # This command let racc generate "debugging parser".
180
+ # Then set @yydebug=true in your parser.
181
+ # It produces a working log of your parser.
182
+ #
183
+ # == Re-distributing Racc runtime
184
+ #
185
+ # A parser, which is created by Racc, requires the Racc runtime module;
186
+ # racc/parser.rb.
187
+ #
188
+ # Ruby 1.8.x comes with Racc runtime module,
189
+ # you need NOT distribute Racc runtime files.
190
+ #
191
+ # If you want to include the Racc runtime module with your parser.
192
+ # This can be done by using '-E' option:
193
+ #
194
+ # $ racc -E -omyparser.rb myparser.y
195
+ #
196
+ # This command creates myparser.rb which `includes' Racc runtime.
197
+ # Only you must do is to distribute your parser file (myparser.rb).
198
+ #
199
+ # Note: parser.rb is ruby license, but your parser is not.
200
+ # Your own parser is completely yours.
201
+ module Racc
202
+
203
+ unless defined?(Racc_No_Extensions)
204
+ Racc_No_Extensions = false # :nodoc:
205
+ end
206
+
207
+ class Parser
208
+
209
+ Racc_Runtime_Version = ::Racc::VERSION
210
+ Racc_Runtime_Core_Version_R = ::Racc::VERSION
211
+
212
+ begin
213
+ if Object.const_defined?(:RUBY_ENGINE) and RUBY_ENGINE == 'jruby'
214
+ require 'jruby'
215
+ require 'racc/cparse-jruby.jar'
216
+ com.headius.racc.Cparse.new.load(JRuby.runtime, false)
217
+ else
218
+ require 'racc/cparse'
219
+ end
220
+
221
+ unless new.respond_to?(:_racc_do_parse_c, true)
222
+ raise LoadError, 'old cparse.so'
223
+ end
224
+ if Racc_No_Extensions
225
+ raise LoadError, 'selecting ruby version of racc runtime core'
226
+ end
227
+
228
+ Racc_Main_Parsing_Routine = :_racc_do_parse_c # :nodoc:
229
+ Racc_YY_Parse_Method = :_racc_yyparse_c # :nodoc:
230
+ Racc_Runtime_Core_Version = Racc_Runtime_Core_Version_C # :nodoc:
231
+ Racc_Runtime_Type = 'c' # :nodoc:
232
+ rescue LoadError
233
+ Racc_Main_Parsing_Routine = :_racc_do_parse_rb
234
+ Racc_YY_Parse_Method = :_racc_yyparse_rb
235
+ Racc_Runtime_Core_Version = Racc_Runtime_Core_Version_R
236
+ Racc_Runtime_Type = 'ruby'
237
+ end
238
+
239
+ def Parser.racc_runtime_type # :nodoc:
240
+ Racc_Runtime_Type
241
+ end
242
+
243
+ def _racc_setup
244
+ @yydebug = false unless self.class::Racc_debug_parser
245
+ @yydebug = false unless defined?(@yydebug)
246
+ if @yydebug
247
+ @racc_debug_out = $stderr unless defined?(@racc_debug_out)
248
+ @racc_debug_out ||= $stderr
249
+ end
250
+ arg = self.class::Racc_arg
251
+ arg[13] = true if arg.size < 14
252
+ arg
253
+ end
254
+
255
+ def _racc_init_sysvars
256
+ @racc_state = [0]
257
+ @racc_tstack = []
258
+ @racc_vstack = []
259
+
260
+ @racc_t = nil
261
+ @racc_val = nil
262
+
263
+ @racc_read_next = true
264
+
265
+ @racc_user_yyerror = false
266
+ @racc_error_status = 0
267
+ end
268
+
269
+ # The entry point of the parser. This method is used with #next_token.
270
+ # If Racc wants to get token (and its value), calls next_token.
271
+ #
272
+ # Example:
273
+ # def parse
274
+ # @q = [[1,1],
275
+ # [2,2],
276
+ # [3,3],
277
+ # [false, '$']]
278
+ # do_parse
279
+ # end
280
+ #
281
+ # def next_token
282
+ # @q.shift
283
+ # end
284
+ class_eval <<~RUBY, __FILE__, __LINE__ + 1
285
+ def do_parse
286
+ #{Racc_Main_Parsing_Routine}(_racc_setup(), false)
287
+ end
288
+ RUBY
289
+
290
+ # The method to fetch next token.
291
+ # If you use #do_parse method, you must implement #next_token.
292
+ #
293
+ # The format of return value is [TOKEN_SYMBOL, VALUE].
294
+ # +token-symbol+ is represented by Ruby's symbol by default, e.g. :IDENT
295
+ # for 'IDENT'. ";" (String) for ';'.
296
+ #
297
+ # The final symbol (End of file) must be false.
298
+ def next_token
299
+ raise NotImplementedError, "#{self.class}\#next_token is not defined"
300
+ end
301
+
302
+ def _racc_do_parse_rb(arg, in_debug)
303
+ action_table, action_check, action_default, action_pointer,
304
+ _, _, _, _,
305
+ _, _, token_table, * = arg
306
+
307
+ _racc_init_sysvars
308
+ tok = act = i = nil
309
+
310
+ catch(:racc_end_parse) {
311
+ while true
312
+ if i = action_pointer[@racc_state[-1]]
313
+ if @racc_read_next
314
+ if @racc_t != 0 # not EOF
315
+ tok, @racc_val = next_token()
316
+ unless tok # EOF
317
+ @racc_t = 0
318
+ else
319
+ @racc_t = (token_table[tok] or 1) # error token
320
+ end
321
+ racc_read_token(@racc_t, tok, @racc_val) if @yydebug
322
+ @racc_read_next = false
323
+ end
324
+ end
325
+ i += @racc_t
326
+ unless i >= 0 and
327
+ act = action_table[i] and
328
+ action_check[i] == @racc_state[-1]
329
+ act = action_default[@racc_state[-1]]
330
+ end
331
+ else
332
+ act = action_default[@racc_state[-1]]
333
+ end
334
+ while act = _racc_evalact(act, arg)
335
+ ;
336
+ end
337
+ end
338
+ }
339
+ end
340
+
341
+ # Another entry point for the parser.
342
+ # If you use this method, you must implement RECEIVER#METHOD_ID method.
343
+ #
344
+ # RECEIVER#METHOD_ID is a method to get next token.
345
+ # It must 'yield' the token, which format is [TOKEN-SYMBOL, VALUE].
346
+ class_eval <<~RUBY, __FILE__, __LINE__ + 1
347
+ def yyparse(recv, mid)
348
+ #{Racc_YY_Parse_Method}(recv, mid, _racc_setup(), false)
349
+ end
350
+ RUBY
351
+
352
+ def _racc_yyparse_rb(recv, mid, arg, c_debug)
353
+ action_table, action_check, action_default, action_pointer,
354
+ _, _, _, _,
355
+ _, _, token_table, * = arg
356
+
357
+ _racc_init_sysvars
358
+
359
+ catch(:racc_end_parse) {
360
+ until i = action_pointer[@racc_state[-1]]
361
+ while act = _racc_evalact(action_default[@racc_state[-1]], arg)
362
+ ;
363
+ end
364
+ end
365
+ recv.__send__(mid) do |tok, val|
366
+ unless tok
367
+ @racc_t = 0
368
+ else
369
+ @racc_t = (token_table[tok] or 1) # error token
370
+ end
371
+ @racc_val = val
372
+ @racc_read_next = false
373
+
374
+ i += @racc_t
375
+ unless i >= 0 and
376
+ act = action_table[i] and
377
+ action_check[i] == @racc_state[-1]
378
+ act = action_default[@racc_state[-1]]
379
+ end
380
+ while act = _racc_evalact(act, arg)
381
+ ;
382
+ end
383
+
384
+ while !(i = action_pointer[@racc_state[-1]]) ||
385
+ ! @racc_read_next ||
386
+ @racc_t == 0 # $
387
+ unless i and i += @racc_t and
388
+ i >= 0 and
389
+ act = action_table[i] and
390
+ action_check[i] == @racc_state[-1]
391
+ act = action_default[@racc_state[-1]]
392
+ end
393
+ while act = _racc_evalact(act, arg)
394
+ ;
395
+ end
396
+ end
397
+ end
398
+ }
399
+ end
400
+
401
+ ###
402
+ ### common
403
+ ###
404
+
405
+ def _racc_evalact(act, arg)
406
+ action_table, action_check, _, action_pointer,
407
+ _, _, _, _,
408
+ _, _, _, shift_n,
409
+ reduce_n, * = arg
410
+ nerr = 0 # tmp
411
+
412
+ if act > 0 and act < shift_n
413
+ #
414
+ # shift
415
+ #
416
+ if @racc_error_status > 0
417
+ @racc_error_status -= 1 unless @racc_t <= 1 # error token or EOF
418
+ end
419
+ @racc_vstack.push @racc_val
420
+ @racc_state.push act
421
+ @racc_read_next = true
422
+ if @yydebug
423
+ @racc_tstack.push @racc_t
424
+ racc_shift @racc_t, @racc_tstack, @racc_vstack
425
+ end
426
+
427
+ elsif act < 0 and act > -reduce_n
428
+ #
429
+ # reduce
430
+ #
431
+ code = catch(:racc_jump) {
432
+ @racc_state.push _racc_do_reduce(arg, act)
433
+ false
434
+ }
435
+ if code
436
+ case code
437
+ when 1 # yyerror
438
+ @racc_user_yyerror = true # user_yyerror
439
+ return -reduce_n
440
+ when 2 # yyaccept
441
+ return shift_n
442
+ else
443
+ raise '[Racc Bug] unknown jump code'
444
+ end
445
+ end
446
+
447
+ elsif act == shift_n
448
+ #
449
+ # accept
450
+ #
451
+ racc_accept if @yydebug
452
+ throw :racc_end_parse, @racc_vstack[0]
453
+
454
+ elsif act == -reduce_n
455
+ #
456
+ # error
457
+ #
458
+ case @racc_error_status
459
+ when 0
460
+ unless arg[21] # user_yyerror
461
+ nerr += 1
462
+ on_error @racc_t, @racc_val, @racc_vstack
463
+ end
464
+ when 3
465
+ if @racc_t == 0 # is $
466
+ # We're at EOF, and another error occurred immediately after
467
+ # attempting auto-recovery
468
+ throw :racc_end_parse, nil
469
+ end
470
+ @racc_read_next = true
471
+ end
472
+ @racc_user_yyerror = false
473
+ @racc_error_status = 3
474
+ while true
475
+ if i = action_pointer[@racc_state[-1]]
476
+ i += 1 # error token
477
+ if i >= 0 and
478
+ (act = action_table[i]) and
479
+ action_check[i] == @racc_state[-1]
480
+ break
481
+ end
482
+ end
483
+ throw :racc_end_parse, nil if @racc_state.size <= 1
484
+ @racc_state.pop
485
+ @racc_vstack.pop
486
+ if @yydebug
487
+ @racc_tstack.pop
488
+ racc_e_pop @racc_state, @racc_tstack, @racc_vstack
489
+ end
490
+ end
491
+ return act
492
+
493
+ else
494
+ raise "[Racc Bug] unknown action #{act.inspect}"
495
+ end
496
+
497
+ racc_next_state(@racc_state[-1], @racc_state) if @yydebug
498
+
499
+ nil
500
+ end
501
+
502
+ def _racc_do_reduce(arg, act)
503
+ _, _, _, _,
504
+ goto_table, goto_check, goto_default, goto_pointer,
505
+ nt_base, reduce_table, _, _,
506
+ _, use_result, * = arg
507
+
508
+ state = @racc_state
509
+ vstack = @racc_vstack
510
+ tstack = @racc_tstack
511
+
512
+ i = act * -3
513
+ len = reduce_table[i]
514
+ reduce_to = reduce_table[i+1]
515
+ method_id = reduce_table[i+2]
516
+ void_array = []
517
+
518
+ tmp_t = tstack[-len, len] if @yydebug
519
+ tmp_v = vstack[-len, len]
520
+ tstack[-len, len] = void_array if @yydebug
521
+ vstack[-len, len] = void_array
522
+ state[-len, len] = void_array
523
+
524
+ # tstack must be updated AFTER method call
525
+ if use_result
526
+ vstack.push __send__(method_id, tmp_v, vstack, tmp_v[0])
527
+ else
528
+ vstack.push __send__(method_id, tmp_v, vstack)
529
+ end
530
+ tstack.push reduce_to
531
+
532
+ racc_reduce(tmp_t, reduce_to, tstack, vstack) if @yydebug
533
+
534
+ k1 = reduce_to - nt_base
535
+ if i = goto_pointer[k1]
536
+ i += state[-1]
537
+ if i >= 0 and (curstate = goto_table[i]) and goto_check[i] == k1
538
+ return curstate
539
+ end
540
+ end
541
+ goto_default[k1]
542
+ end
543
+
544
+ # This method is called when a parse error is found.
545
+ #
546
+ # ERROR_TOKEN_ID is an internal ID of token which caused error.
547
+ # You can get string representation of this ID by calling
548
+ # #token_to_str.
549
+ #
550
+ # ERROR_VALUE is a value of error token.
551
+ #
552
+ # value_stack is a stack of symbol values.
553
+ # DO NOT MODIFY this object.
554
+ #
555
+ # This method raises ParseError by default.
556
+ #
557
+ # If this method returns, parsers enter "error recovering mode".
558
+ def on_error(t, val, vstack)
559
+ raise ParseError, sprintf("parse error on value %s (%s)",
560
+ val.inspect, token_to_str(t) || '?')
561
+ end
562
+
563
+ # Enter error recovering mode.
564
+ # This method does not call #on_error.
565
+ def yyerror
566
+ throw :racc_jump, 1
567
+ end
568
+
569
+ # Exit parser.
570
+ # Return value is +Symbol_Value_Stack[0]+.
571
+ def yyaccept
572
+ throw :racc_jump, 2
573
+ end
574
+
575
+ # Leave error recovering mode.
576
+ def yyerrok
577
+ @racc_error_status = 0
578
+ end
579
+
580
+ # For debugging output
581
+ def racc_read_token(t, tok, val)
582
+ @racc_debug_out.print 'read '
583
+ @racc_debug_out.print tok.inspect, '(', racc_token2str(t), ') '
584
+ @racc_debug_out.puts val.inspect
585
+ @racc_debug_out.puts
586
+ end
587
+
588
+ def racc_shift(tok, tstack, vstack)
589
+ @racc_debug_out.puts "shift #{racc_token2str tok}"
590
+ racc_print_stacks tstack, vstack
591
+ @racc_debug_out.puts
592
+ end
593
+
594
+ def racc_reduce(toks, sim, tstack, vstack)
595
+ out = @racc_debug_out
596
+ out.print 'reduce '
597
+ if toks.empty?
598
+ out.print ' <none>'
599
+ else
600
+ toks.each {|t| out.print ' ', racc_token2str(t) }
601
+ end
602
+ out.puts " --> #{racc_token2str(sim)}"
603
+ racc_print_stacks tstack, vstack
604
+ @racc_debug_out.puts
605
+ end
606
+
607
+ def racc_accept
608
+ @racc_debug_out.puts 'accept'
609
+ @racc_debug_out.puts
610
+ end
611
+
612
+ def racc_e_pop(state, tstack, vstack)
613
+ @racc_debug_out.puts 'error recovering mode: pop token'
614
+ racc_print_states state
615
+ racc_print_stacks tstack, vstack
616
+ @racc_debug_out.puts
617
+ end
618
+
619
+ def racc_next_state(curstate, state)
620
+ @racc_debug_out.puts "goto #{curstate}"
621
+ racc_print_states state
622
+ @racc_debug_out.puts
623
+ end
624
+
625
+ def racc_print_stacks(t, v)
626
+ out = @racc_debug_out
627
+ out.print ' ['
628
+ t.each_index do |i|
629
+ out.print ' (', racc_token2str(t[i]), ' ', v[i].inspect, ')'
630
+ end
631
+ out.puts ' ]'
632
+ end
633
+
634
+ def racc_print_states(s)
635
+ out = @racc_debug_out
636
+ out.print ' ['
637
+ s.each {|st| out.print ' ', st }
638
+ out.puts ' ]'
639
+ end
640
+
641
+ def racc_token2str(tok)
642
+ self.class::Racc_token_to_s_table[tok] or
643
+ raise "[Racc Bug] can't convert token #{tok} to string"
644
+ end
645
+
646
+ # Convert internal ID of token symbol to the string.
647
+ def token_to_str(t)
648
+ self.class::Racc_token_to_s_table[t]
649
+ end
650
+
651
+ end
652
+
653
+ end
654
+
655
+ end
656
+ ###### racc/parser.rb end
9
657
 
10
658
  require 'strscan'
11
659
 
data/lib/rdoc/text.rb CHANGED
@@ -309,4 +309,10 @@ module RDoc::Text
309
309
  res.join.strip
310
310
  end
311
311
 
312
+ ##
313
+ # Character class to be separated by a space when concatenating
314
+ # lines.
315
+
316
+ SPACE_SEPARATED_LETTER_CLASS = /[\p{Nd}\p{Lc}\p{Pc}]|[!-~&&\W]/
317
+
312
318
  end
@@ -112,7 +112,7 @@ module RDoc::TokenStream
112
112
  # Returns a string representation of the token stream
113
113
 
114
114
  def tokens_to_s
115
- token_stream.compact.map { |token| token[:text] }.join ''
115
+ (token_stream or return '').compact.map { |token| token[:text] }.join ''
116
116
  end
117
117
 
118
118
  end
data/lib/rdoc/version.rb CHANGED
@@ -5,6 +5,6 @@ module RDoc
5
5
  ##
6
6
  # RDoc version you are using
7
7
 
8
- VERSION = '6.6.0'
8
+ VERSION = '6.6.1'
9
9
 
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.6.0
4
+ version: 6.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Hodel
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: exe
16
16
  cert_chain: []
17
- date: 2023-11-06 00:00:00.000000000 Z
17
+ date: 2023-12-05 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: psych