rouge 1.3.1 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a5ef3d5ad63da7030f7010aa8a8cf106ab9e996a
4
+ data.tar.gz: 57de8eafa29b51cce4cb7370b9848a9791b1ec5c
5
+ SHA512:
6
+ metadata.gz: 9177cafdf9183ecf4f9a28044fae665cd2fc26e684e1168ca591139e52f87ff40d426cc74a8b2520cceaa3824395c28009839de6fd9b1b4695b106ce362b7835
7
+ data.tar.gz: 4b9e68100dce51cf3475d581b40285ed7194857824c5356158b1502a59940d323f06b0de0169a842338e047b87a58773a92a93d70e1628e5f29d573d99dfcaab
data/Gemfile CHANGED
@@ -7,17 +7,17 @@ gem 'wrong'
7
7
 
8
8
  gem 'rake'
9
9
 
10
- gem 'racc'
11
-
12
10
  # don't try to install redcarpet under jruby
13
11
  gem 'redcarpet', :platforms => :ruby
14
12
 
15
- # for visual tests
16
- gem 'sinatra'
17
- gem 'shotgun'
13
+ group :development do
14
+ gem 'pry'
18
15
 
19
- # docs
20
- gem 'yard'
21
- gem 'github-markup'
16
+ # docs
17
+ gem 'yard'
18
+ gem 'github-markup'
22
19
 
23
- gem 'pry'
20
+ # for visual tests
21
+ gem 'sinatra'
22
+ gem 'shotgun'
23
+ end
data/lib/rouge/lexer.rb CHANGED
@@ -17,13 +17,6 @@ module Rouge
17
17
  new(opts).lex(stream, &b)
18
18
  end
19
19
 
20
- def load_const(const_name, relpath)
21
- return if Lexers.const_defined?(const_name)
22
-
23
- root = Pathname.new(__FILE__).dirname.join('lexers')
24
- load root.join(relpath)
25
- end
26
-
27
20
  def default_options(o={})
28
21
  @default_options ||= {}
29
22
  @default_options.merge!(o)
@@ -427,4 +420,13 @@ module Rouge
427
420
  0
428
421
  end
429
422
  end
423
+
424
+ module Lexers
425
+ def self.load_const(const_name, relpath)
426
+ return if const_defined?(const_name)
427
+
428
+ root = Pathname.new(__FILE__).dirname.join('lexers')
429
+ load root.join(relpath)
430
+ end
431
+ end
430
432
  end
@@ -95,7 +95,8 @@ module Rouge
95
95
  mixin :whitespace
96
96
  rule /L?"/, Str, :string
97
97
  rule %r(L?'(\\.|\\[0-7]{1,3}|\\x[a-f0-9]{1,2}|[^\\'\n])')i, Str::Char
98
- rule %r((\d+\.\d*|\.\d+|\d+)[e][+-]?\d+[lu]*)i, Num::Float
98
+ rule %r((\d+[.]\d*|[.]?\d+)e[+-]?\d+[lu]*)i, Num::Float
99
+ rule %r(\d+e[+-]?\d+[lu]*)i, Num::Float
99
100
  rule /0x[0-9a-f]+[lu]*/i, Num::Hex
100
101
  rule /0[0-7]+[lu]*/i, Num::Oct
101
102
  rule /\d+[lu]*/i, Num::Integer
@@ -1,6 +1,6 @@
1
1
  module Rouge
2
2
  module Lexers
3
- Lexer.load_const :C, 'c.rb'
3
+ load_const :C, 'c.rb'
4
4
 
5
5
  class Cpp < C
6
6
  desc "The C++ programming language"
@@ -37,8 +37,17 @@ module Rouge
37
37
  rule /(?:__offload|__blockingoffload|__outer)\b/, Keyword::Pseudo
38
38
  end
39
39
 
40
+ # digits with optional inner quotes
41
+ # see www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3781.pdf
42
+ dq = /\d('?\d)*/
43
+
40
44
  prepend :statements do
41
45
  rule /class\b/, Keyword, :classname
46
+ rule %r((#{dq}[.]#{dq}?|[.]#{dq})(e[+-]?#{dq}[lu]*)?)i, Num::Float
47
+ rule %r(#{dq}e[+-]?#{dq}[lu]*)i, Num::Float
48
+ rule /0x\h('?\h)*[lu]*/i, Num::Hex
49
+ rule /0[0-7]('?[0-7])*[lu]*/i, Num::Oct
50
+ rule /#{dq}[lu]*/i, Num::Integer
42
51
  end
43
52
 
44
53
  state :classname do
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Rouge
4
4
  module Lexers
5
- Lexer.load_const :Lua, 'lua.rb'
5
+ load_const :Lua, 'lua.rb'
6
6
 
7
7
  class Moonscript < RegexLexer
8
8
  desc "Moonscript (http://www.moonscript.org)"
@@ -1,6 +1,6 @@
1
1
  module Rouge
2
2
  module Lexers
3
- Lexer.load_const :C, 'c.rb'
3
+ load_const :C, 'c.rb'
4
4
 
5
5
  class ObjectiveC < C
6
6
  tag 'objective_c'
@@ -320,6 +320,11 @@ module Rouge
320
320
  goto :slash_regex
321
321
  end
322
322
 
323
+ rule /(\s*)(%=)/ do
324
+ groups Text, Operator
325
+ goto :expr_start
326
+ end
327
+
323
328
  rule(%r((?=\s*/))) { pop! }
324
329
 
325
330
  rule(//) { goto :expr_start }
@@ -1,6 +1,6 @@
1
1
  module Rouge
2
2
  module Lexers
3
- Lexer.load_const :SassCommon, 'sass/common.rb'
3
+ load_const :SassCommon, 'sass/common.rb'
4
4
 
5
5
  class Sass < SassCommon
6
6
  include Indentation
@@ -1,6 +1,6 @@
1
1
  module Rouge
2
2
  module Lexers
3
- Lexer.load_const :SassCommon, 'sass/common.rb'
3
+ load_const :SassCommon, 'sass/common.rb'
4
4
 
5
5
  class Scss < SassCommon
6
6
  desc "SCSS stylesheets (sass-lang.com)"
data/lib/rouge/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Rouge
2
2
  def self.version
3
- "1.3.1"
3
+ "1.3.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rouge
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
5
- prerelease:
4
+ version: 1.3.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Jay Adkisson
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-12-24 00:00:00.000000000 Z
11
+ date: 2014-01-13 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: Rouge aims to a be a simple, easy-to-extend drop-in replacement for pygments.
15
14
  email:
@@ -21,182 +20,181 @@ extra_rdoc_files: []
21
20
  files:
22
21
  - Gemfile
23
22
  - LICENSE
24
- - rouge.gemspec
25
- - lib/rouge/token.rb
26
- - lib/rouge/version.rb
27
- - lib/rouge/util.rb
28
- - lib/rouge/theme.rb
29
- - lib/rouge/lexer.rb
30
- - lib/rouge/template_lexer.rb
31
- - lib/rouge/formatter.rb
32
- - lib/rouge/plugins/redcarpet.rb
23
+ - bin/rougify
24
+ - lib/rouge.rb
33
25
  - lib/rouge/cli.rb
26
+ - lib/rouge/demos/c
27
+ - lib/rouge/demos/clojure
28
+ - lib/rouge/demos/coffeescript
29
+ - lib/rouge/demos/common_lisp
30
+ - lib/rouge/demos/conf
31
+ - lib/rouge/demos/cpp
32
+ - lib/rouge/demos/csharp
33
+ - lib/rouge/demos/css
34
+ - lib/rouge/demos/diff
35
+ - lib/rouge/demos/elixir
36
+ - lib/rouge/demos/erb
37
+ - lib/rouge/demos/erlang
38
+ - lib/rouge/demos/factor
39
+ - lib/rouge/demos/gherkin
40
+ - lib/rouge/demos/go
41
+ - lib/rouge/demos/groovy
42
+ - lib/rouge/demos/haml
43
+ - lib/rouge/demos/handlebars
44
+ - lib/rouge/demos/haskell
45
+ - lib/rouge/demos/html
46
+ - lib/rouge/demos/http
47
+ - lib/rouge/demos/ini
48
+ - lib/rouge/demos/io
49
+ - lib/rouge/demos/java
50
+ - lib/rouge/demos/javascript
51
+ - lib/rouge/demos/json
52
+ - lib/rouge/demos/literate_coffeescript
53
+ - lib/rouge/demos/literate_haskell
54
+ - lib/rouge/demos/llvm
55
+ - lib/rouge/demos/lua
56
+ - lib/rouge/demos/make
57
+ - lib/rouge/demos/markdown
58
+ - lib/rouge/demos/matlab
59
+ - lib/rouge/demos/moonscript
60
+ - lib/rouge/demos/nginx
61
+ - lib/rouge/demos/objective_c
62
+ - lib/rouge/demos/ocaml
63
+ - lib/rouge/demos/perl
64
+ - lib/rouge/demos/php
65
+ - lib/rouge/demos/plaintext
66
+ - lib/rouge/demos/prolog
67
+ - lib/rouge/demos/puppet
68
+ - lib/rouge/demos/python
69
+ - lib/rouge/demos/r
70
+ - lib/rouge/demos/racket
71
+ - lib/rouge/demos/ruby
72
+ - lib/rouge/demos/rust
73
+ - lib/rouge/demos/sass
74
+ - lib/rouge/demos/scala
75
+ - lib/rouge/demos/scheme
76
+ - lib/rouge/demos/scss
77
+ - lib/rouge/demos/sed
78
+ - lib/rouge/demos/shell
79
+ - lib/rouge/demos/smalltalk
80
+ - lib/rouge/demos/sml
81
+ - lib/rouge/demos/sql
82
+ - lib/rouge/demos/tcl
83
+ - lib/rouge/demos/tex
84
+ - lib/rouge/demos/toml
85
+ - lib/rouge/demos/vb
86
+ - lib/rouge/demos/viml
87
+ - lib/rouge/demos/xml
88
+ - lib/rouge/demos/yaml
89
+ - lib/rouge/formatter.rb
34
90
  - lib/rouge/formatters/html.rb
35
91
  - lib/rouge/formatters/terminal256.rb
36
- - lib/rouge/themes/thankful_eyes.rb
37
- - lib/rouge/themes/base16.rb
38
- - lib/rouge/themes/github.rb
39
- - lib/rouge/themes/monokai.rb
40
- - lib/rouge/themes/colorful.rb
41
- - lib/rouge/text_analyzer.rb
42
- - lib/rouge/regex_lexer.rb
43
- - lib/rouge/lexers/html.rb
44
- - lib/rouge/lexers/smalltalk.rb
92
+ - lib/rouge/lexer.rb
93
+ - lib/rouge/lexers/c.rb
45
94
  - lib/rouge/lexers/clojure.rb
46
- - lib/rouge/lexers/plain_text.rb
47
- - lib/rouge/lexers/sass/common.rb
48
- - lib/rouge/lexers/sass.rb
49
- - lib/rouge/lexers/factor.rb
50
- - lib/rouge/lexers/csharp.rb
51
- - lib/rouge/lexers/php/builtins.rb
52
- - lib/rouge/lexers/nginx.rb
53
- - lib/rouge/lexers/llvm.rb
54
- - lib/rouge/lexers/scala.rb
55
- - lib/rouge/lexers/perl.rb
56
- - lib/rouge/lexers/groovy.rb
57
- - lib/rouge/lexers/sed.rb
58
95
  - lib/rouge/lexers/coffeescript.rb
59
- - lib/rouge/lexers/literate_coffeescript.rb
60
- - lib/rouge/lexers/racket.rb
61
- - lib/rouge/lexers/diff.rb
62
- - lib/rouge/lexers/viml/keywords.rb
96
+ - lib/rouge/lexers/common_lisp.rb
97
+ - lib/rouge/lexers/conf.rb
98
+ - lib/rouge/lexers/cpp.rb
99
+ - lib/rouge/lexers/csharp.rb
63
100
  - lib/rouge/lexers/css.rb
64
- - lib/rouge/lexers/toml.rb
65
- - lib/rouge/lexers/moonscript.rb
66
- - lib/rouge/lexers/puppet.rb
67
- - lib/rouge/lexers/ruby.rb
68
- - lib/rouge/lexers/http.rb
69
- - lib/rouge/lexers/xml.rb
70
- - lib/rouge/lexers/handlebars.rb
71
- - lib/rouge/lexers/php.rb
72
- - lib/rouge/lexers/tcl.rb
73
- - lib/rouge/lexers/tex.rb
101
+ - lib/rouge/lexers/diff.rb
102
+ - lib/rouge/lexers/elixir.rb
103
+ - lib/rouge/lexers/erb.rb
104
+ - lib/rouge/lexers/erlang.rb
105
+ - lib/rouge/lexers/factor.rb
74
106
  - lib/rouge/lexers/gherkin.rb
75
- - lib/rouge/lexers/vb.rb
76
- - lib/rouge/lexers/rust.rb
107
+ - lib/rouge/lexers/gherkin/keywords.rb
108
+ - lib/rouge/lexers/go.rb
109
+ - lib/rouge/lexers/groovy.rb
110
+ - lib/rouge/lexers/haml.rb
111
+ - lib/rouge/lexers/handlebars.rb
112
+ - lib/rouge/lexers/haskell.rb
113
+ - lib/rouge/lexers/html.rb
114
+ - lib/rouge/lexers/http.rb
77
115
  - lib/rouge/lexers/ini.rb
78
- - lib/rouge/lexers/scss.rb
79
- - lib/rouge/lexers/javascript.rb
80
- - lib/rouge/lexers/shell.rb
81
- - lib/rouge/lexers/erlang.rb
82
- - lib/rouge/lexers/yaml.rb
83
- - lib/rouge/lexers/make.rb
84
- - lib/rouge/lexers/objective_c.rb
85
- - lib/rouge/lexers/lua.rb
86
- - lib/rouge/lexers/viml.rb
116
+ - lib/rouge/lexers/io.rb
87
117
  - lib/rouge/lexers/java.rb
88
- - lib/rouge/lexers/common_lisp.rb
89
- - lib/rouge/lexers/sml.rb
90
- - lib/rouge/lexers/scheme.rb
91
- - lib/rouge/lexers/haml.rb
92
- - lib/rouge/lexers/erb.rb
118
+ - lib/rouge/lexers/javascript.rb
119
+ - lib/rouge/lexers/literate_coffeescript.rb
93
120
  - lib/rouge/lexers/literate_haskell.rb
94
- - lib/rouge/lexers/c.rb
95
- - lib/rouge/lexers/gherkin/keywords.rb
96
- - lib/rouge/lexers/io.rb
97
- - lib/rouge/lexers/elixir.rb
121
+ - lib/rouge/lexers/llvm.rb
122
+ - lib/rouge/lexers/lua.rb
98
123
  - lib/rouge/lexers/lua/builtins.rb
99
- - lib/rouge/lexers/go.rb
100
- - lib/rouge/lexers/python.rb
101
- - lib/rouge/lexers/cpp.rb
102
- - lib/rouge/lexers/sql.rb
103
- - lib/rouge/lexers/haskell.rb
124
+ - lib/rouge/lexers/make.rb
125
+ - lib/rouge/lexers/markdown.rb
104
126
  - lib/rouge/lexers/matlab.rb
105
127
  - lib/rouge/lexers/matlab/builtins.rb
106
- - lib/rouge/lexers/r.rb
107
- - lib/rouge/lexers/markdown.rb
128
+ - lib/rouge/lexers/moonscript.rb
129
+ - lib/rouge/lexers/nginx.rb
130
+ - lib/rouge/lexers/objective_c.rb
108
131
  - lib/rouge/lexers/ocaml.rb
132
+ - lib/rouge/lexers/perl.rb
133
+ - lib/rouge/lexers/php.rb
134
+ - lib/rouge/lexers/php/builtins.rb
135
+ - lib/rouge/lexers/plain_text.rb
109
136
  - lib/rouge/lexers/prolog.rb
110
- - lib/rouge/lexers/conf.rb
111
- - lib/rouge.rb
112
- - bin/rougify
113
- - lib/rouge/demos/erlang
114
- - lib/rouge/demos/moonscript
115
- - lib/rouge/demos/sass
116
- - lib/rouge/demos/ruby
117
- - lib/rouge/demos/factor
118
- - lib/rouge/demos/smalltalk
119
- - lib/rouge/demos/yaml
120
- - lib/rouge/demos/handlebars
121
- - lib/rouge/demos/tex
122
- - lib/rouge/demos/racket
123
- - lib/rouge/demos/elixir
124
- - lib/rouge/demos/php
125
- - lib/rouge/demos/tcl
126
- - lib/rouge/demos/html
127
- - lib/rouge/demos/shell
128
- - lib/rouge/demos/perl
129
- - lib/rouge/demos/prolog
130
- - lib/rouge/demos/r
131
- - lib/rouge/demos/scala
132
- - lib/rouge/demos/viml
133
- - lib/rouge/demos/haskell
134
- - lib/rouge/demos/css
135
- - lib/rouge/demos/conf
136
- - lib/rouge/demos/haml
137
- - lib/rouge/demos/literate_haskell
138
- - lib/rouge/demos/io
139
- - lib/rouge/demos/c
140
- - lib/rouge/demos/scss
141
- - lib/rouge/demos/llvm
142
- - lib/rouge/demos/literate_coffeescript
143
- - lib/rouge/demos/python
144
- - lib/rouge/demos/make
145
- - lib/rouge/demos/clojure
146
- - lib/rouge/demos/java
147
- - lib/rouge/demos/csharp
148
- - lib/rouge/demos/go
149
- - lib/rouge/demos/javascript
150
- - lib/rouge/demos/sed
151
- - lib/rouge/demos/common_lisp
152
- - lib/rouge/demos/groovy
153
- - lib/rouge/demos/sml
154
- - lib/rouge/demos/nginx
155
- - lib/rouge/demos/vb
156
- - lib/rouge/demos/toml
157
- - lib/rouge/demos/gherkin
158
- - lib/rouge/demos/http
159
- - lib/rouge/demos/rust
160
- - lib/rouge/demos/json
161
- - lib/rouge/demos/markdown
162
- - lib/rouge/demos/plaintext
163
- - lib/rouge/demos/xml
164
- - lib/rouge/demos/lua
165
- - lib/rouge/demos/erb
166
- - lib/rouge/demos/cpp
167
- - lib/rouge/demos/coffeescript
168
- - lib/rouge/demos/objective_c
169
- - lib/rouge/demos/sql
170
- - lib/rouge/demos/puppet
171
- - lib/rouge/demos/matlab
172
- - lib/rouge/demos/ini
173
- - lib/rouge/demos/ocaml
174
- - lib/rouge/demos/scheme
175
- - lib/rouge/demos/diff
137
+ - lib/rouge/lexers/puppet.rb
138
+ - lib/rouge/lexers/python.rb
139
+ - lib/rouge/lexers/r.rb
140
+ - lib/rouge/lexers/racket.rb
141
+ - lib/rouge/lexers/ruby.rb
142
+ - lib/rouge/lexers/rust.rb
143
+ - lib/rouge/lexers/sass.rb
144
+ - lib/rouge/lexers/sass/common.rb
145
+ - lib/rouge/lexers/scala.rb
146
+ - lib/rouge/lexers/scheme.rb
147
+ - lib/rouge/lexers/scss.rb
148
+ - lib/rouge/lexers/sed.rb
149
+ - lib/rouge/lexers/shell.rb
150
+ - lib/rouge/lexers/smalltalk.rb
151
+ - lib/rouge/lexers/sml.rb
152
+ - lib/rouge/lexers/sql.rb
153
+ - lib/rouge/lexers/tcl.rb
154
+ - lib/rouge/lexers/tex.rb
155
+ - lib/rouge/lexers/toml.rb
156
+ - lib/rouge/lexers/vb.rb
157
+ - lib/rouge/lexers/viml.rb
158
+ - lib/rouge/lexers/viml/keywords.rb
159
+ - lib/rouge/lexers/xml.rb
160
+ - lib/rouge/lexers/yaml.rb
161
+ - lib/rouge/plugins/redcarpet.rb
162
+ - lib/rouge/regex_lexer.rb
163
+ - lib/rouge/template_lexer.rb
164
+ - lib/rouge/text_analyzer.rb
165
+ - lib/rouge/theme.rb
166
+ - lib/rouge/themes/base16.rb
167
+ - lib/rouge/themes/colorful.rb
168
+ - lib/rouge/themes/github.rb
169
+ - lib/rouge/themes/monokai.rb
170
+ - lib/rouge/themes/thankful_eyes.rb
171
+ - lib/rouge/token.rb
172
+ - lib/rouge/util.rb
173
+ - lib/rouge/version.rb
174
+ - rouge.gemspec
176
175
  homepage: http://github.com/jayferd/rouge
177
176
  licenses:
178
177
  - MIT (see LICENSE file)
178
+ metadata: {}
179
179
  post_install_message:
180
180
  rdoc_options: []
181
181
  require_paths:
182
182
  - lib
183
183
  required_ruby_version: !ruby/object:Gem::Requirement
184
- none: false
185
184
  requirements:
186
- - - ! '>='
185
+ - - ">="
187
186
  - !ruby/object:Gem::Version
188
187
  version: '0'
189
188
  required_rubygems_version: !ruby/object:Gem::Requirement
190
- none: false
191
189
  requirements:
192
- - - ! '>='
190
+ - - ">="
193
191
  - !ruby/object:Gem::Version
194
192
  version: '0'
195
193
  requirements: []
196
194
  rubyforge_project: rouge
197
- rubygems_version: 1.8.23
195
+ rubygems_version: 2.2.0
198
196
  signing_key:
199
- specification_version: 3
197
+ specification_version: 4
200
198
  summary: A pure-ruby colorizer based on pygments
201
199
  test_files: []
202
200
  has_rdoc: