rouge 3.7.0 → 3.8.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.
@@ -0,0 +1,26 @@
1
+ # -*- coding: utf-8 -*- #
2
+ # frozen_string_literal: true
3
+
4
+ module Rouge
5
+ module Lexers
6
+ class MsgTrans < RegexLexer
7
+ title "MessageTrans"
8
+ desc "RISC OS message translator messages file"
9
+ tag 'msgtrans'
10
+ filenames 'Messages', 'Message[0-9]', 'Message[1-9][0-9]', 'Message[1-9][0-9][0-9]'
11
+
12
+ state :root do
13
+ rule %r/^#[^\n]*/, Comment
14
+ rule %r/[^\t\n\r ,):?\/]+/, Name::Variable
15
+ rule %r/[\n\/?]/, Operator
16
+ rule %r/:/, Operator, :value
17
+ end
18
+
19
+ state :value do
20
+ rule %r/\n/, Text, :pop!
21
+ rule %r/%[0-3%]/, Operator
22
+ rule %r/[^\n%]/, Literal::String
23
+ end
24
+ end
25
+ end
26
+ end
@@ -9,7 +9,7 @@ module Rouge
9
9
 
10
10
  tag 'plaintext'
11
11
  aliases 'text'
12
- filenames '*.txt'
12
+ filenames '*.txt', 'Messages'
13
13
  mimetypes 'text/plain'
14
14
 
15
15
  attr_reader :token
@@ -59,7 +59,7 @@ module Rouge
59
59
  rule cap_id, Name::Class
60
60
 
61
61
  rule %r/[+=|~-]>|<[|~-]/, Punctuation
62
- rule %r/[:}();\[\]]/, Punctuation
62
+ rule %r/[|:}();\[\]]/, Punctuation
63
63
 
64
64
  # HACK for case statements and selectors
65
65
  rule %r/{/, Punctuation, :regex_allowed
@@ -68,7 +68,7 @@ module Rouge
68
68
  rule %r/(in|and|or)\b/, Operator::Word
69
69
  rule %r/[=!<>]=/, Operator
70
70
  rule %r/[=!]~/, Operator, :regex_allowed
71
- rule %r([=<>!+*/-]), Operator
71
+ rule %r([.=<>!+*/-]), Operator
72
72
 
73
73
  rule %r/(class|include)(\s*)(#{qualname})/ do
74
74
  groups Keyword, Text, Name::Class
@@ -60,8 +60,7 @@ module Rouge
60
60
  rule %r/%[^%]*?%/, Operator
61
61
 
62
62
  rule %r/0[xX][a-fA-F0-9]+([pP][0-9]+)?[Li]?/, Num::Hex
63
- rule %r/[+-]?(\d+([.]\d+)?|[.]\d+)([eE][+-]?\d+)?[Li]?/,
64
- Num
63
+ rule %r/[+-]?(\d+([.]\d+)?|[.]\d+)([eE][+-]?\d+)?[Li]?/, Num
65
64
 
66
65
  # Only recognize built-in functions when they are actually used as a
67
66
  # function call, i.e. followed by an opening parenthesis.
@@ -69,7 +68,7 @@ module Rouge
69
68
  # highlighted specifically; thus use `Name::Function`.
70
69
  rule %r/\b(?<!.)(#{PRIMITIVE_FUNCTIONS.join('|')})(?=\()/, Name::Function
71
70
 
72
- rule %r/[a-zA-Z.]([a-zA-Z_][\w.]*)?/ do |m|
71
+ rule %r/(?:(?:[[:alpha:]]|[.][._[:alpha:]])[._[:alnum:]]*)|[.]/ do |m|
73
72
  if KEYWORDS.include? m[0]
74
73
  token Keyword
75
74
  elsif KEYWORD_CONSTANTS.include? m[0]
@@ -141,7 +141,7 @@ module Rouge
141
141
  end
142
142
 
143
143
  # alternate regex rage delimiters
144
- rule %r((\\)(.)(\\.|.)*?(\2)) do |m|
144
+ rule %r((\\)(.)((?:\\.|.)*?)(\2)) do |m|
145
145
  token addr_tok, m[1] + m[2]
146
146
  delegate regex, m[3]
147
147
  token addr_tok, m[4]
@@ -113,7 +113,8 @@ END
113
113
  end
114
114
 
115
115
  def render_style(tok, style, &b)
116
- out = "\\expandafter\\def#{token_name(tok)}#1{"
116
+ out = String.new('')
117
+ out << "\\expandafter\\def#{token_name(tok)}#1{"
117
118
  out << "\\fboxsep=0pt\\colorbox{#{palette_name(style[:bg])}}{" if style[:bg]
118
119
  out << '\\textbf{' if style[:bold]
119
120
  out << '\\textit{' if style[:italic]
@@ -67,8 +67,8 @@ module Rouge
67
67
  Literal::String::Interpol, :fg => :purple, :bold => true
68
68
  style Name::Builtin, :bold => true
69
69
  style Name::Entity, :fg => :darkgray, :bold => true
70
- style Text::Whitespace,
71
- Generic::Output, :fg => :lightgray
70
+ style Text::Whitespace, :fg => :lightgray
71
+ style Generic::Output, :fg => :royal
72
72
  style Name::Function,
73
73
  Name::Property,
74
74
  Name::Attribute, :fg => :candy
@@ -3,6 +3,6 @@
3
3
 
4
4
  module Rouge
5
5
  def self.version
6
- "3.7.0"
6
+ "3.8.0"
7
7
  end
8
8
  end
@@ -18,7 +18,9 @@ Gem::Specification.new do |s|
18
18
  s.licenses = ['MIT', 'BSD-2-Clause']
19
19
  s.required_ruby_version = '>= 2.0'
20
20
  s.metadata = {
21
- 'source_code_uri' => 'https://github.com/jneen/rouge',
22
- 'changelog_uri' => 'https://github.com/jneen/rouge/blob/master/CHANGELOG.md'
21
+ "bug_tracker_uri" => "https://github.com/rouge-ruby/rouge/issues",
22
+ "changelog_uri" => "https://github.com/rouge-ruby/rouge/blob/master/CHANGELOG.md",
23
+ "documentation_uri" => "https://rouge-ruby.github.io/docs/",
24
+ "source_code_uri" => "https://github.com/rouge-ruby/rouge"
23
25
  }
24
26
  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: 3.7.0
4
+ version: 3.8.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: 2019-07-23 00:00:00.000000000 Z
11
+ date: 2019-08-06 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:
@@ -29,7 +29,10 @@ files:
29
29
  - lib/rouge/demos/apache
30
30
  - lib/rouge/demos/apiblueprint
31
31
  - lib/rouge/demos/applescript
32
+ - lib/rouge/demos/armasm
32
33
  - lib/rouge/demos/awk
34
+ - lib/rouge/demos/batchfile
35
+ - lib/rouge/demos/bbcbasic
33
36
  - lib/rouge/demos/biml
34
37
  - lib/rouge/demos/bpf
35
38
  - lib/rouge/demos/brainfuck
@@ -39,6 +42,7 @@ files:
39
42
  - lib/rouge/demos/cfscript
40
43
  - lib/rouge/demos/clojure
41
44
  - lib/rouge/demos/cmake
45
+ - lib/rouge/demos/cmhg
42
46
  - lib/rouge/demos/coffeescript
43
47
  - lib/rouge/demos/common_lisp
44
48
  - lib/rouge/demos/conf
@@ -49,6 +53,7 @@ files:
49
53
  - lib/rouge/demos/csharp
50
54
  - lib/rouge/demos/css
51
55
  - lib/rouge/demos/cuda
56
+ - lib/rouge/demos/cython
52
57
  - lib/rouge/demos/d
53
58
  - lib/rouge/demos/dart
54
59
  - lib/rouge/demos/diff
@@ -58,6 +63,7 @@ files:
58
63
  - lib/rouge/demos/eiffel
59
64
  - lib/rouge/demos/elixir
60
65
  - lib/rouge/demos/elm
66
+ - lib/rouge/demos/epp
61
67
  - lib/rouge/demos/erb
62
68
  - lib/rouge/demos/erlang
63
69
  - lib/rouge/demos/escape
@@ -111,6 +117,7 @@ files:
111
117
  - lib/rouge/demos/matlab
112
118
  - lib/rouge/demos/moonscript
113
119
  - lib/rouge/demos/mosel
120
+ - lib/rouge/demos/msgtrans
114
121
  - lib/rouge/demos/mxml
115
122
  - lib/rouge/demos/nasm
116
123
  - lib/rouge/demos/nginx
@@ -206,7 +213,10 @@ files:
206
213
  - lib/rouge/lexers/apache/keywords.yml
207
214
  - lib/rouge/lexers/apiblueprint.rb
208
215
  - lib/rouge/lexers/apple_script.rb
216
+ - lib/rouge/lexers/armasm.rb
209
217
  - lib/rouge/lexers/awk.rb
218
+ - lib/rouge/lexers/batchfile.rb
219
+ - lib/rouge/lexers/bbcbasic.rb
210
220
  - lib/rouge/lexers/biml.rb
211
221
  - lib/rouge/lexers/bpf.rb
212
222
  - lib/rouge/lexers/brainfuck.rb
@@ -216,6 +226,7 @@ files:
216
226
  - lib/rouge/lexers/cfscript.rb
217
227
  - lib/rouge/lexers/clojure.rb
218
228
  - lib/rouge/lexers/cmake.rb
229
+ - lib/rouge/lexers/cmhg.rb
219
230
  - lib/rouge/lexers/coffeescript.rb
220
231
  - lib/rouge/lexers/common_lisp.rb
221
232
  - lib/rouge/lexers/conf.rb
@@ -226,6 +237,7 @@ files:
226
237
  - lib/rouge/lexers/csharp.rb
227
238
  - lib/rouge/lexers/css.rb
228
239
  - lib/rouge/lexers/cuda.rb
240
+ - lib/rouge/lexers/cython.rb
229
241
  - lib/rouge/lexers/d.rb
230
242
  - lib/rouge/lexers/dart.rb
231
243
  - lib/rouge/lexers/diff.rb
@@ -235,6 +247,7 @@ files:
235
247
  - lib/rouge/lexers/eiffel.rb
236
248
  - lib/rouge/lexers/elixir.rb
237
249
  - lib/rouge/lexers/elm.rb
250
+ - lib/rouge/lexers/epp.rb
238
251
  - lib/rouge/lexers/erb.rb
239
252
  - lib/rouge/lexers/erlang.rb
240
253
  - lib/rouge/lexers/escape.rb
@@ -292,6 +305,7 @@ files:
292
305
  - lib/rouge/lexers/matlab/builtins.rb
293
306
  - lib/rouge/lexers/moonscript.rb
294
307
  - lib/rouge/lexers/mosel.rb
308
+ - lib/rouge/lexers/msgtrans.rb
295
309
  - lib/rouge/lexers/mxml.rb
296
310
  - lib/rouge/lexers/nasm.rb
297
311
  - lib/rouge/lexers/nginx.rb
@@ -394,8 +408,10 @@ licenses:
394
408
  - MIT
395
409
  - BSD-2-Clause
396
410
  metadata:
397
- source_code_uri: https://github.com/jneen/rouge
398
- changelog_uri: https://github.com/jneen/rouge/blob/master/CHANGELOG.md
411
+ bug_tracker_uri: https://github.com/rouge-ruby/rouge/issues
412
+ changelog_uri: https://github.com/rouge-ruby/rouge/blob/master/CHANGELOG.md
413
+ documentation_uri: https://rouge-ruby.github.io/docs/
414
+ source_code_uri: https://github.com/rouge-ruby/rouge
399
415
  post_install_message:
400
416
  rdoc_options: []
401
417
  require_paths:
@@ -411,7 +427,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
411
427
  - !ruby/object:Gem::Version
412
428
  version: '0'
413
429
  requirements: []
414
- rubygems_version: 3.0.4
430
+ rubygems_version: 3.0.3
415
431
  signing_key:
416
432
  specification_version: 4
417
433
  summary: A pure-ruby colorizer based on pygments