rouge 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +11 -7
- data/lib/rouge/cli.rb +3 -3
- data/lib/rouge/formatters/html.rb +1 -1
- data/lib/rouge/lexers/console.rb +2 -2
- data/lib/rouge/lexers/elixir.rb +1 -1
- data/lib/rouge/lexers/http.rb +1 -1
- data/lib/rouge/lexers/igorpro.rb +2 -2
- data/lib/rouge/lexers/liquid.rb +3 -3
- data/lib/rouge/lexers/make.rb +1 -1
- data/lib/rouge/lexers/matlab.rb +1 -1
- data/lib/rouge/lexers/mosel.rb +6 -6
- data/lib/rouge/lexers/nasm.rb +1 -1
- data/lib/rouge/lexers/praat.rb +3 -3
- data/lib/rouge/lexers/protobuf.rb +3 -3
- data/lib/rouge/lexers/wollok.rb +1 -1
- data/lib/rouge/regex_lexer.rb +3 -2
- data/lib/rouge/util.rb +3 -3
- data/lib/rouge/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 726f116a1b78032be65f6abef810b5b1db42a093
|
4
|
+
data.tar.gz: acb0e9e2ad10c72f5e455517f17b71382693016b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb8b9f3139cc5d9539aa4b539a6c03f1b36630bc2483bac383cce749cff0f8b87565eeaa30ec74a0312098b77ae5e89824b063a89e36d1e53a986ad330a97e6f
|
7
|
+
data.tar.gz: 61a48f640f1594d76ff48efe7501a3c5c151d9703d130a6d25db3c318a882b494a0409b9df8103c32fed6fad6768e617d158b84dedfb0b64dbd07dceaf4456e8
|
data/Gemfile
CHANGED
@@ -5,17 +5,21 @@ gemspec
|
|
5
5
|
gem 'minitest', '~> 4.0'
|
6
6
|
gem 'wrong'
|
7
7
|
|
8
|
+
gem 'rubocop', '~> 0.49.1' if RUBY_VERSION >= '2.0.0'
|
9
|
+
|
8
10
|
gem 'rake'
|
9
11
|
|
10
12
|
# don't try to install redcarpet under jruby
|
11
13
|
gem 'redcarpet', :platforms => :ruby
|
12
14
|
|
13
|
-
|
15
|
+
group :development do
|
16
|
+
gem 'pry'
|
14
17
|
|
15
|
-
# docs
|
16
|
-
gem 'yard'
|
17
|
-
gem 'github-markup'
|
18
|
+
# docs
|
19
|
+
gem 'yard'
|
20
|
+
gem 'github-markup'
|
18
21
|
|
19
|
-
# for visual tests
|
20
|
-
gem 'sinatra'
|
21
|
-
gem 'shotgun'
|
22
|
+
# for visual tests
|
23
|
+
gem 'sinatra'
|
24
|
+
gem 'shotgun'
|
25
|
+
end
|
data/lib/rouge/cli.rb
CHANGED
@@ -66,7 +66,7 @@ module Rouge
|
|
66
66
|
return klass.parse(argv) if klass
|
67
67
|
|
68
68
|
case mode
|
69
|
-
when '-h', '--help', 'help', '-help'
|
69
|
+
when '-h', '--help', 'help', '-help', nil
|
70
70
|
Help.parse(argv)
|
71
71
|
else
|
72
72
|
argv.unshift(mode) if mode
|
@@ -282,7 +282,7 @@ module Rouge
|
|
282
282
|
formatter.format(lexer.lex(input), &method(:print))
|
283
283
|
end
|
284
284
|
|
285
|
-
|
285
|
+
private_class_method
|
286
286
|
def self.parse_cgi(str)
|
287
287
|
pairs = CGI.parse(str).map { |k, v| [k.to_sym, v.first] }
|
288
288
|
Hash[pairs]
|
@@ -374,7 +374,7 @@ module Rouge
|
|
374
374
|
end
|
375
375
|
end
|
376
376
|
|
377
|
-
|
377
|
+
private_class_method
|
378
378
|
def self.normalize_syntax(argv)
|
379
379
|
out = []
|
380
380
|
argv.each do |arg|
|
data/lib/rouge/lexers/console.rb
CHANGED
data/lib/rouge/lexers/elixir.rb
CHANGED
@@ -20,7 +20,7 @@ module Rouge
|
|
20
20
|
rule /#.*$/, Comment::Single
|
21
21
|
rule %r{\b(case|cond|end|bc|lc|if|unless|try|loop|receive|fn|defmodule|
|
22
22
|
defp?|defprotocol|defimpl|defrecord|defmacrop?|defdelegate|
|
23
|
-
defexception|exit|raise|throw|
|
23
|
+
defexception|exit|raise|throw|after|rescue|catch|else)\b(?![?!])|
|
24
24
|
(?<!\.)\b(do|\-\>)\b}x, Keyword
|
25
25
|
rule /\b(import|require|use|recur|quote|unquote|super|refer)\b(?![?!])/, Keyword::Namespace
|
26
26
|
rule /(?<!\.)\b(and|not|or|when|xor|in)\b/, Operator::Word
|
data/lib/rouge/lexers/http.rb
CHANGED
data/lib/rouge/lexers/igorpro.rb
CHANGED
@@ -263,7 +263,7 @@ module Rouge
|
|
263
263
|
rule %r(//), Comment, :comments
|
264
264
|
|
265
265
|
rule /\b#{object}/ do |m|
|
266
|
-
if m[0].downcase
|
266
|
+
if m[0].downcase =~ /function/
|
267
267
|
token Keyword::Declaration
|
268
268
|
push :parse_function
|
269
269
|
elsif self.class.igorDeclarations.include? m[0].downcase
|
@@ -281,7 +281,7 @@ module Rouge
|
|
281
281
|
elsif self.class.hdf5Operation.include? m[0].downcase
|
282
282
|
token Keyword::Reserved
|
283
283
|
push :operationFlags
|
284
|
-
elsif m[0].downcase
|
284
|
+
elsif m[0].downcase =~ /(v|s|w)_[a-z]+[a-z0-9]*/
|
285
285
|
token Name::Builtin
|
286
286
|
else
|
287
287
|
token Name
|
data/lib/rouge/lexers/liquid.rb
CHANGED
@@ -105,7 +105,7 @@ module Rouge
|
|
105
105
|
state :filters do
|
106
106
|
mixin :whitespace
|
107
107
|
|
108
|
-
rule
|
108
|
+
rule(/\}\}/) { token Punctuation; reset_stack }
|
109
109
|
|
110
110
|
rule /([^\s\|:]+)(:?)(\s*)/ do
|
111
111
|
groups Name::Function, Punctuation, Text::Whitespace
|
@@ -156,11 +156,11 @@ module Rouge
|
|
156
156
|
end
|
157
157
|
|
158
158
|
state :end_of_tag do
|
159
|
-
rule
|
159
|
+
rule(/\}\}/) { token Punctuation; reset_stack }
|
160
160
|
end
|
161
161
|
|
162
162
|
state :end_of_block do
|
163
|
-
rule
|
163
|
+
rule(/%\}/) { token Punctuation; reset_stack }
|
164
164
|
end
|
165
165
|
|
166
166
|
# states for unknown markup
|
data/lib/rouge/lexers/make.rb
CHANGED
data/lib/rouge/lexers/matlab.rb
CHANGED
@@ -11,7 +11,7 @@ module Rouge
|
|
11
11
|
mimetypes 'text/x-matlab', 'application/x-matlab'
|
12
12
|
|
13
13
|
def self.analyze_text(text)
|
14
|
-
return 0.4 if text
|
14
|
+
return 0.4 if text =~ /^\s*% / # % comments are a dead giveaway
|
15
15
|
end
|
16
16
|
|
17
17
|
def self.keywords
|
data/lib/rouge/lexers/mosel.rb
CHANGED
@@ -73,7 +73,7 @@ module Rouge
|
|
73
73
|
getbstat getdualray getiis getiissense getiistype getinfcause getinfeas getlb getloadedlinctrs getloadedmpvars getname getprimalray getprobstat getrange getsensrng getsize getsol getub getvars
|
74
74
|
implies indicator isiisvalid isintegral loadbasis
|
75
75
|
loadmipsol loadprob
|
76
|
-
maximize
|
76
|
+
maximize minimize
|
77
77
|
postsolve
|
78
78
|
readbasis readdirs readsol refinemipsol rejectintsol repairinfeas resetbasis resetiis resetsol
|
79
79
|
savebasis savemipsol savesol savestate selectsol setbstat setcallback setcbcutoff setgndata setlb setmipdir setmodcut setsol setub setucbdata stopoptimize
|
@@ -100,15 +100,15 @@ module Rouge
|
|
100
100
|
getasnumber getchar getcwd getdate getday getdaynum getdays getdirsep
|
101
101
|
getendparse setendparse
|
102
102
|
getenv getfsize getfstat getftime gethour getminute getmonth getmsec getpathsep
|
103
|
-
getqtype
|
103
|
+
getqtype setqtype
|
104
104
|
getsecond
|
105
|
-
getsepchar
|
105
|
+
getsepchar setsepchar
|
106
106
|
getsize
|
107
|
-
getstart
|
108
|
-
getsucc
|
107
|
+
getstart setstart
|
108
|
+
getsucc setsucc
|
109
109
|
getsysinfo getsysstat gettime
|
110
110
|
gettmpdir
|
111
|
-
gettrim
|
111
|
+
gettrim settrim
|
112
112
|
getweekday getyear
|
113
113
|
inserttext isvalid
|
114
114
|
makedir makepath newtar
|
data/lib/rouge/lexers/nasm.rb
CHANGED
data/lib/rouge/lexers/praat.rb
CHANGED
@@ -166,7 +166,7 @@ module Rouge
|
|
166
166
|
push :comma_list
|
167
167
|
end
|
168
168
|
|
169
|
-
rule /[\s
|
169
|
+
rule /[\s]/, Text, :pop!
|
170
170
|
end
|
171
171
|
|
172
172
|
state :procedure_call do
|
@@ -175,7 +175,7 @@ module Rouge
|
|
175
175
|
rule /(:|\s*\()/, Punctuation, :pop!
|
176
176
|
|
177
177
|
rule /'/, Name::Function
|
178
|
-
rule /[^:\('\
|
178
|
+
rule /[^:\('\s]+/, Name::Function
|
179
179
|
|
180
180
|
rule /(?=\s+)/ do
|
181
181
|
token Text
|
@@ -187,7 +187,7 @@ module Rouge
|
|
187
187
|
state :procedure_definition do
|
188
188
|
rule /(:|\s*\()/, Punctuation, :pop!
|
189
189
|
|
190
|
-
rule /[^:\(\
|
190
|
+
rule /[^:\(\s]+/, Name::Function
|
191
191
|
|
192
192
|
rule /(\s+)/, Text, :pop!
|
193
193
|
end
|
@@ -53,17 +53,17 @@ module Rouge
|
|
53
53
|
|
54
54
|
state :package do
|
55
55
|
rule /[a-zA-Z_]\w*/, Name::Namespace, :pop!
|
56
|
-
rule
|
56
|
+
rule(//) { pop! }
|
57
57
|
end
|
58
58
|
|
59
59
|
state :message do
|
60
60
|
rule /[a-zA-Z_]\w*/, Name::Class, :pop!
|
61
|
-
rule
|
61
|
+
rule(//) { pop! }
|
62
62
|
end
|
63
63
|
|
64
64
|
state :type do
|
65
65
|
rule /[a-zA-Z_]\w*/, Name, :pop!
|
66
|
-
rule
|
66
|
+
rule(//) { pop! }
|
67
67
|
end
|
68
68
|
end
|
69
69
|
end
|
data/lib/rouge/lexers/wollok.rb
CHANGED
@@ -71,7 +71,7 @@ module Rouge
|
|
71
71
|
state :objects do
|
72
72
|
rule variable_naming do |m|
|
73
73
|
variable = m[0]
|
74
|
-
if entities.include?(variable) || ('A'..'Z').
|
74
|
+
if entities.include?(variable) || ('A'..'Z').cover?(variable[0])
|
75
75
|
token Name::Class
|
76
76
|
else
|
77
77
|
token Keyword::Variable
|
data/lib/rouge/regex_lexer.rb
CHANGED
@@ -46,6 +46,7 @@ module Rouge
|
|
46
46
|
@name = name
|
47
47
|
@defn = defn
|
48
48
|
@rules = []
|
49
|
+
@loaded = false
|
49
50
|
end
|
50
51
|
|
51
52
|
def to_state(lexer_class)
|
@@ -102,7 +103,7 @@ module Rouge
|
|
102
103
|
proc do |stream|
|
103
104
|
puts " yielding #{tok.qualname}, #{stream[0].inspect}" if @debug
|
104
105
|
@output_stream.call(tok, stream[0])
|
105
|
-
puts " popping stack:
|
106
|
+
puts " popping stack: 1" if @debug
|
106
107
|
@stack.pop or raise 'empty stack!'
|
107
108
|
end
|
108
109
|
when :push
|
@@ -300,7 +301,7 @@ module Rouge
|
|
300
301
|
# the most common, for now...
|
301
302
|
next if rule.beginning_of_line && !stream.beginning_of_line?
|
302
303
|
|
303
|
-
if size = stream.skip(rule.re)
|
304
|
+
if (size = stream.skip(rule.re))
|
304
305
|
puts " got #{stream[0].inspect}" if @debug
|
305
306
|
|
306
307
|
instance_exec(stream, &rule.callback)
|
data/lib/rouge/util.rb
CHANGED
data/lib/rouge/version.rb
CHANGED
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: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeanine Adkisson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-22 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:
|