rouge 4.5.1 → 4.5.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c49b8e02cddb54e0f39aecaad73d5b52d4fb5ff4161b32a80344f5df1a61afa
4
- data.tar.gz: e9c17a30cd177dab2413546b32c83fbe4b436a0c055d8aa7dbaa48e7b877f579
3
+ metadata.gz: e05ab679798a94f2f0eb8c949c3cd9bedcebb041d41cdaad5531d58782747ba4
4
+ data.tar.gz: 8885464dab437455ef92b154b22fc142783620a1e8f5c5259e398cbbd5a575a4
5
5
  SHA512:
6
- metadata.gz: e0ff902fc5912f3dc69b9526cc5eea412ac417d88ea73fcd65f864280195e8fc8b0d74f5810d661ff3233e8efeecc96ff9fb02235407d78c43d268b1f3907e03
7
- data.tar.gz: 1a74aa3d80aff64dc748125728b7016fb03886c6be323d76f24ecd1658b04154df5e49d04eeb7d6feafab0ccd416690e402cf1d931e2f621cfa8637d3b9f9c5f
6
+ metadata.gz: '0781c8f63f7e851cb6248ffbd713630e00206730ec3b590e41cbd5fc019597113ea5b2bb1108fff504c1055f9245716bbf9bcf69c89cd5259665e31ac96b6b4c'
7
+ data.tar.gz: 67e402cb9f3ff585824b8a888d5cf7be538f32ded5613af14f2381661c74b2c426d215d5e9f886577eca61233d7f7ac884c11e12fe9b191e18e3ea9063d03945
data/LICENSE CHANGED
@@ -21,8 +21,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
21
  THE SOFTWARE.
22
22
 
23
23
  # SPECIAL NOTE:
24
+
24
25
  Many of the lexers in this project are adaptations of those in Pygments
25
- (pygments.org). The license for Pygments is as follows:
26
+ (pygments.org). The license for Pygments is as follows:
26
27
 
27
28
  # BEGIN pygments/LICENSE #
28
29
 
@@ -62,9 +62,10 @@ module Rouge
62
62
  rule %r/(class|struct)\b/, Keyword, :classname
63
63
  rule %r/template\b/, Keyword, :template
64
64
  rule %r/#{dq}(\.#{dq})?(?:y|d|h|(?:min)|s|(?:ms)|(?:us)|(?:ns)|i|(?:if)|(?:il))\b/, Num::Other
65
- rule %r((#{dq}[.]#{dq}?|[.]#{dq})(e[+-]?#{dq}[lu]*)?)i, Num::Float
66
- rule %r(#{dq}e[+-]?#{dq}[lu]*)i, Num::Float
67
- rule %r/0x\h('?\h)*[lu]*/i, Num::Hex
65
+ rule %r((#{dq}[.]#{dq}?|[.]#{dq})([ep][+-]?#{dq})?[luf]*)i, Num::Float
66
+ rule %r(#{dq}[ep][+-]?#{dq}[luf]*)i, Num::Float
67
+ rule %r/0x\h('?\h)*([ep][+-]?#{dq})?[lu]*/i, Num::Hex
68
+ rule %r/0x\h('?\h)*[.]\h+([ep][+-]?#{dq})[luf]*/i, Num::Hex
68
69
  rule %r/0b[01]+('[01]+)*/, Num::Bin
69
70
  rule %r/0[0-7]('?[0-7])*[lu]*/i, Num::Oct
70
71
  rule %r/#{dq}[lu]*/i, Num::Integer
@@ -16,164 +16,200 @@ module Rouge
16
16
  identifier = /[\p{L}_-][\p{Word}\p{Cf}-]*/
17
17
  number = /-?(?:[0-9]+(\.[0-9]+)?|\.[0-9]+)/
18
18
 
19
- def self.attributes
20
- @attributes ||= Set.new %w(
21
- align-content align-items align-self alignment-adjust
22
- alignment-baseline all anchor-point animation
23
- animation-delay animation-direction animation-duration
24
- animation-fill-mode animation-iteration-count animation-name
25
- animation-play-state animation-timing-function appearance
26
- azimuth backface-visibility background background-attachment
19
+ def self.properties
20
+ @properties ||= Set.new %w(
21
+ additive-symbols align-content align-items align-self
22
+ alignment-adjust alignment-baseline all anchor-point animation
23
+ animation-composition animation-delay animation-direction
24
+ animation-duration animation-fill-mode animation-iteration-count
25
+ animation-name animation-play-state animation-timing-function
26
+ appearance aspect-ratio azimuth backface-visibility background
27
+ background-attachment background-blend-mode
27
28
  background-clip background-color background-image
28
- background-origin background-position background-repeat
29
- background-size baseline-shift binding bleed bookmark-label
30
- bookmark-level bookmark-state bookmark-target border
31
- border-bottom border-bottom-color border-bottom-left-radius
32
- border-bottom-right-radius border-bottom-style
33
- border-bottom-width border-collapse border-color
34
- border-image border-image-outset border-image-repeat
29
+ background-origin background-position
30
+ background-repeat background-size baseline-shift
31
+ binding bleed bookmark-label bookmark-level bookmark-state
32
+ bookmark-target border border-bottom border-bottom-color
33
+ border-bottom-left-radius border-bottom-right-radius
34
+ border-bottom-style border-bottom-width border-collapse
35
+ border-color border-image border-image-outset border-image-repeat
35
36
  border-image-slice border-image-source border-image-width
36
- border-left border-left-color border-left-style
37
- border-left-width border-radius border-right
38
- border-right-color border-right-style border-right-width
39
- border-spacing border-style border-top border-top-color
40
- border-top-left-radius border-top-right-radius
41
- border-top-style border-top-width border-width bottom
42
- box-align box-decoration-break box-direction box-flex
43
- box-flex-group box-lines box-ordinal-group box-orient
44
- box-pack box-shadow box-sizing break-after break-before
45
- break-inside caption-side clear clip clip-path
46
- clip-rule color color-profile columns column-count
37
+ border-left border-left-color border-left-style border-left-width
38
+ border-radius border-right border-right-color border-right-style
39
+ border-right-width border-spacing border-style border-top
40
+ border-top-color border-top-left-radius border-top-right-radius
41
+ border-top-style border-top-width border-width bottom box-align
42
+ box-decoration-break box-direction box-flex box-flex-group
43
+ box-lines box-ordinal-group box-orient box-pack box-shadow
44
+ box-sizing break-after break-before break-inside caption-side
45
+ clear clip clip-path clip-rule color color-profile column-count
47
46
  column-fill column-gap column-rule column-rule-color
48
- column-rule-style column-rule-width column-span
49
- column-width content counter-increment counter-reset
50
- crop cue cue-after cue-before cursor direction display
51
- dominant-baseline drop-initial-after-adjust
52
- drop-initial-after-align drop-initial-before-adjust
53
- drop-initial-before-align drop-initial-size
54
- drop-initial-value elevation empty-cells filter fit
55
- fit-position flex flex-basis flex-direction flex-flow
56
- flex-grow flex-shrink flex-wrap float float-offset
57
- font font-family font-feature-settings
58
- font-kerning font-language-override font-size
59
- font-size-adjust font-stretch font-style font-synthesis
60
- font-variant font-variant-alternates font-variant-caps
61
- font-variant-east-asian font-variant-ligatures
62
- font-variant-numeric font-variant-position font-weight
63
- grid-cell grid-column grid-column-align grid-column-sizing
64
- grid-column-span grid-columns grid-flow grid-row
65
- grid-row-align grid-row-sizing grid-row-span
66
- grid-rows grid-template hanging-punctuation height
67
- hyphenate-after hyphenate-before hyphenate-character
68
- hyphenate-lines hyphenate-resource hyphens icon
69
- image-orientation image-rendering image-resolution
70
- ime-mode inline-box-align justify-content
71
- left letter-spacing line-break line-height
47
+ column-rule-style column-rule-width column-span column-width
48
+ columns content container container-name container-type
49
+ counter-increment counter-reset counter-set crop cue
50
+ cue-after cue-before cursor direction display dominant-baseline
51
+ drop-initial-after-adjust drop-initial-after-align
52
+ drop-initial-before-adjust drop-initial-before-align
53
+ drop-initial-size drop-initial-value elevation empty-cells fallback
54
+ filter fit fit-position flex flex-basis flex-direction flex-flow
55
+ flex-grow flex-shrink flex-wrap float float-offset font
56
+ font-display font-family font-feature-settings font-kerning
57
+ font-language-override font-size font-size-adjust font-stretch
58
+ font-style font-synthesis font-variant font-variant-alternates
59
+ font-variant-caps font-variant-east-asian font-variant-ligatures
60
+ font-variant-numeric font-variant-position font-weight gap
61
+ grid-area grid-auto-columns grid-auto-flow grid-auto-rows
62
+ grid-column grid-column-end grid-column-start grid-row
63
+ grid-row-end grid-row-start grid-template grid-template-areas
64
+ grid-template-columns grid-template-rows hanging-punctuation
65
+ height hyphenate-after hyphenate-before hyphenate-character
66
+ hyphenate-lines hyphenate-resource hyphens icon image-orientation
67
+ image-rendering image-resolution ime-mode inherits initial-value
68
+ inline-box-align inset isolation justify-content justify-items
69
+ justify-self left letter-spacing line-break line-height
72
70
  line-stacking line-stacking-ruby line-stacking-shift
73
71
  line-stacking-strategy list-style list-style-image
74
- list-style-position list-style-type margin
75
- margin-bottom margin-left margin-right margin-top
76
- mark marker-offset marks mark-after mark-before
77
- marquee-direction marquee-loop marquee-play-count
78
- marquee-speed marquee-style mask max-height max-width
79
- min-height min-width move-to nav-down
80
- nav-index nav-left nav-right nav-up object-fit
81
- object-position opacity order orphans outline
82
- outline-color outline-offset outline-style
83
- outline-width overflow overflow-style overflow-wrap
84
- overflow-x overflow-y padding padding-bottom
85
- padding-left padding-right padding-top
86
- page page-break-after page-break-before
87
- page-break-inside page-policy pause pause-after
88
- pause-before perspective perspective-origin
89
- phonemes pitch pitch-range play-during pointer-events
90
- position presentation-level punctuation-trim quotes
91
- rendering-intent resize rest rest-after rest-before
92
- richness right rotation rotation-point ruby-align
93
- ruby-overhang ruby-position ruby-span size speak
94
- speak-as speak-header speak-numeral speak-punctuation
95
- speech-rate src stress string-set
96
- tab-size table-layout target target-name
97
- target-new target-position text-align
98
- text-align-last text-combine-horizontal
99
- text-decoration text-decoration-color
100
- text-decoration-line text-decoration-skip
101
- text-decoration-style text-emphasis
102
- text-emphasis-color text-emphasis-position
103
- text-emphasis-style text-height text-indent
104
- text-justify text-orientation text-outline
105
- text-overflow text-rendering text-shadow
106
- text-space-collapse text-transform
107
- text-underline-position text-wrap top
108
- transform transform-origin transform-style
72
+ list-style-position list-style-type margin margin-bottom
73
+ margin-left margin-right margin-top mark mark-after mark-before
74
+ marker-offset marks marquee-direction marquee-loop
75
+ marquee-play-count marquee-speed marquee-style
76
+ mask mask-clip mask-composite mask-image mask-mode
77
+ mask-origin mask-position mask-repeat mask-size mask-type
78
+ max-height max-width min-height min-width mix-blend-mode
79
+ move-to nav-down nav-index nav-left nav-right nav-up negative
80
+ object-fit object-position offset offset-anchor offset-distance
81
+ offset-path offset-position offset-rotate opacity order orphans
82
+ outline outline-color outline-offset outline-style outline-width
83
+ overflow overflow-style overflow-wrap overflow-x overflow-y pad
84
+ padding padding-bottom padding-left padding-right padding-top page
85
+ page-break-after page-break-before page-break-inside page-policy
86
+ pause pause-after pause-before perspective perspective-origin
87
+ phonemes pitch pitch-range place-content place-items place-self
88
+ play-during pointer-events position prefix presentation-level
89
+ punctuation-trim quotes range rendering-intent resize rest
90
+ rest-after rest-before richness right rotate rotation rotation-point
91
+ row-gap ruby-align ruby-overhang ruby-position ruby-span scale
92
+ scroll-behavior scroll-margin scroll-margin-block
93
+ scroll-margin-block-end scroll-margin-block-start
94
+ scroll-margin-bottom scroll-margin-inline scroll-margin-inline-end
95
+ scroll-margin-inline-start scroll-margin-left scroll-margin-right
96
+ scroll-margin-top scroll-padding-top scroll-padding-right
97
+ scroll-padding-bottom scroll-padding-left scroll-padding
98
+ scroll-padding-block-end scroll-padding-block-start
99
+ scroll-padding-block scroll-padding-inline-end
100
+ scroll-padding-inline-start scroll-padding-inline
101
+ scroll-snap-type scroll-snap-align scroll-snap-stop
102
+ shape-outside shape-margin shape-image-threshold shape-rendering
103
+ size speak speak-as speak-header speak-numeral speak-punctuation
104
+ speech-rate src stress string-set suffix symbols syntax system
105
+ tab-size table-layout target target-name target-new target-position
106
+ text-align text-align-last text-combine-horizontal
107
+ text-decoration text-decoration-color text-decoration-line
108
+ text-decoration-skip text-decoration-style text-emphasis
109
+ text-emphasis-color text-emphasis-position text-emphasis-style
110
+ text-height text-indent text-justify text-orientation
111
+ text-outline text-overflow text-rendering text-shadow
112
+ text-space-collapse text-transform text-underline-position
113
+ text-wrap top transform transform-origin transform-style
109
114
  transition transition-delay transition-duration
110
- transition-property transition-timing-function
111
- unicode-bidi vertical-align
112
- visibility voice-balance voice-duration
113
- voice-family voice-pitch voice-pitch-range
114
- voice-range voice-rate voice-stress voice-volume
115
- volume white-space widows width word-break
116
- word-spacing word-wrap writing-mode z-index
115
+ transition-property transition-timing-function translate
116
+ unicode-bidi vertical-align visibility voice-balance
117
+ voice-duration voice-family voice-pitch voice-pitch-range
118
+ voice-range voice-rate voice-stress voice-volume volume
119
+ white-space widows width word-break word-spacing word-wrap
120
+ writing-mode z-index
117
121
  )
118
122
  end
119
123
 
120
124
  def self.builtins
121
125
  @builtins ||= Set.new %w(
122
- above absolute always armenian aural auto avoid left bottom
123
- baseline behind below bidi-override blink block bold bolder
124
- both bottom capitalize center center-left center-right circle
125
- cjk-ideographic close-quote collapse condensed continuous crop
126
- cross crosshair cursive dashed decimal decimal-leading-zero
127
- default digits disc dotted double e-resize embed expanded
128
- extra-condensed extra-expanded fantasy far-left far-right fast
129
- faster fixed georgian groove hebrew help hidden hide high higher
130
- hiragana hiragana-iroha icon inherit inline inline-table inset
131
- inside invert italic justify katakana katakana-iroha landscape
132
- large larger left left-side leftwards level lighter line-through
126
+ above absolute accumulate add additive all alpha alphabetic
127
+ alternate alternate-reverse always armenian aural auto auto-fill
128
+ auto-fit avoid backwards balance baseline behind below bidi-override
129
+ blink block bold bolder border-box both bottom bottom break-spaces
130
+ capitalize center center-left center-right circle cjk-ideographic
131
+ close-quote closest-corner closest-side collapse
132
+ color color-burn color-dodge column column-reverse
133
+ condensed contain content content-box continuous cover crop cross
134
+ crosshair cursive cyclic darken dashed decimal decimal-leading-zero
135
+ default difference digits disc dotted double e-resize
136
+ ease ease-in ease-in-out ease-out embed end exclude exclusion
137
+ expanded extends extra-condensed extra-expanded fantasy
138
+ farthest-corner farthest-side far-left far-right
139
+ fast faster fill fixed flat flex flex-end flex-start
140
+ forwards georgian grid groove hard-light hebrew help hidden
141
+ hide high higher hiragana hiragana-iroha horizontal hue icon
142
+ infinite inherit inline inline-block inline-flex inline-grid
143
+ inline-size inline-table inset inside intersect isolate italic
144
+ justify katakana katakana-iroha landscape large larger left
145
+ left-side leftwards level lighten lighter line-through linear
133
146
  list-item loud low lower lower-alpha lower-greek lower-roman
134
- lowercase ltr medium message-box middle mix monospace n-resize
135
- narrower ne-resize no-close-quote no-open-quote no-repeat none
136
- normal nowrap nw-resize oblique once open-quote outset outside
137
- overline pointer portrait px relative repeat repeat-x repeat-y
138
- rgb ridge right right-side rightwards s-resize sans-serif scroll
147
+ lowercase ltr luminance luminosity mandatory match-source medium
148
+ message-box middle mix monospace multiply n-resize narrower
149
+ ne-resize no-close-quote no-open-quote no-repeat none normal
150
+ nowrap numeric nw-resize oblique once open-quote outset outside
151
+ overlay overline paused pointer portrait pre preserve-3d pre-line
152
+ pre-wrap proximity px relative repeat-x repeat-y replace reverse
153
+ ridge right right-side rightwards row row-reverse rtl running
154
+ s-resize sans-serif saturation scale-down screen scroll
139
155
  se-resize semi-condensed semi-expanded separate serif show
140
- silent slow slower small-caps small-caption smaller soft solid
141
- spell-out square static status-bar super sw-resize table-caption
142
- table-cell table-column table-column-group table-footer-group
143
- table-header-group table-row table-row-group text text-bottom
144
- text-top thick thin top transparent ultra-condensed
145
- ultra-expanded underline upper-alpha upper-latin upper-roman
146
- uppercase url visible w-resize wait wider x-fast x-high x-large
147
- x-loud x-low x-small x-soft xx-large xx-small yes
156
+ sides silent size slow slower small-caps small-caption smaller
157
+ smooth soft soft-light solid space-aroun space-between
158
+ space-evenly span spell-out square start static status-bar sticky
159
+ stretch sub subtract super sw-resize swap symbolic table
160
+ table-caption table-cell table-column table-column-group
161
+ table-footer-group table-header-group table-row table-row-group
162
+ text text-bottom text-top thick thin top transparent
163
+ ultra-condensed ultra-expanded underline upper-alpha upper-latin
164
+ upper-roman uppercase vertical visible w-resize wait wider wrap
165
+ wrap-reverse x x-fast x-high x-large x-loud x-low x-small x-soft
166
+ xx-large xx-small yes y z
148
167
  )
149
168
  end
150
169
 
151
- def self.constants
152
- @constants ||= Set.new %w(
153
- indigo gold firebrick indianred yellow darkolivegreen
154
- darkseagreen mediumvioletred mediumorchid chartreuse
155
- mediumslateblue black springgreen crimson lightsalmon brown
156
- turquoise olivedrab cyan silver skyblue gray darkturquoise
157
- goldenrod darkgreen darkviolet darkgray lightpink teal
158
- darkmagenta lightgoldenrodyellow lavender yellowgreen thistle
159
- violet navy orchid blue ghostwhite honeydew cornflowerblue
160
- darkblue darkkhaki mediumpurple cornsilk red bisque slategray
161
- darkcyan khaki wheat deepskyblue darkred steelblue aliceblue
162
- gainsboro mediumturquoise floralwhite coral purple lightgrey
163
- lightcyan darksalmon beige azure lightsteelblue oldlace
164
- greenyellow royalblue lightseagreen mistyrose sienna lightcoral
165
- orangered navajowhite lime palegreen burlywood seashell
166
- mediumspringgreen fuchsia papayawhip blanchedalmond peru
167
- aquamarine white darkslategray ivory dodgerblue lemonchiffon
168
- chocolate orange forestgreen slateblue olive mintcream
169
- antiquewhite darkorange cadetblue moccasin limegreen saddlebrown
170
- darkslateblue lightskyblue deeppink plum aqua darkgoldenrod
171
- maroon sandybrown magenta tan rosybrown pink lightblue
172
- palevioletred mediumseagreen dimgray powderblue seagreen snow
173
- mediumblue midnightblue paleturquoise palegoldenrod whitesmoke
174
- darkorchid salmon lightslategray lawngreen lightgreen tomato
175
- hotpink lightyellow lavenderblush linen mediumaquamarine green
176
- blueviolet peachpuff
170
+ def self.colors
171
+ @colors ||= Set.new %w(
172
+ aliceblue antiquewhite aqua aquamarine azure beige bisque black
173
+ blanchedalmond blue blueviolet brown burlywood cadetblue
174
+ chartreuse chocolate coral cornflowerblue cornsilk crimson cyan
175
+ darkblue darkcyan darkgoldenrod darkgray darkgreen darkkhaki
176
+ darkmagenta darkolivegreen darkorange darkorchid darkred
177
+ darksalmon darkseagreen darkslateblue darkslategray darkturquoise
178
+ darkviolet deeppink deepskyblue dimgray dodgerblue firebrick
179
+ floralwhite forestgreen fuchsia gainsboro ghostwhite gold
180
+ goldenrod gray green greenyellow honeydew hotpink indianred
181
+ indigo ivory khaki lavender lavenderblush lawngreen lemonchiffon
182
+ lightblue lightcoral lightcyan lightgoldenrodyellow lightgreen
183
+ lightgrey lightpink lightsalmon lightseagreen lightskyblue
184
+ lightslategray lightsteelblue lightyellow lime limegreen linen
185
+ magenta maroon mediumaquamarine mediumblue mediumorchid
186
+ mediumpurple mediumseagreen mediumslateblue mediumspringgreen
187
+ mediumturquoise mediumvioletred midnightblue mintcream mistyrose
188
+ moccasin navajowhite navy oldlace olive olivedrab orange
189
+ orangered orchid palegoldenrod palegreen paleturquoise
190
+ palevioletred papayawhip peachpuff peru pink plum powderblue
191
+ purple red rosybrown royalblue saddlebrown salmon sandybrown
192
+ seagreen seashell sienna silver skyblue slateblue slategray snow
193
+ springgreen steelblue tan teal thistle tomato
194
+ turquoise violet wheat white whitesmoke yellow yellowgreen
195
+ )
196
+ end
197
+
198
+ def self.functions
199
+ @functions ||= Set.new %w(
200
+ abs acos annotation asin atan atan2 attr blur brightness calc
201
+ character-variant circle clamp color color-mix conic-gradient
202
+ contrast cos counter counters cubic-bezier drop-shadow ellipse
203
+ env exp fit-content format grayscale hsl hsla hue-rotate hwb hypot
204
+ image-set inset invert lab lch linear linear-gradient log matrix
205
+ matrix3d max min minmax mod oklab oklch opacity ornaments path
206
+ perspective polygon pow radial-gradient ray rect rem repeat
207
+ repeating-conic-gradient repeating-linear-gradient
208
+ repeating-radial-gradient rgb rgba rotate rotate3d rotatex
209
+ rotatey rotatez round saturate scale scale3d scalex scaley scalez
210
+ sepia sign sin skewx skewy sqrt steps styleset
211
+ stylistic swash tan translate translate3d translatex translatey
212
+ translatez url var xywh
177
213
  )
178
214
  end
179
215
 
@@ -196,21 +232,26 @@ module Rouge
196
232
  rule %r([~^*!%&\[\]()<>|+=@:;,./?-]), Operator
197
233
  rule %r/"(\\\\|\\"|[^"])*"/, Str::Single
198
234
  rule %r/'(\\\\|\\'|[^'])*'/, Str::Double
235
+ rule %r/[0-9]{1,3}\%/, Num
199
236
  end
200
237
 
201
238
  state :value do
202
239
  mixin :basics
203
- rule %r/url\(.*?\)/, Str::Other
204
- rule %r/#[0-9a-f]{1,6}/i, Num # colors
205
- rule %r/#{number}(?:%|(?:em|px|pt|pc|in|mm|cm|ex|rem|ch|vw|vh|vmin|vmax|dpi|dpcm|dppx|deg|grad|rad|turn|s|ms|Hz|kHz)\b)?/, Num
206
- rule %r/[\[\]():\/.,]/, Punctuation
240
+ rule %r/#[0-9a-f]{3,8}/i, Name::Other # colors
241
+ rule %r/#{number}(?:%|(?:px|pt|pc|in|cm|mm|Q|em|rem|ex|ch|vw|vh|vmin|vmax|fr|dpi|dpcm|dppx|deg|grad|rad|turn|s|ms|Hz|kHz)\b)?/, Num
242
+ rule %r/[\[\]():.,]/, Punctuation
207
243
  rule %r/"(\\\\|\\"|[^"])*"/, Str::Single
208
244
  rule %r/'(\\\\|\\'|[^'])*'/, Str::Double
245
+ rule %r/(true|false)/i, Name::Constant
246
+ rule %r/\-\-#{identifier}/, Literal
247
+ rule %r([*+/-]), Operator
209
248
  rule(identifier) do |m|
210
- if self.class.constants.include? m[0]
211
- token Name::Constant
212
- elsif self.class.builtins.include? m[0]
249
+ if self.class.colors.include? m[0].downcase
250
+ token Name::Other
251
+ elsif self.class.builtins.include? m[0].downcase
213
252
  token Name::Builtin
253
+ elsif self.class.functions.include? m[0].downcase
254
+ token Name::Function
214
255
  else
215
256
  token Name
216
257
  end
@@ -250,7 +291,7 @@ module Rouge
250
291
  mixin :basics
251
292
  rule %r/}/, Punctuation, :pop!
252
293
  rule %r/(#{identifier})(\s*)(:)/m do |m|
253
- name_tok = if self.class.attributes.include? m[1]
294
+ name_tok = if self.class.properties.include? m[1]
254
295
  Name::Label
255
296
  elsif self.class.vendor_prefixes.any? { |p| m[1].start_with?(p) }
256
297
  Name::Label
@@ -7,7 +7,7 @@ module Rouge
7
7
  title "HTML"
8
8
  desc "HTML, the markup language of the web"
9
9
  tag 'html'
10
- filenames '*.htm', '*.html', '*.xhtml', '*.cshtml'
10
+ filenames '*.htm', '*.html', '*.xhtml', '*.cshtml', '*.razor'
11
11
  mimetypes 'text/html', 'application/xhtml+xml'
12
12
 
13
13
  def self.detect?(text)
@@ -51,7 +51,7 @@ module Rouge
51
51
  rule %r/(?:#{declarations.join('|')})\b/, Keyword::Declaration
52
52
  rule %r/(?:#{types.join('|')})\b/, Keyword::Type
53
53
  rule %r/(?:true|false|null)\b/, Keyword::Constant
54
- rule %r/(?:class|interface)\b/, Keyword::Declaration, :class
54
+ rule %r/(?:class|interface|record)\b/, Keyword::Declaration, :class
55
55
  rule %r/(?:import|package)\b/, Keyword::Namespace, :import
56
56
  rule %r/"""\s*\n.*?(?<!\\)"""/m, Str::Heredoc
57
57
  rule %r/"(\\\\|\\"|[^"])*"/, Str
@@ -19,7 +19,7 @@ module Rouge
19
19
 
20
20
  def self.keywords
21
21
  @keywords ||= super + %w(
22
- fn self alias inout borrowed owned ref var
22
+ fn self alias out read mut owned ref var
23
23
  struct trait raises with in match case
24
24
  )
25
25
  end
@@ -155,7 +155,7 @@ module Rouge
155
155
  state :attr_common do
156
156
  mixin :has_interp
157
157
  rule id do |m|
158
- if CSS.attributes.include? m[0]
158
+ if CSS.properties.include? m[0]
159
159
  token Name::Label
160
160
  else
161
161
  token Name::Attribute
@@ -62,7 +62,7 @@ module Rouge
62
62
  rule %r/}/, Str::Interpol, :pop!
63
63
 
64
64
  # Allow JS lexer to handle matched curly braces within template
65
- rule(/(?<=^|[^\\])\{.*?(?<=^|[^\\])\}/) do
65
+ rule(/(?<=^|[^\\])\{+.*?(?<=^|[^\\])\}+/) do
66
66
  delegate @js
67
67
  end
68
68
 
data/lib/rouge/version.rb CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  module Rouge
5
5
  def self.version
6
- "4.5.1"
6
+ "4.5.2"
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.5.1
4
+ version: 4.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeanine Adkisson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-11 00:00:00.000000000 Z
11
+ date: 2025-04-28 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:
@@ -557,7 +557,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
557
557
  - !ruby/object:Gem::Version
558
558
  version: '0'
559
559
  requirements: []
560
- rubygems_version: 3.5.19
560
+ rubygems_version: 3.5.3
561
561
  signing_key:
562
562
  specification_version: 4
563
563
  summary: A pure-ruby colorizer based on pygments