rouge 4.2.0 → 4.3.0

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 (58) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +7 -7
  3. data/lib/rouge/cli.rb +2 -4
  4. data/lib/rouge/demos/iecst +21 -0
  5. data/lib/rouge/guessers/disambiguation.rb +6 -1
  6. data/lib/rouge/lexers/ada.rb +1 -1
  7. data/lib/rouge/lexers/brainfuck.rb +1 -0
  8. data/lib/rouge/lexers/clean.rb +4 -4
  9. data/lib/rouge/lexers/cpp.rb +1 -1
  10. data/lib/rouge/lexers/crystal.rb +17 -17
  11. data/lib/rouge/lexers/ecl.rb +2 -2
  12. data/lib/rouge/lexers/eiffel.rb +1 -1
  13. data/lib/rouge/lexers/elixir.rb +1 -1
  14. data/lib/rouge/lexers/gdscript.rb +4 -4
  15. data/lib/rouge/lexers/ghc_cmm.rb +3 -3
  16. data/lib/rouge/lexers/hcl.rb +1 -0
  17. data/lib/rouge/lexers/iecst.rb +92 -0
  18. data/lib/rouge/lexers/javascript.rb +1 -1
  19. data/lib/rouge/lexers/julia.rb +3 -2
  20. data/lib/rouge/lexers/kotlin.rb +1 -1
  21. data/lib/rouge/lexers/make.rb +1 -1
  22. data/lib/rouge/lexers/markdown.rb +2 -1
  23. data/lib/rouge/lexers/mathematica.rb +1 -1
  24. data/lib/rouge/lexers/meson.rb +0 -1
  25. data/lib/rouge/lexers/nasm.rb +5 -4
  26. data/lib/rouge/lexers/nginx.rb +1 -0
  27. data/lib/rouge/lexers/objective_c/common.rb +0 -2
  28. data/lib/rouge/lexers/objective_c.rb +1 -1
  29. data/lib/rouge/lexers/ocl.rb +2 -2
  30. data/lib/rouge/lexers/openedge.rb +0 -2
  31. data/lib/rouge/lexers/plsql.rb +5 -5
  32. data/lib/rouge/lexers/ruby.rb +19 -19
  33. data/lib/rouge/lexers/scala.rb +5 -2
  34. data/lib/rouge/lexers/sql.rb +1 -1
  35. data/lib/rouge/lexers/syzlang.rb +0 -1
  36. data/lib/rouge/lexers/tcl.rb +7 -2
  37. data/lib/rouge/lexers/toml.rb +13 -12
  38. data/lib/rouge/lexers/ttcn3.rb +0 -2
  39. data/lib/rouge/lexers/typescript/common.rb +9 -0
  40. data/lib/rouge/lexers/xojo.rb +1 -1
  41. data/lib/rouge/lexers/yang.rb +1 -1
  42. data/lib/rouge/tex_theme_renderer.rb +1 -1
  43. data/lib/rouge/themes/base16.rb +23 -18
  44. data/lib/rouge/themes/bw.rb +1 -0
  45. data/lib/rouge/themes/colorful.rb +1 -0
  46. data/lib/rouge/themes/github.rb +1 -0
  47. data/lib/rouge/themes/gruvbox.rb +4 -1
  48. data/lib/rouge/themes/igor_pro.rb +3 -0
  49. data/lib/rouge/themes/magritte.rb +1 -0
  50. data/lib/rouge/themes/molokai.rb +2 -1
  51. data/lib/rouge/themes/monokai.rb +2 -1
  52. data/lib/rouge/themes/monokai_sublime.rb +4 -3
  53. data/lib/rouge/themes/pastie.rb +1 -0
  54. data/lib/rouge/themes/thankful_eyes.rb +1 -0
  55. data/lib/rouge/themes/tulip.rb +1 -0
  56. data/lib/rouge/token.rb +2 -1
  57. data/lib/rouge/version.rb +1 -1
  58. metadata +5 -3
@@ -472,7 +472,7 @@ module Rouge
472
472
  # A double-quoted string refers to a database object in our default SQL
473
473
  rule %r/"/, Operator, :double_string
474
474
  # preprocessor directive treated as special comment
475
- rule %r/(\$(?:IF|THEN|ELSE|ELSIF|ERROR|END|(?:\$\$?\w[\w\d]*)))(\s+)/im do
475
+ rule %r/(\$(?:IF|THEN|ELSE|ELSIF|ERROR|END|(?:\$\$?[a-z]\w*)))(\s+)/im do
476
476
  groups Comment::Preproc, Text
477
477
  end
478
478
 
@@ -503,7 +503,7 @@ module Rouge
503
503
  # Special processing for keywords with multiple contexts
504
504
  #
505
505
  # this madness is to keep the word "replace" from being treated as a builtin function in this context
506
- rule %r/(create)(\s+)(?:(or)(\s+)(replace)(\s+))?(package|function|procedure|type)(?:(\s+)(body))?(\s+)(\w[\w\d\$]*)/im do
506
+ rule %r/(create)(\s+)(?:(or)(\s+)(replace)(\s+))?(package|function|procedure|type)(?:(\s+)(body))?(\s+)([a-z][\w$]*)/im do
507
507
  groups Keyword::Reserved, Text, Keyword::Reserved, Text, Keyword::Reserved, Text, Keyword::Reserved, Text, Keyword::Reserved, Text, Name
508
508
  end
509
509
  # similar for MERGE keywords
@@ -515,7 +515,7 @@ module Rouge
515
515
  # General keyword classification with sepcial attention to names
516
516
  # in a chained "dot" notation.
517
517
  #
518
- rule %r/(\w[\w\d\$]*)(\.(?=\w))?/ do |m|
518
+ rule %r/([a-zA-Z][\w$]*)(\.(?=\w))?/ do |m|
519
519
  if self.class.keywords_type.include? m[1].upcase
520
520
  tok = Keyword::Type
521
521
  elsif self.class.keywords_func.include? m[1].upcase
@@ -556,11 +556,11 @@ module Rouge
556
556
 
557
557
  state :dotnames do
558
558
  # if we are followed by a dot and another name, we are an ordinary name
559
- rule %r/(\w[\w\d\$]*)(\.(?=\w))/ do
559
+ rule %r/([a-zA-Z][\w\$]*)(\.(?=\w))/ do
560
560
  groups Name, Punctuation
561
561
  end
562
562
  # this rule WILL be true if something pushed into our state. That is our state contract
563
- rule %r/\w[\w\d\$]*/ do |m|
563
+ rule %r/[a-zA-Z][\w\$]*/ do |m|
564
564
  if self.class.keywords_func.include? m[0].upcase
565
565
  # The Function lookup allows collection methods like COUNT, FIRST, LAST, etc.. to be
566
566
  # classified correctly. Occasionally misidentifies ordinary names as builtin functions,
@@ -24,7 +24,7 @@ module Rouge
24
24
  rule %r(
25
25
  : # initial :
26
26
  @{0,2} # optional ivar, for :@foo and :@@foo
27
- [a-z_]\w*[!?]? # the symbol
27
+ [\p{Ll}_]\p{Word}*[!?]? # the symbol
28
28
  )xi, Str::Symbol
29
29
 
30
30
  # special symbols
@@ -39,7 +39,7 @@ module Rouge
39
39
  # %-sigiled strings
40
40
  # %(abc), %[abc], %<abc>, %.abc., %r.abc., etc
41
41
  delimiter_map = { '{' => '}', '[' => ']', '(' => ')', '<' => '>' }
42
- rule %r/%([rqswQWxiI])?([^\w\s])/ do |m|
42
+ rule %r/%([rqswQWxiI])?([^\p{Word}\s])/ do |m|
43
43
  open = Regexp.escape(m[2])
44
44
  close = Regexp.escape(delimiter_map[m[2]] || m[2])
45
45
  interp = /[rQWxI]/ === m[1] || !m[1]
@@ -57,7 +57,7 @@ module Rouge
57
57
  token toktype
58
58
 
59
59
  push do
60
- uniq_chars = "#{open}#{close}".squeeze
60
+ uniq_chars = [open, close].uniq.join
61
61
  uniq_chars = '' if open == close && open == "\\#"
62
62
  rule %r/\\[##{uniq_chars}\\]/, Str::Escape
63
63
  # nesting rules only with asymmetric delimiters
@@ -83,7 +83,7 @@ module Rouge
83
83
 
84
84
  state :strings do
85
85
  mixin :symbols
86
- rule %r/\b[a-z_]\w*?[?!]?:\s+/, Str::Symbol, :expr_start
86
+ rule %r/\b[\p{Ll}_]\p{Word}*?[?!]?:\s+/, Str::Symbol, :expr_start
87
87
  rule %r/'(\\\\|\\'|[^'])*'/, Str::Single
88
88
  rule %r/"/, Str::Double, :simple_string
89
89
  rule %r/(?<!\.)`/, Str::Backtick, :simple_backtick
@@ -177,9 +177,9 @@ module Rouge
177
177
  rule decimal, Num::Integer
178
178
 
179
179
  # names
180
- rule %r/@@[a-z_]\w*/i, Name::Variable::Class
181
- rule %r/@[a-z_]\w*/i, Name::Variable::Instance
182
- rule %r/\$\w+/, Name::Variable::Global
180
+ rule %r/@@[\p{Ll}_]\p{Word}*/i, Name::Variable::Class
181
+ rule %r/@[\p{Ll}_]\p{Word}*/i, Name::Variable::Instance
182
+ rule %r/\$\p{Word}+/, Name::Variable::Global
183
183
  rule %r(\$[!@&`'+~=/\\,;.<>_*\$?:"]), Name::Variable::Global
184
184
  rule %r/\$-[0adFiIlpvw]/, Name::Variable::Global
185
185
  rule %r/::/, Operator
@@ -193,7 +193,7 @@ module Rouge
193
193
  rule %r(
194
194
  (module)
195
195
  (\s+)
196
- ([a-zA-Z_][a-zA-Z0-9_]*(::[a-zA-Z_][a-zA-Z0-9_]*)*)
196
+ ([\p{L}_][\p{L}0-9_]*(::[\p{L}_][\p{L}0-9_]*)*)
197
197
  )x do
198
198
  groups Keyword, Text, Name::Namespace
199
199
  end
@@ -219,14 +219,14 @@ module Rouge
219
219
  # Otherwise, they will be parsed as :method_call
220
220
  rule %r/\.{2,3}/, Operator, :expr_start
221
221
 
222
- rule %r/[A-Z][a-zA-Z0-9_]*/, Name::Constant, :method_call
223
- rule %r/(\.|::)(\s*)([a-z_]\w*[!?]?|[*%&^`~+-\/\[<>=])/ do
222
+ rule %r/[\p{Lu}][\p{L}0-9_]*/, Name::Constant, :method_call
223
+ rule %r/(\.|::)(\s*)([\p{Ll}_]\p{Word}*[!?]?|[*%&^`~+-\/\[<>=])/ do
224
224
  groups Punctuation, Text, Name::Function
225
225
  push :method_call
226
226
  end
227
227
 
228
- rule %r/[a-zA-Z_]\w*[?!]/, Name, :expr_start
229
- rule %r/[a-zA-Z_]\w*/, Name, :method_call
228
+ rule %r/[\p{L}_]\p{Word}*[?!]/, Name, :expr_start
229
+ rule %r/[\p{L}_]\p{Word}*/, Name, :method_call
230
230
  rule %r/\*\*|<<?|>>?|>=|<=|<=>|=~|={3}|!~|&&?|\|\||\./,
231
231
  Operator, :expr_start
232
232
  rule %r/[-+\/*%=<>&!^|~]=?/, Operator, :expr_start
@@ -236,7 +236,7 @@ module Rouge
236
236
  end
237
237
 
238
238
  state :has_heredocs do
239
- rule %r/(?<!\w)(<<[-~]?)(["`']?)([a-zA-Z_]\w*)(\2)/ do |m|
239
+ rule %r/(?<!\p{Word})(<<[-~]?)(["`']?)([\p{L}_]\p{Word}*)(\2)/ do |m|
240
240
  token Operator, m[1]
241
241
  token Name::Constant, "#{m[2]}#{m[3]}#{m[4]}"
242
242
  @heredoc_queue << [['<<-', '<<~'].include?(m[1]), m[3]]
@@ -293,9 +293,9 @@ module Rouge
293
293
  rule %r/\s+/, Text
294
294
  rule %r/\(/, Punctuation, :defexpr
295
295
  rule %r(
296
- (?:([a-zA-Z_]\w*)(\.))?
296
+ (?:([\p{L}_]\p{Word}*)(\.))?
297
297
  (
298
- [a-zA-Z_]\w*[!?]? |
298
+ [\p{L}_]\p{Word}*[!?]? |
299
299
  \*\*? | [-+]@? | [/%&\|^`~] | \[\]=? |
300
300
  <<? | >>? | <=>? | >= | ===?
301
301
  )
@@ -310,7 +310,7 @@ module Rouge
310
310
 
311
311
  state :classname do
312
312
  rule %r/\s+/, Text
313
- rule %r/\w+(::\w+)+/, Name::Class
313
+ rule %r/\p{Word}+(::\p{Word}+)+/, Name::Class
314
314
 
315
315
  rule %r/\(/ do
316
316
  token Punctuation
@@ -324,7 +324,7 @@ module Rouge
324
324
  goto :expr_start
325
325
  end
326
326
 
327
- rule %r/[A-Z_]\w*/, Name::Class, :pop!
327
+ rule %r/[\p{Lu}_]\p{Word}*/, Name::Class, :pop!
328
328
 
329
329
  rule(//) { pop! }
330
330
  end
@@ -364,7 +364,7 @@ module Rouge
364
364
 
365
365
  state :string_intp do
366
366
  rule %r/[#][{]/, Str::Interpol, :in_interp
367
- rule %r/#(@@?|\$)[a-z_]\w*/i, Str::Interpol
367
+ rule %r/#(@@?|\$)[\p{Ll}_]\p{Word}*/i, Str::Interpol
368
368
  end
369
369
 
370
370
  state :string_intp_escaped do
@@ -419,7 +419,7 @@ module Rouge
419
419
  rule %r(
420
420
  [?](\\[MC]-)* # modifiers
421
421
  (\\([\\abefnrstv\#"']|x[a-fA-F0-9]{1,2}|[0-7]{1,3})|\S)
422
- (?!\w)
422
+ (?!\p{Word})
423
423
  )x, Str::Char, :pop!
424
424
 
425
425
  # special case for using a single space. Ruby demands that
@@ -13,7 +13,8 @@ module Rouge
13
13
  mimetypes 'text/x-scala', 'application/x-scala'
14
14
 
15
15
  # As documented in the ENBF section of the scala specification
16
- # http://www.scala-lang.org/docu/files/ScalaReference.pdf
16
+ # https://scala-lang.org/files/archive/spec/2.13/13-syntax-summary.html
17
+ # https://en.wikipedia.org/wiki/Unicode_character_property#General_Category
17
18
  whitespace = /\p{Space}/
18
19
  letter = /[\p{L}$_]/
19
20
  upper = /[\p{Lu}$_]/
@@ -24,8 +25,10 @@ module Rouge
24
25
  # negative lookahead to filter out other classes
25
26
  op = %r(
26
27
  (?!#{whitespace}|#{letter}|#{digits}|#{parens}|#{delims})
27
- [\u0020-\u007F\p{Sm}\p{So}]
28
+ [-!#%&*/:?@\\^\p{Sm}\p{So}]
28
29
  )x
30
+ # manually removed +<=>|~ from regexp because they're in property Sm
31
+ # pp CHRS:(0x00..0x7f).map(&:chr).grep(/\p{Sm}/)
29
32
 
30
33
  idrest = %r(#{letter}(?:#{letter}|#{digits})*(?:(?<=_)#{op}+)?)x
31
34
 
@@ -115,7 +115,7 @@ module Rouge
115
115
  rule %r/"/, Name::Variable, :double_string
116
116
  rule %r/`/, Name::Variable, :backtick
117
117
 
118
- rule %r/\w[\w\d]*/ do |m|
118
+ rule %r/\w+/ do |m|
119
119
  if self.class.keywords_type.include? m[0].upcase
120
120
  token Name::Builtin
121
121
  elsif self.class.keywords.include? m[0].upcase
@@ -27,7 +27,6 @@ module Rouge
27
27
 
28
28
  comment = /#.*$/
29
29
  inline_spaces = /[ \t]+/
30
- eol_spaces = /[\n\r]+/
31
30
  spaces = /\s+/
32
31
 
33
32
  state :inline_break do
@@ -57,9 +57,9 @@ module Rouge
57
57
 
58
58
  def self.gen_command_state(name='')
59
59
  state(:"command#{name}") do
60
- mixin :word
60
+ rule %r/#/, Comment, :comment
61
61
 
62
- rule %r/##{NOT_CHARS[END_LINE]}+/, Comment::Single
62
+ mixin :word
63
63
 
64
64
  rule %r/(?=#{CHARS[END_WORD]})/ do
65
65
  push :"params#{name}"
@@ -163,6 +163,11 @@ module Rouge
163
163
  rule %r/\\./m, Str::Escape
164
164
  end
165
165
 
166
+ state :comment do
167
+ rule %r/.*[^\\]\n/, Comment, :pop!
168
+ rule %r/.*\\\n/, Comment
169
+ end
170
+
166
171
  state :string do
167
172
  rule %r/"/, Str::Double, :pop!
168
173
  mixin :interp
@@ -20,20 +20,9 @@ module Rouge
20
20
  rule %r/(true|false)/, Keyword::Constant
21
21
 
22
22
  rule %r/(#{identifier})(\s*)(=)(\s*)(\{)/ do
23
- groups Name::Namespace, Text, Operator, Text, Punctuation
23
+ groups Name::Property, Text, Operator, Text, Punctuation
24
24
  push :inline
25
25
  end
26
-
27
- rule %r/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z/, Literal::Date
28
-
29
- rule %r/[+-]?\d+(?:_\d+)*\.\d+(?:_\d+)*(?:[eE][+-]?\d+(?:_\d+)*)?/, Num::Float
30
- rule %r/[+-]?\d+(?:_\d+)*[eE][+-]?\d+(?:_\d+)*/, Num::Float
31
- rule %r/[+-]?(?:nan|inf)/, Num::Float
32
-
33
- rule %r/0x\h+(?:_\h+)*/, Num::Hex
34
- rule %r/0o[0-7]+(?:_[0-7]+)*/, Num::Oct
35
- rule %r/0b[01]+(?:_[01]+)*/, Num::Bin
36
- rule %r/[+-]?\d+(?:_\d+)*/, Num::Integer
37
26
  end
38
27
 
39
28
  state :root do
@@ -59,6 +48,18 @@ module Rouge
59
48
  groups Name::Property, Text, Punctuation
60
49
  end
61
50
 
51
+ rule %r/\d{4}-\d{2}-\d{2}(?:[Tt ]\d{2}:\d{2}:\d{2}(?:[Zz]|[+-]\d{2}:\d{2})?)?/, Literal::Date
52
+ rule %r/\d{2}:\d{2}:\d{2}/, Literal::Date
53
+
54
+ rule %r/[+-]?\d+(?:_\d+)*\.\d+(?:_\d+)*(?:[eE][+-]?\d+(?:_\d+)*)?/, Num::Float
55
+ rule %r/[+-]?\d+(?:_\d+)*[eE][+-]?\d+(?:_\d+)*/, Num::Float
56
+ rule %r/[+-]?(?:nan|inf)/, Num::Float
57
+
58
+ rule %r/0x\h+(?:_\h+)*/, Num::Hex
59
+ rule %r/0o[0-7]+(?:_[0-7]+)*/, Num::Oct
60
+ rule %r/0b[01]+(?:_[01]+)*/, Num::Bin
61
+ rule %r/[+-]?\d+(?:_\d+)*/, Num::Integer
62
+
62
63
  rule %r/"""/, Str, :mdq
63
64
  rule %r/"/, Str, :dq
64
65
  rule %r/'''/, Str, :msq
@@ -46,8 +46,6 @@ module Rouge
46
46
  )
47
47
  end
48
48
 
49
- # optional comment or whitespace
50
- ws = %r((?:\s|//.*?\n|/[*].*?[*]/)+)
51
49
  id = /[a-zA-Z_]\w*/
52
50
  digit = /\d_+\d|\d/
53
51
  bin_digit = /[01]_+[01]|[01]/
@@ -37,6 +37,15 @@ module Rouge
37
37
  base.prepend :root do
38
38
  rule %r/[?][.]/, base::Punctuation
39
39
  rule %r/[?]{2}/, base::Operator
40
+
41
+ # Positive Examples:
42
+ # const cat = { name: "Garfield" } satisfies Person;
43
+ # import {something as thingy} from 'module'
44
+ # export { foo as default }
45
+ # ...spreadOperator as const;
46
+ # Negative Example:
47
+ # cy.get('kitten').as('friend')
48
+ rule %r{(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(as)|(satisfies))\s+}, base::Keyword::Declaration
40
49
  end
41
50
 
42
51
  base.prepend :statement do
@@ -37,7 +37,7 @@ module Rouge
37
37
  rule %r/\s+/, Text::Whitespace
38
38
 
39
39
  rule %r/rem\b.*?$/i, Comment::Single
40
- rule %r([//'].*$), Comment::Single
40
+ rule %r((?://|').*$), Comment::Single
41
41
  rule %r/\#tag Note.*?\#tag EndNote/mi, Comment::Preproc
42
42
  rule %r/\s*[#].*$/x, Comment::Preproc
43
43
 
@@ -10,7 +10,7 @@ module Rouge
10
10
  filenames '*.yang'
11
11
  mimetypes 'application/yang'
12
12
 
13
- id = /[\w_-]+(?=[^\w\-\:])\b/
13
+ id = /[\w-]+(?=[^\w\-\:])\b/
14
14
 
15
15
  #Keywords from RFC7950 ; oriented at BNF style
16
16
  def self.top_stmts_keywords
@@ -109,7 +109,7 @@ END
109
109
  end
110
110
 
111
111
  def render_blank(tok, &b)
112
- out = "\\expandafter\\def#{token_name(tok)}#1{#1}"
112
+ "\\expandafter\\def#{token_name(tok)}#1{#1}"
113
113
  end
114
114
 
115
115
  def render_style(tok, style, &b)
@@ -3,27 +3,28 @@
3
3
 
4
4
  module Rouge
5
5
  module Themes
6
- # default base16 theme
7
- # by Chris Kempson (http://chriskempson.com)
6
+ # author Chris Kempson
7
+ # base16 default dark
8
+ # https://github.com/chriskempson/base16-default-schemes
8
9
  class Base16 < CSSTheme
9
10
  name 'base16'
10
11
 
11
- palette base00: "#151515"
12
- palette base01: "#202020"
13
- palette base02: "#303030"
14
- palette base03: "#505050"
15
- palette base04: "#b0b0b0"
16
- palette base05: "#d0d0d0"
17
- palette base06: "#e0e0e0"
18
- palette base07: "#f5f5f5"
19
- palette base08: "#ac4142"
20
- palette base09: "#d28445"
21
- palette base0A: "#f4bf75"
22
- palette base0B: "#90a959"
23
- palette base0C: "#75b5aa"
24
- palette base0D: "#6a9fb5"
25
- palette base0E: "#aa759f"
26
- palette base0F: "#8f5536"
12
+ palette base00: "#181818"
13
+ palette base01: "#282828"
14
+ palette base02: "#383838"
15
+ palette base03: "#585858"
16
+ palette base04: "#b8b8b8"
17
+ palette base05: "#d8d8d8"
18
+ palette base06: "#e8e8e8"
19
+ palette base07: "#f8f8f8"
20
+ palette base08: "#ab4642"
21
+ palette base09: "#dc9656"
22
+ palette base0A: "#f7ca88"
23
+ palette base0B: "#a1b56c"
24
+ palette base0C: "#86c1b9"
25
+ palette base0D: "#7cafc2"
26
+ palette base0E: "#ba8baf"
27
+ palette base0F: "#a16946"
27
28
 
28
29
  extend HasModes
29
30
 
@@ -60,6 +61,10 @@ module Rouge
60
61
  style Generic::Deleted, :fg => :base08
61
62
  style Generic::Heading, :fg => :base0D, :bg => :base00, :bold => true
62
63
 
64
+ style Generic::Emph, :italic => true
65
+ style Generic::EmphStrong, :italic => true, :bold => true
66
+ style Generic::Strong, :bold => true
67
+
63
68
  style Keyword, :fg => :base0E
64
69
  style Keyword::Constant,
65
70
  Keyword::Type, :fg => :base09
@@ -33,6 +33,7 @@ module Rouge
33
33
  style Generic::Heading, :bold => true
34
34
  style Generic::Subheading, :bold => true
35
35
  style Generic::Emph, :italic => true
36
+ style Generic::EmphStrong, :italic => true, :bold => true
36
37
  style Generic::Strong, :bold => true
37
38
  style Generic::Prompt, :bold => true
38
39
 
@@ -58,6 +58,7 @@ module Rouge
58
58
  style Generic::Inserted, :fg => "#00A000"
59
59
  style Generic::Error, :fg => "#FF0000"
60
60
  style Generic::Emph, :italic => true
61
+ style Generic::EmphStrong, :italic => true, :bold => true
61
62
  style Generic::Strong, :bold => true
62
63
  style Generic::Prompt, :fg => "#c65d09", :bold => true
63
64
  style Generic::Output, :fg => "#888"
@@ -111,6 +111,7 @@ module Rouge
111
111
  Name::Tag, :fg => :tag
112
112
 
113
113
  style Generic::Inserted, :fg => :fgInserted, :bg => :bgInserted
114
+ style Generic::EmphStrong, :italic => true, :bold => true
114
115
 
115
116
  style Keyword::Constant,
116
117
  Literal,
@@ -140,6 +140,10 @@ module Rouge
140
140
  style Generic::Deleted, :fg => :red, :bg => :bg0
141
141
  style Generic::Heading, :fg => :green, :bold => true
142
142
 
143
+ style Generic::Emph, :italic => true
144
+ style Generic::EmphStrong, :italic => true, :bold => true
145
+ style Generic::Strong, :bold => true
146
+
143
147
  style Keyword, :fg => :red
144
148
  style Keyword::Constant, :fg => :purple
145
149
  style Keyword::Type, :fg => :yellow
@@ -164,7 +168,6 @@ module Rouge
164
168
  style Literal::Number, :fg => :purple
165
169
 
166
170
  style Literal::String::Symbol, :fg => :blue
167
-
168
171
  end
169
172
  end
170
173
  end
@@ -10,6 +10,9 @@ module Rouge
10
10
  style Comment::Preproc, :fg => '#CC00A3'
11
11
  style Comment::Special, :fg => '#CC00A3'
12
12
  style Comment, :fg => '#FF0000'
13
+ style Generic::Emph, :italic => true
14
+ style Generic::EmphStrong, :italic => true, :bold => true
15
+ style Generic::Strong, :bold => true
13
16
  style Keyword::Constant, :fg => '#C34E00'
14
17
  style Keyword::Declaration, :fg => '#0000FF'
15
18
  style Keyword::Reserved, :fg => '#007575'
@@ -41,6 +41,7 @@ module Rouge
41
41
  style Generic::Deleted, :fg => :cherry
42
42
  style Generic::Inserted, :fg => :forest
43
43
  style Generic::Emph, :italic => true
44
+ style Generic::EmphStrong, :italic => true, :bold => true
44
45
  style Generic::Strong, :bold => true
45
46
  style Generic::Traceback, :fg => :black, :bg => :lavender
46
47
  style Keyword::Constant, :fg => :forest, :bold => true
@@ -25,7 +25,8 @@ module Rouge
25
25
  style Error, :fg => :white, :bg => :grey
26
26
  style Generic::Inserted, :fg => :green
27
27
  style Generic::Deleted, :fg => :red
28
- style Generic::Emph, :fg => :black, :italic => true
28
+ style Generic::Emph, :italic => true
29
+ style Generic::EmphStrong, :italic => true, :bold => true
29
30
  style Generic::Error,
30
31
  Generic::Traceback, :fg => :red
31
32
  style Generic::Heading, :fg => :grey
@@ -35,7 +35,8 @@ module Rouge
35
35
  style Error, :fg => :carmine, :bg => :very_dark
36
36
  style Generic::Inserted, :fg => :white, :bg => :dimgreen
37
37
  style Generic::Deleted, :fg => :white, :bg => :dimred
38
- style Generic::Emph, :fg => :black, :italic => true
38
+ style Generic::Emph, :italic => true
39
+ style Generic::EmphStrong, :italic => true, :bold => true
39
40
  style Generic::Error,
40
41
  Generic::Traceback, :fg => :dark_red
41
42
  style Generic::Heading, :fg => :grey
@@ -30,7 +30,9 @@ module Rouge
30
30
  style Literal::String::Regex, :fg => :orange
31
31
  style Generic::Output, :fg => :dark_grey
32
32
  style Generic::Prompt, :fg => :emperor
33
- style Generic::Strong, :bold => false
33
+ style Generic::Emph, :italic => true
34
+ style Generic::EmphStrong, :italic => true, :bold => true
35
+ style Generic::Strong, :bold => true
34
36
  style Generic::Subheading, :fg => :light_grey
35
37
  style Name::Builtin, :fg => :orange
36
38
  style Comment::Multiline,
@@ -42,8 +44,7 @@ module Rouge
42
44
  Generic::Error,
43
45
  Generic::Traceback, :fg => :carmine
44
46
  style Generic::Deleted,
45
- Generic::Inserted,
46
- Generic::Emph, :fg => :dark
47
+ Generic::Inserted, :fg => :dark
47
48
  style Keyword::Constant,
48
49
  Keyword::Declaration,
49
50
  Keyword::Reserved,
@@ -22,6 +22,7 @@ module Rouge
22
22
  style Generic::Inserted, :fg => '#000000', :bg => '#ddffdd'
23
23
 
24
24
  style Generic::Emph, :italic => true
25
+ style Generic::EmphStrong, :italic => true, :bold => true
25
26
  style Generic::Strong, :bold => true
26
27
 
27
28
  style Generic::Lineno, :fg => '#888888'
@@ -38,6 +38,7 @@ module Rouge
38
38
  style Generic::Deleted, :fg => :scarletred2
39
39
  style Generic::Inserted, :fg => :go_get_it
40
40
  style Generic::Emph, :italic => true
41
+ style Generic::EmphStrong, :italic => true, :bold => true
41
42
  style Generic::Strong, :bold => true
42
43
  style Generic::Traceback, :fg => :eggshell_cloud, :bg => :slate_blue
43
44
  style Keyword::Constant, :fg => :pink_merengue, :bold => true
@@ -33,6 +33,7 @@ module Rouge
33
33
  style Generic::Deleted, :fg => :red
34
34
  style Generic::Inserted, :fg => :green
35
35
  style Generic::Emph, :italic => true
36
+ style Generic::EmphStrong, :italic => true, :bold => true
36
37
  style Generic::Strong, :bold => true
37
38
  style Generic::Traceback,
38
39
  Generic::Lineno, :fg => :white, :bg => :purple
data/lib/rouge/token.rb CHANGED
@@ -172,15 +172,16 @@ module Rouge
172
172
  token :Generic, 'g' do
173
173
  token :Deleted, 'gd'
174
174
  token :Emph, 'ge'
175
+ token :EmphStrong, 'ges'
175
176
  token :Error, 'gr'
176
177
  token :Heading, 'gh'
177
178
  token :Inserted, 'gi'
179
+ token :Lineno, 'gl'
178
180
  token :Output, 'go'
179
181
  token :Prompt, 'gp'
180
182
  token :Strong, 'gs'
181
183
  token :Subheading, 'gu'
182
184
  token :Traceback, 'gt'
183
- token :Lineno, 'gl'
184
185
  end
185
186
 
186
187
  # convenience
data/lib/rouge/version.rb CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  module Rouge
5
5
  def self.version
6
- "4.2.0"
6
+ "4.3.0"
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rouge
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.0
4
+ version: 4.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeanine Adkisson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-25 00:00:00.000000000 Z
11
+ date: 2024-06-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Rouge aims to a be a simple, easy-to-extend drop-in replacement for pygments.
14
14
  email:
@@ -109,6 +109,7 @@ files:
109
109
  - lib/rouge/demos/hylang
110
110
  - lib/rouge/demos/idlang
111
111
  - lib/rouge/demos/idris
112
+ - lib/rouge/demos/iecst
112
113
  - lib/rouge/demos/igorpro
113
114
  - lib/rouge/demos/ini
114
115
  - lib/rouge/demos/io
@@ -353,6 +354,7 @@ files:
353
354
  - lib/rouge/lexers/hylang.rb
354
355
  - lib/rouge/lexers/idlang.rb
355
356
  - lib/rouge/lexers/idris.rb
357
+ - lib/rouge/lexers/iecst.rb
356
358
  - lib/rouge/lexers/igorpro.rb
357
359
  - lib/rouge/lexers/ini.rb
358
360
  - lib/rouge/lexers/io.rb
@@ -547,7 +549,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
547
549
  - !ruby/object:Gem::Version
548
550
  version: '0'
549
551
  requirements: []
550
- rubygems_version: 3.4.10
552
+ rubygems_version: 3.5.3
551
553
  signing_key:
552
554
  specification_version: 4
553
555
  summary: A pure-ruby colorizer based on pygments