rouge 1.8.0 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb12f42e4a61412bfcb144f6c7a3f0bdee592a0d
4
- data.tar.gz: 64ed9c6cd72560e3d34ec0f5476b2643eadf1076
3
+ metadata.gz: adb7cda324b7dd6e49be5dccd1e4ca75bff7fc2f
4
+ data.tar.gz: e3ebe723270949c77cc11d16523ae58884527b8b
5
5
  SHA512:
6
- metadata.gz: 9387f40bda37a8b68bbbb21539749bd228fb642f32a1095bed0ec764ee9ec59bb84eb7c5131f66f4240cee32406c5b62986ae98f3ef114be6dd50e04ae5bea32
7
- data.tar.gz: 733371e70bd2af9a4ec2d989ba69c96a1117525e15375ff2d0175628759c8e64c67f5519dbb0870dc3dc1015821396b2310200f71acd7d3ea4f794f22140f105
6
+ metadata.gz: 26279e371f5367170cd0767402211252e635929e836219b3c278dd133eee45b9e22f42d06388ce8dbc77a58f6ec016333fd7ec8ca19d79f7cdd2a164ea172bc8
7
+ data.tar.gz: 21183cbc27313fccb93ef5a13abfdf0f81e9c4ba102dbd5f42422901775f0f6cae367b77443a543a9e385929b427e09fba998bc953d715600f92710253af2c18
@@ -165,6 +165,10 @@ module Rouge
165
165
  yield %[ based on --mimetype, the filename, and the]
166
166
  yield %[ file contents.]
167
167
  yield %[]
168
+ yield %[--formatter|-f <opts> specify the output formatter to use.]
169
+ yield %[ If not provided, rougify will default to]
170
+ yield %[ terminal256.]
171
+ yield %[]
168
172
  yield %[--mimetype|-m <mimetype> specify a mimetype for lexer guessing]
169
173
  yield %[]
170
174
  yield %[--lexer-opts|-L <opts> specify lexer options in CGI format]
@@ -0,0 +1,14 @@
1
+ #version 330 core
2
+
3
+ uniform mat4 worldMatrix;
4
+
5
+ layout(location = 0) in vec2 position;
6
+ layout(location = 1) in vec4 color;
7
+
8
+ out vec4 vertexColor;
9
+
10
+ void main()
11
+ {
12
+ vertexColor = color;
13
+ gl_Position = vec4(position, 0.0, 1.0);
14
+ }
@@ -0,0 +1 @@
1
+ { "one": 1, "two": 2, "null": null, "simple": true } // a simple json object
@@ -10,3 +10,5 @@
10
10
 
11
11
  -(id)initWithAge:(int)age;
12
12
  @end
13
+
14
+ NSArray *arrayLiteral = @[@"abc", @1];
@@ -150,7 +150,7 @@ module Rouge
150
150
  # other hints.
151
151
  #
152
152
  # @see Lexer.analyze_text
153
- # @see Lexer.multi_guess
153
+ # @see Lexer.guesses
154
154
  def guess(info={})
155
155
  lexers = guesses(info)
156
156
 
@@ -14,7 +14,8 @@ module Rouge
14
14
  filenames '*.cpp', '*.hpp',
15
15
  '*.c++', '*.h++',
16
16
  '*.cc', '*.hh',
17
- '*.cxx', '*.hxx'
17
+ '*.cxx', '*.hxx',
18
+ '*.pde', '*.ino'
18
19
  mimetypes 'text/x-c++hdr', 'text/x-c++src'
19
20
 
20
21
  def self.keywords
@@ -1,10 +1,8 @@
1
- # -*- coding: utf-8 -*- #
2
-
3
1
  module Rouge
4
2
  module Lexers
5
3
  class Diff < RegexLexer
6
- title "diff"
7
- desc "Lexes unified diffs or patches"
4
+ title 'diff'
5
+ desc 'Lexes unified diffs or patches'
8
6
 
9
7
  tag 'diff'
10
8
  aliases 'patch', 'udiff'
@@ -15,26 +13,21 @@ module Rouge
15
13
  return 1 if text.start_with?('Index: ')
16
14
  return 1 if text.start_with?('diff ')
17
15
 
16
+ # TODO: Have a look at pygments here, seems better
18
17
  return 0.9 if text =~ /\A---.*?\n\+\+\+/m
19
18
  end
20
19
 
21
- state :header do
22
- rule /^diff .*?\n(?=---|\+\+\+)/m, Generic::Heading
23
- rule /^--- .*?\n/, Generic::Deleted
24
- rule /^\+\+\+ .*?\n/, Generic::Inserted
25
- end
26
-
27
- state :diff do
28
- rule /@@ -\d+,\d+ \+\d+,\d+ @@.*?\n/, Generic::Heading
29
- rule /^\+.*?\n/, Generic::Inserted
30
- rule /^-.*?\n/, Generic::Deleted
31
- rule /^ .*?\n/, Text
32
- rule /^.*?\n/, Error
33
- end
34
-
35
20
  state :root do
36
- mixin :header
37
- mixin :diff
21
+ rule(/^ .*\n/, Text)
22
+ rule(/^\+.*\n/, Generic::Inserted)
23
+ # Do not highlight the delimiter line
24
+ # before the diffstat in email patches.
25
+ rule(/^-+ .*\n/, Generic::Deleted)
26
+ rule(/^!.*\n/, Generic::Strong)
27
+ rule(/^@.*\n/, Generic::Subheading)
28
+ rule(/^([Ii]ndex|diff).*\n/, Generic::Heading)
29
+ rule(/^=.*\n/, Generic::Heading)
30
+ rule(/.*\n/, Text)
38
31
  end
39
32
  end
40
33
  end
@@ -9,6 +9,7 @@ module Rouge
9
9
  desc "Elixir language (elixir-lang.org)"
10
10
 
11
11
  tag 'elixir'
12
+ aliases 'elixir', 'exs'
12
13
 
13
14
  filenames '*.ex', '*.exs'
14
15
 
@@ -0,0 +1,135 @@
1
+ # -*- coding: utf-8 -*- #
2
+
3
+ module Rouge
4
+ module Lexers
5
+ load_const :C, 'c.rb'
6
+
7
+ # This file defines the GLSL language lexer to the Rouge
8
+ # syntax highlighter.
9
+ #
10
+ # Author: Sri Harsha Chilakapati
11
+ class Glsl < C
12
+ tag 'glsl'
13
+ filenames '*.glsl', '*.frag', '*.vert', '*.geom', '*.fs', '*.vs', '*.gs', '*.shader'
14
+ mimetypes 'x-shader/x-vertex', 'x-shader/x-fragment', 'x-shader/x-geometry'
15
+
16
+ title "GLSL"
17
+ desc "The GLSL shader language"
18
+
19
+ # optional comment or whitespace
20
+ ws = %r((?:\s|//.*?\n|/[*].*?[*]/)+)
21
+ id = /[a-zA-Z_][a-zA-Z0-9_]*/
22
+
23
+ def self.keywords
24
+ @keywords ||= Set.new %w(
25
+ attribute const uniform varying
26
+ layout
27
+ centroid flat smooth noperspective
28
+ patch sample
29
+ break continue do for while switch case default
30
+ if else
31
+ subroutine
32
+ in out inout
33
+ invariant
34
+ discard return struct precision
35
+ )
36
+ end
37
+
38
+ def self.keywords_type
39
+ @keywords_type ||= Set.new %w(
40
+ float double int void bool true false
41
+ lowp mediump highp
42
+ mat2 mat3 mat4 dmat2 dmat3 dmat4
43
+ mat2x2 mat2x3 mat2x4 dmat2x2 dmat2x3 dmat2x4
44
+ mat3x2 mat3x3 mat3x4 dmat3x2 dmat3x3 dmat3x4
45
+ mat4x2 mat4x3 mat4x4 dmat4x2 dmat4x3 dmat4x4
46
+ vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 dvec2 dvec3 dvec4
47
+ uint uvec2 uvec3 uvec4
48
+ sampler1D sampler2D sampler3D samplerCube
49
+ sampler1DShadow sampler2DShadow samplerCubeShadow
50
+ sampler1DArray sampler2DArray
51
+ sampler1DArrayShadow sampler2DArrayShadow
52
+ isampler1D isampler2D isampler3D isamplerCube
53
+ isampler1DArray isampler2DArray
54
+ usampler1D usampler2D usampler3D usamplerCube
55
+ usampler1DArray usampler2DArray
56
+ sampler2DRect sampler2DRectShadow isampler2DRect usampler2DRect
57
+ samplerBuffer isamplerBuffer usamplerBuffer
58
+ sampler2DMS isampler2DMS usampler2DMS
59
+ sampler2DMSArray isampler2DMSArray usampler2DMSArray
60
+ samplerCubeArray samplerCubeArrayShadow isamplerCubeArray usamplerCubeArray
61
+ )
62
+ end
63
+
64
+ def self.reserved
65
+ @reserved ||= Set.new %w(
66
+ common partition active
67
+ asm
68
+ class union enum typedef template this packed
69
+ goto
70
+ inline noinline volatile public static extern external interface
71
+ long short half fixed unsigned superp
72
+ input output
73
+ hvec2 hvec3 hvec4 fvec2 fvec3 fvec4
74
+ sampler3DRect
75
+ filter
76
+ image1D image2D image3D imageCube
77
+ iimage1D iimage2D iimage3D iimageCube
78
+ uimage1D uimage2D uimage3D uimageCube
79
+ image1DArray image2DArray
80
+ iimage1DArray iimage2DArray uimage1DArray uimage2DArray
81
+ image1DShadow image2DShadow
82
+ image1DArrayShadow image2DArrayShadow
83
+ imageBuffer iimageBuffer uimageBuffer
84
+ sizeof cast
85
+ namespace using
86
+ row_major
87
+ )
88
+ end
89
+
90
+ def self.builtins
91
+ @builtins ||= Set.new %w(
92
+ gl_VertexID gl_InstanceID gl_PerVertex gl_Position gl_PointSize gl_ClipDistance
93
+ gl_PrimitiveIDIn gl_InvocationID gl_PrimitiveID gl_Layer gl_ViewportIndex
94
+ gl_MaxPatchVertices gl_PatchVerticesIn gl_TessLevelOuter gl_TessLevelInner
95
+ gl_TessCoord gl_FragCoord gl_FrontFacing gl_PointCoord gl_SampleID gl_SamplePosition
96
+ gl_FragColor gl_FragData gl_MaxDrawBuffers gl_FragDepth gl_SampleMask
97
+ gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor
98
+ gl_TexCoord gl_FogFragCoord gl_Color gl_SecondaryColor gl_Normal gl_VertexID
99
+ gl_MultiTexCord0 gl_MultiTexCord1 gl_MultiTexCord2 gl_MultiTexCord3
100
+ gl_MultiTexCord4 gl_MultiTexCord5 gl_MultiTexCord6 gl_MultiTexCord7
101
+ gl_FogCoord gl_MaxVertexAttribs gl_MaxVertexUniformComponents
102
+ gl_MaxVaryingFloats gl_MaxVaryingComponents gl_MaxVertexOutputComponents
103
+ gl_MaxGeometryInputComponents gl_MaxGeometryOutputComponents
104
+ gl_MaxFragmentInputComponents gl_MaxVertexTextureImageUnits
105
+ gl_MaxCombinedTextureImageUnits gl_MaxTextureImageUnits
106
+ gl_MaxFragmentUniformComponents gl_MaxClipDistances
107
+ gl_MaxGeometryTextureImageUnits gl_MaxGeometryUniformComponents
108
+ gl_MaxGeometryVaryingComponents gl_MaxTessControlInputComponents
109
+ gl_MaxTessControlOutputComponents gl_MaxTessControlTextureImageUnits
110
+ gl_MaxTessControlUniformComponents gl_MaxTessControlTotalOutputComponents
111
+ gl_MaxTessEvaluationInputComponents gl_MaxTessEvaluationOutputComponents
112
+ gl_MaxTessEvaluationTextureImageUnits gl_MaxTessEvaluationUniformComponents
113
+ gl_MaxTessPatchComponents gl_MaxTessGenLevel gl_MaxViewports
114
+ gl_MaxVertexUniformVectors gl_MaxFragmentUniformVectors gl_MaxVaryingVectors
115
+ gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxClipPlanes gl_DepthRange
116
+ gl_DepthRangeParameters gl_ModelViewMatrix gl_ProjectionMatrix
117
+ gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix
118
+ gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse
119
+ gl_TextureMatrixInverse gl_ModelViewMatrixTranspose
120
+ gl_ModelViewProjectionMatrixTranspose gl_TextureMatrixTranspose
121
+ gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose
122
+ gl_ModelViewProjectionMatrixInverseTranspose
123
+ gl_TextureMatrixInverseTranspose gl_NormalScale gl_ClipPlane gl_PointParameters
124
+ gl_Point gl_MaterialParameters gl_FrontMaterial gl_BackMaterial
125
+ gl_LightSourceParameters gl_LightSource gl_MaxLights gl_LightModelParameters
126
+ gl_LightModel gl_LightModelProducts gl_FrontLightModelProduct
127
+ gl_BackLightModelProduct gl_LightProducts gl_FrontLightProduct
128
+ gl_BackLightProduct gl_TextureEnvColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR
129
+ gl_EyePlaneQ gl_ObjectPlaneS gl_ObjectPlaneT gl_ObjectPlaneR gl_ObjectPlaneQ
130
+ gl_FogParameters gl_Fog
131
+ )
132
+ end
133
+ end
134
+ end
135
+ end
@@ -84,7 +84,7 @@ module Rouge
84
84
  @keywords ||= Set.new %w(
85
85
  for in while do break return continue switch case default
86
86
  if else throw try catch finally new delete typeof instanceof
87
- void this
87
+ void this yield
88
88
  )
89
89
  end
90
90
 
@@ -206,7 +206,7 @@ module Rouge
206
206
  desc "JavaScript Object Notation (json.org)"
207
207
  tag 'json'
208
208
  filenames '*.json'
209
- mimetypes 'application/json'
209
+ mimetypes 'application/json', 'application/vnd.api+json'
210
210
 
211
211
  # TODO: is this too much of a performance hit? JSON is quite simple,
212
212
  # so I'd think this wouldn't be too bad, but for large documents this
@@ -215,14 +215,12 @@ module Rouge
215
215
  return 0.8 if text =~ /\A\s*{/m && text.lexes_cleanly?(self)
216
216
  end
217
217
 
218
+ string = /"(\\.|[^"])*"/
219
+
218
220
  state :root do
219
221
  mixin :whitespace
220
- # special case for empty objects
221
- rule /(\{)(\s*)(\})/m do
222
- groups Punctuation, Text::Whitespace, Punctuation
223
- end
224
222
  rule /(?:true|false|null)\b/, Keyword::Constant
225
- rule /{/, Punctuation, :object_key
223
+ rule /{/, Punctuation, :object_key_initial
226
224
  rule /\[/, Punctuation, :array
227
225
  rule /-?(?:0|[1-9]\d*)\.\d+(?:e[+-]\d+)?/i, Num::Float
228
226
  rule /-?(?:0|[1-9]\d*)(?:e[+-]\d+)?/i, Num::Integer
@@ -234,12 +232,23 @@ module Rouge
234
232
  end
235
233
 
236
234
  state :has_string do
237
- rule /"(\\.|[^"])*"/, Str::Double
235
+ rule string, Str::Double
236
+ end
237
+
238
+ # in object_key_initial it's allowed to immediately close the object again
239
+ state :object_key_initial do
240
+ mixin :whitespace
241
+ rule string do
242
+ token Name::Tag
243
+ goto :object_key
244
+ end
245
+ rule /}/, Punctuation, :pop!
238
246
  end
239
247
 
248
+ # in object_key at least one more name/value pair is required
240
249
  state :object_key do
241
250
  mixin :whitespace
242
- mixin :has_string
251
+ rule string, Name::Tag
243
252
  rule /:/, Punctuation, :object_val
244
253
  rule /}/, Error, :pop!
245
254
  end
@@ -256,5 +265,33 @@ module Rouge
256
265
  mixin :root
257
266
  end
258
267
  end
268
+
269
+ class JSONDOC < JSON
270
+ desc "JavaScript Object Notation with extenstions for documentation"
271
+ tag 'json-doc'
272
+
273
+ prepend :root do
274
+ mixin :comments
275
+ rule /(\.\.\.)/, Comment::Single
276
+ end
277
+
278
+ prepend :object_key_initial do
279
+ mixin :comments
280
+ rule /(\.\.\.)/, Comment::Single
281
+ end
282
+
283
+ prepend :object_key do
284
+ mixin :comments
285
+ rule /(\.\.\.)/ do
286
+ token Comment::Single
287
+ goto :object_key_initial
288
+ end
289
+ end
290
+
291
+ state :comments do
292
+ rule %r(//.*?$), Comment::Single
293
+ end
294
+ end
295
+
259
296
  end
260
297
  end
@@ -131,9 +131,7 @@ module Rouge
131
131
  groups nil, Operator, Operator::Word
132
132
  end
133
133
 
134
- rule /([\w\.\'"]+)(\s+)(contains)(\s+)([\w\.\'"]+)/ do
135
- groups nil, Text::Whitespace, Operator::Word, Text::Whitespace
136
- end
134
+ rule /(contains)/, Operator::Word
137
135
 
138
136
  mixin :generic
139
137
  mixin :whitespace
@@ -168,6 +166,7 @@ module Rouge
168
166
  # states for unknown markup
169
167
  state :param_markup do
170
168
  mixin :whitespace
169
+ mixin :string
171
170
 
172
171
  rule /([^\s=:]+)(\s*)(=|:)/ do
173
172
  groups Name::Attribute, Text::Whitespace, Operator
@@ -177,7 +176,6 @@ module Rouge
177
176
  groups Punctuation, Text::Whitespace, nil, Text::Whitespace, Punctuation
178
177
  end
179
178
 
180
- mixin :string
181
179
  mixin :number
182
180
  mixin :keyword
183
181
 
@@ -196,12 +194,12 @@ module Rouge
196
194
  end
197
195
 
198
196
  state :tag_markup do
199
- rule (/%\}/) { token Punctuation; reset_stack }
197
+ mixin :end_of_block
200
198
  mixin :default_param_markup
201
199
  end
202
200
 
203
201
  state :variable_tag_markup do
204
- rule (/%\}/) { token Punctuation; reset_stack }
202
+ mixin :end_of_block
205
203
  mixin :variable_param_markup
206
204
  end
207
205
 
@@ -225,7 +223,13 @@ module Rouge
225
223
  rule /\d+/, Num::Integer
226
224
  end
227
225
 
226
+ state :array_index do
227
+ rule /\[/, Punctuation
228
+ rule /\]/, Punctuation
229
+ end
230
+
228
231
  state :generic do
232
+ mixin :array_index
229
233
  mixin :keyword
230
234
  mixin :string
231
235
  mixin :variable
@@ -258,6 +262,7 @@ module Rouge
258
262
 
259
263
  state :assign do
260
264
  mixin :whitespace
265
+ mixin :end_of_block
261
266
 
262
267
  rule /(\s*)(=)(\s*)/ do
263
268
  groups Text::Whitespace, Operator, Text::Whitespace
@@ -79,6 +79,7 @@ module Rouge
79
79
 
80
80
  rule /[?]/, Punctuation, :ternary
81
81
  rule /\[/, Punctuation, :message
82
+ rule /@\[/, Punctuation, :array_literal
82
83
  end
83
84
 
84
85
  state :ternary do
@@ -115,6 +116,12 @@ module Rouge
115
116
  mixin :message_shared
116
117
  end
117
118
 
119
+ state :array_literal do
120
+ rule /]/, Punctuation, :pop!
121
+ rule /,/, Punctuation
122
+ mixin :statements
123
+ end
124
+
118
125
  state :classname do
119
126
  mixin :whitespace
120
127
 
@@ -56,7 +56,7 @@ module Rouge
56
56
  while endforeach global __FILE__ endif list __LINE__ endswitch
57
57
  new __sleep endwhile not array __wakeup E_ALL NULL final
58
58
  php_user_filter interface implements public private protected
59
- abstract clone try catch throw this use namespace
59
+ abstract clone try catch throw this use namespace yield
60
60
  )
61
61
  end
62
62
 
@@ -9,7 +9,7 @@ module Rouge
9
9
  aliases 'rb'
10
10
  filenames '*.rb', '*.ruby', '*.rbw', '*.rake', '*.gemspec', '*.podspec',
11
11
  'Rakefile', 'Guardfile', 'Gemfile', 'Capfile', 'Podfile',
12
- 'Vagrantfile', '*.ru', '*.prawn'
12
+ 'Vagrantfile', '*.ru', '*.prawn', 'Berksfile'
13
13
 
14
14
  mimetypes 'text/x-ruby', 'application/x-ruby'
15
15
 
@@ -215,7 +215,7 @@ module Rouge
215
215
  rule /[A-Z][a-zA-Z0-9_]*/, Name::Constant, :method_call
216
216
  rule /(\.|::)(\s*)([a-z_]\w*[!?]?|[*%&^`~+-\/\[<>=])/ do
217
217
  groups Punctuation, Text, Name::Function
218
- push :expr_start
218
+ push :method_call
219
219
  end
220
220
 
221
221
  rule /[a-zA-Z_]\w*[?!]/, Name, :expr_start
@@ -8,12 +8,18 @@ module Rouge
8
8
 
9
9
  state :content_common do
10
10
  rule /@for\b/, Keyword, :for
11
- rule /@(debug|warn|if|while)/, Keyword, :value
11
+ rule /@(debug|warn|if|each|while|else|return|media)/, Keyword, :value
12
+
12
13
  rule /(@mixin)(\s+)(#{id})/ do
13
14
  groups Keyword, Text, Name::Function
14
15
  push :value
15
16
  end
16
17
 
18
+ rule /(@function)(\s+)(#{id})/ do
19
+ groups Keyword, Text, Name::Function
20
+ push :value
21
+ end
22
+
17
23
  rule /@extend\b/, Keyword, :selector
18
24
 
19
25
  rule /(@include)(\s+)(#{id})/ do
@@ -20,11 +20,6 @@ module Rouge
20
20
  # Since you are allowed to wrap lines with a backslash, include \\\n in characters
21
21
  dot = /(\\\n|.)/
22
22
 
23
- def self.analyze_text(text)
24
- return 1 if text.start_with? 'doctype'
25
- return 1 if text =~ /(\*)(\{.+?\})/ # Contans a hash splat
26
- end
27
-
28
23
  def ruby
29
24
  @ruby ||= Ruby.new(options)
30
25
  end
@@ -46,6 +41,8 @@ module Rouge
46
41
  }
47
42
  end
48
43
 
44
+ start { ruby.reset!; html.reset! }
45
+
49
46
  state :root do
50
47
  rule /\s*\n/, Text
51
48
  rule(/\s*/) { |m| token Text; indentation(m[0]) }
@@ -146,6 +143,9 @@ module Rouge
146
143
  delegate ruby, m[2]
147
144
  end
148
145
 
146
+ # HTML Entities
147
+ rule(/&\S*?;/, Name::Entity)
148
+
149
149
  rule /#{dot}+?/, Text
150
150
 
151
151
  rule /\s*\n/, Text::Whitespace, :pop!
@@ -158,7 +158,7 @@ module Rouge
158
158
 
159
159
  state :html_attr do
160
160
  # Strings, double/single quoted
161
- rule %r(\s*(['"])#{dot}*\1), Literal::String, :pop!
161
+ rule(/\s*(['"])#{dot}*?\1/, Literal::String, :pop!)
162
162
 
163
163
  # Ruby stuff
164
164
  rule(/(#{ruby_chars}+\(.*?\))/) { |m| delegate ruby, m[1]; pop! }
@@ -196,6 +196,9 @@ module Rouge
196
196
  delegate html, m[1]
197
197
  end
198
198
 
199
+ # HTML Entities
200
+ rule(/&\S*?;/, Name::Entity)
201
+
199
202
  #rule /([^#\n]|#[^{\n]|(\\\\)*\\#\{)+/ do
200
203
  rule /#{dot}+?/, Text
201
204
 
@@ -26,7 +26,7 @@ module Rouge
26
26
  )
27
27
 
28
28
  attributes = Set.new %w(
29
- autoclosure IBAction IBDesignable IBInspectable IBOutlet noreturn NSCopying NSManaged objc UIApplicationMain NSApplicationMain objc_block
29
+ autoclosure IBAction IBDesignable IBInspectable IBOutlet noreturn NSCopying NSManaged objc UIApplicationMain NSApplicationMain objc_block noescape
30
30
  )
31
31
 
32
32
  constants = Set.new %w(
@@ -75,6 +75,8 @@ module Rouge
75
75
  rule /(@objc[(])([^)]+)([)])/ do
76
76
  groups Keyword::Declaration, Name::Class, Keyword::Declaration
77
77
  end
78
+
79
+ rule /@autoclosure\(escaping\)/, Keyword::Declaration
78
80
 
79
81
  rule /@(#{id})/ do |m|
80
82
  if attributes.include? m[1]
@@ -111,6 +113,8 @@ module Rouge
111
113
  token Name::Function
112
114
  end
113
115
  end
116
+
117
+ rule /as[?!]?/, Keyword
114
118
 
115
119
  rule /(#?(?!default)(?![[:upper:]])#{id})(\s*)(:)/ do
116
120
  groups Name::Variable, Text, Punctuation
@@ -74,7 +74,7 @@ module Rouge
74
74
  # XXX IMPORTANT XXX
75
75
  # For compatibility, this list must be kept in sync with
76
76
  # pygments.token.STANDARD_TYPES
77
- # please see https://github.com/jayferd/rouge/wiki/List-of-tokens
77
+ # please see https://github.com/jneen/rouge/wiki/List-of-tokens
78
78
  token :Text, '' do
79
79
  token :Whitespace, 'w'
80
80
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rouge
4
4
  def self.version
5
- "1.8.0"
5
+ "1.9.0"
6
6
  end
7
7
  end
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
10
10
  Rouge aims to a be a simple, easy-to-extend drop-in replacement
11
11
  for pygments.
12
12
  desc
13
- s.homepage = "http://github.com/jneen/rouge"
13
+ s.homepage = "http://rouge.jneen.net/"
14
14
  s.rubyforge_project = "rouge"
15
15
  s.files = Dir['Gemfile', 'LICENSE', 'rouge.gemspec', 'lib/**/*.rb', 'lib/**/*.yml', 'bin/rougify', 'lib/rouge/demos/*']
16
16
  s.executables = %w(rougify)
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: 1.8.0
4
+ version: 1.9.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: 2015-02-02 00:00:00.000000000 Z
11
+ date: 2015-05-19 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:
@@ -40,6 +40,7 @@ files:
40
40
  - lib/rouge/demos/erlang
41
41
  - lib/rouge/demos/factor
42
42
  - lib/rouge/demos/gherkin
43
+ - lib/rouge/demos/glsl
43
44
  - lib/rouge/demos/go
44
45
  - lib/rouge/demos/groovy
45
46
  - lib/rouge/demos/haml
@@ -52,6 +53,7 @@ files:
52
53
  - lib/rouge/demos/java
53
54
  - lib/rouge/demos/javascript
54
55
  - lib/rouge/demos/json
56
+ - lib/rouge/demos/json-doc
55
57
  - lib/rouge/demos/liquid
56
58
  - lib/rouge/demos/literate_coffeescript
57
59
  - lib/rouge/demos/literate_haskell
@@ -119,6 +121,7 @@ files:
119
121
  - lib/rouge/lexers/factor.rb
120
122
  - lib/rouge/lexers/gherkin.rb
121
123
  - lib/rouge/lexers/gherkin/keywords.rb
124
+ - lib/rouge/lexers/glsl.rb
122
125
  - lib/rouge/lexers/go.rb
123
126
  - lib/rouge/lexers/groovy.rb
124
127
  - lib/rouge/lexers/haml.rb
@@ -194,7 +197,7 @@ files:
194
197
  - lib/rouge/util.rb
195
198
  - lib/rouge/version.rb
196
199
  - rouge.gemspec
197
- homepage: http://github.com/jneen/rouge
200
+ homepage: http://rouge.jneen.net/
198
201
  licenses:
199
202
  - MIT (see LICENSE file)
200
203
  metadata: {}