repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1 value | license stringclasses 7 values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2 classes |
|---|---|---|---|---|---|---|---|---|
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/tsx.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/tsx.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
load_lexer 'jsx.rb'
load_lexer 'typescript/common.rb'
class TSX < JSX
include TypescriptCommon
title 'TypeScript'
desc 'tsx'
tag 'tsx'
filenames '*.tsx'
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/go.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/go.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Go < RegexLexer
title "Go"
desc 'The Go programming language (http://golang.org)'
tag 'go'
aliases 'go', 'golang'
filenames '*.go'
mimetypes 'text/x-go', 'application/x-go'
# Characters
WHITE_SPACE = /[\s\t\r\n]+/
NEWLINE = /\n/
UNICODE_CHAR = /[^\n]/
UNICODE_LETTER = /[[:alpha:]]/
UNICODE_DIGIT = /[[:digit:]]/
# Letters and digits
LETTER = /#{UNICODE_LETTER}|_/
DECIMAL_DIGIT = /[0-9]/
OCTAL_DIGIT = /[0-7]/
HEX_DIGIT = /[0-9A-Fa-f]/
# Comments
LINE_COMMENT = /\/\/(?:(?!#{NEWLINE}).)*/
GENERAL_COMMENT = /\/\*(?:(?!\*\/).)*\*\//m
COMMENT = /#{LINE_COMMENT}|#{GENERAL_COMMENT}/
# Keywords
KEYWORD = /\b(?:
break | default | func
| interface | select | case
| defer | go | map
| struct | chan | else
| goto | package | switch
| const | fallthrough | if
| range | type | continue
| for | import | return
| var
)\b/x
# Identifiers
IDENTIFIER = / (?!#{KEYWORD})
#{LETTER}(?:#{LETTER}|#{UNICODE_DIGIT})* /x
# Operators and delimiters
OPERATOR = / \+= | \+\+ | \+ | &\^= | &\^
| &= | && | & | == | =
| \!= | \! | -= | -- | -
| \|= | \|\| | \| | <= | <-
| <<= | << | < | \*= | \*
| \^= | \^ | >>= | >> | >=
| > | \/ | \/= | := | %
| %= | \.\.\. | \. | :
/x
SEPARATOR = / \( | \) | \[ | \] | \{
| \} | , | ;
/x
# Integer literals
DECIMAL_LIT = /[0-9]#{DECIMAL_DIGIT}*/
OCTAL_LIT = /0#{OCTAL_DIGIT}*/
HEX_LIT = /0[xX]#{HEX_DIGIT}+/
INT_LIT = /#{HEX_LIT}|#{DECIMAL_LIT}|#{OCTAL_LIT}/
# Floating-point literals
DECIMALS = /#{DECIMAL_DIGIT}+/
EXPONENT = /[eE][+\-]?#{DECIMALS}/
FLOAT_LIT = / #{DECIMALS} \. #{DECIMALS}? #{EXPONENT}?
| #{DECIMALS} #{EXPONENT}
| \. #{DECIMALS} #{EXPONENT}?
/x
# Imaginary literals
IMAGINARY_LIT = /(?:#{DECIMALS}|#{FLOAT_LIT})i/
# Rune literals
ESCAPED_CHAR = /\\[abfnrtv\\'"]/
LITTLE_U_VALUE = /\\u#{HEX_DIGIT}{4}/
BIG_U_VALUE = /\\U#{HEX_DIGIT}{8}/
UNICODE_VALUE = / #{UNICODE_CHAR} | #{LITTLE_U_VALUE}
| #{BIG_U_VALUE} | #{ESCAPED_CHAR}
/x
OCTAL_BYTE_VALUE = /\\#{OCTAL_DIGIT}{3}/
HEX_BYTE_VALUE = /\\x#{HEX_DIGIT}{2}/
BYTE_VALUE = /#{OCTAL_BYTE_VALUE}|#{HEX_BYTE_VALUE}/
CHAR_LIT = /'(?:#{UNICODE_VALUE}|#{BYTE_VALUE})'/
ESCAPE_SEQUENCE = / #{ESCAPED_CHAR}
| #{LITTLE_U_VALUE}
| #{BIG_U_VALUE}
| #{HEX_BYTE_VALUE}
/x
# String literals
RAW_STRING_LIT = /`(?:#{UNICODE_CHAR}|#{NEWLINE})*`/
INTERPRETED_STRING_LIT = / "(?: (?!")
(?: #{UNICODE_VALUE} | #{BYTE_VALUE} )
)*" /x
STRING_LIT = /#{RAW_STRING_LIT}|#{INTERPRETED_STRING_LIT}/
# Predeclared identifiers
PREDECLARED_TYPES = /\b(?:
bool | byte | complex64
| complex128 | error | float32
| float64 | int8 | int16
| int32 | int64 | int
| rune | string | uint8
| uint16 | uint32 | uint64
| uintptr | uint
)\b/x
PREDECLARED_CONSTANTS = /\b(?:true|false|iota|nil)\b/
PREDECLARED_FUNCTIONS = /\b(?:
append | cap | close | complex
| copy | delete | imag | len
| make | new | panic | print
| println | real | recover
)\b/x
state :simple_tokens do
rule(COMMENT, Comment)
rule(KEYWORD, Keyword)
rule(PREDECLARED_TYPES, Keyword::Type)
rule(PREDECLARED_FUNCTIONS, Name::Builtin)
rule(PREDECLARED_CONSTANTS, Name::Constant)
rule(IMAGINARY_LIT, Num)
rule(FLOAT_LIT, Num)
rule(INT_LIT, Num)
rule(CHAR_LIT, Str::Char)
rule(OPERATOR, Operator)
rule(SEPARATOR, Punctuation)
rule(IDENTIFIER, Name)
rule(WHITE_SPACE, Other)
end
state :root do
mixin :simple_tokens
rule(/`/, Str, :raw_string)
rule(/"/, Str, :interpreted_string)
end
state :interpreted_string do
rule(ESCAPE_SEQUENCE, Str::Escape)
rule(/\\./, Error)
rule(/"/, Str, :pop!)
rule(/[^"\\]+/, Str)
end
state :raw_string do
rule(/`/, Str, :pop!)
rule(/[^`]+/m, Str)
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/eiffel.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/eiffel.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Eiffel < RegexLexer
title "Eiffel"
desc "Eiffel programming language"
tag 'eiffel'
filenames '*.e'
mimetypes 'text/x-eiffel'
LanguageKeywords = %w(
across agent alias all and attached as assign attribute check
class convert create debug deferred detachable do else elseif end
ensure expanded export external feature from frozen if implies inherit
inspect invariant like local loop not note obsolete old once or
Precursor redefine rename require rescue retry select separate
some then undefine until variant Void when xor
)
BooleanConstants = %w(True False)
LanguageVariables = %w(Current Result)
SimpleString = /(?:[^"%\b\f\v]|%[A-DFHLNQR-V%'"()<>]|%\/(?:0[xX][\da-fA-F](?:_*[\da-fA-F])*|0[cC][0-7](?:_*[0-7])*|0[bB][01](?:_*[01])*|\d(?:_*\d)*)\/)+?/
state :root do
rule /"\[/, Str::Other, :aligned_verbatim_string
rule /"\{/, Str::Other, :non_aligned_verbatim_string
rule /"(?:[^%\b\f\n\r\v]|%[A-DFHLNQR-V%'"()<>]|%\/(?:0[xX][\da-fA-F](?:_*[\da-fA-F])*|0[cC][0-7](?:_*[0-7])*|0[bB][01](?:_*[01])*|\d(?:_*\d)*)\/)*?"/, Str::Double
rule /--.*/, Comment::Single
rule /'(?:[^%\b\f\n\r\t\v]|%[A-DFHLNQR-V%'"()<>]|%\/(?:0[xX][\da-fA-F](?:_*[\da-fA-F])*|0[cC][0-7](?:_*[0-7])*|0[bB][01](?:_*[01])*|\d(?:_*\d)*)\/)'/, Str::Char
rule /(?:#{LanguageKeywords.join('|')})\b/, Keyword
rule /(?:#{LanguageVariables.join('|')})\b/, Keyword::Variable
rule /(?:#{BooleanConstants.join('|')})\b/, Keyword::Constant
rule /\b0[xX][\da-fA-F](?:_*[\da-fA-F])*b/, Num::Hex
rule /\b0[cC][0-7](?:_*[0-7])*\b/, Num::Oct
rule /\b0[bB][01](?:_*[01])*\b/, Num::Bin
rule /\d(?:_*\d)*/, Num::Integer
rule /(?:\d(?:_*\d)*)?\.(?:(?:\d(?:_*\d)*)?[eE][+-]?)?\d(?:_*\d)*|\d(?:_*\d)*\.?/, Num::Float
rule /:=|<<|>>|\(\||\|\)|->|\.|[{}\[\];(),:?]/, Punctuation::Indicator
rule /\\\\|\|\.\.\||\.\.|\/[~\/]?|[><\/]=?|[-+*^=~]/, Operator
rule /[A-Z][\dA-Z_]*/, Name::Class
rule /[A-Za-z][\dA-Za-z_]*/, Name
rule /\s+/, Text
end
state :aligned_verbatim_string do
rule /]"/, Str::Other, :pop!
rule SimpleString, Str::Other
end
state :non_aligned_verbatim_string do
rule /}"/, Str::Other, :pop!
rule SimpleString, Str::Other
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/prolog.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/prolog.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Prolog < RegexLexer
title "Prolog"
desc "The Prolog programming language (http://en.wikipedia.org/wiki/Prolog)"
tag 'prolog'
aliases 'prolog'
filenames '*.pro', '*.P', '*.prolog', '*.pl'
mimetypes 'text/x-prolog'
state :basic do
rule /\s+/, Text
rule /^#.*/, Comment::Single
rule /%.*/, Comment::Single
rule /\/\*/, Comment::Multiline, :nested_comment
rule /[\[\](){}|.,;!]/, Punctuation
rule /:-|-->/, Punctuation
rule /"[^"]*"/, Str::Double
rule /\d+\.\d+/, Num::Float
rule /\d+/, Num
end
state :atoms do
rule /[[:lower:]]([_[:word:][:digit:]])*/, Str::Symbol
rule /'[^']*'/, Str::Symbol
end
state :operators do
rule /(<|>|=<|>=|==|=:=|=|\/|\/\/|\*|\+|-)(?=\s|[a-zA-Z0-9\[])/,
Operator
rule /is/, Operator
rule /(mod|div|not)/, Operator
rule /[#&*+-.\/:<=>?@^~]+/, Operator
end
state :variables do
rule /[A-Z]+\w*/, Name::Variable
rule /_[[:word:]]*/, Name::Variable
end
state :root do
mixin :basic
mixin :atoms
mixin :variables
mixin :operators
end
state :nested_comment do
rule /\/\*/, Comment::Multiline, :push
rule /\s*\*[^*\/]+/, Comment::Multiline
rule /\*\//, Comment::Multiline, :pop!
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/http.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/http.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class HTTP < RegexLexer
tag 'http'
title "HTTP"
desc 'http requests and responses'
def self.http_methods
@http_methods ||= %w(GET POST PUT DELETE HEAD OPTIONS TRACE PATCH)
end
def content_lexer
return Lexers::PlainText unless @content_type
@content_lexer ||= Lexer.guess_by_mimetype(@content_type)
rescue Lexer::AmbiguousGuess
@content_lexer = Lexers::PlainText
end
start { @content_type = 'text/plain' }
state :root do
# request
rule %r(
(#{HTTP.http_methods.join('|')})([ ]+) # method
([^ ]+)([ ]+) # path
(HTTPS?)(/)(1[.][01])(\r?\n|$) # http version
)ox do
groups(
Name::Function, Text,
Name::Namespace, Text,
Keyword, Operator, Num, Text
)
push :headers
end
# response
rule %r(
(HTTPS?)(/)(1[.][01])([ ]+) # http version
(\d{3})([ ]+) # status
([^\r\n]+)(\r?\n|$) # status message
)x do
groups(
Keyword, Operator, Num, Text,
Num, Text,
Name::Exception, Text
)
push :headers
end
end
state :headers do
rule /([^\s:]+)( *)(:)( *)([^\r\n]+)(\r?\n|$)/ do |m|
key = m[1]
value = m[5]
if key.strip.casecmp('content-type').zero?
@content_type = value.split(';')[0].downcase
end
groups Name::Attribute, Text, Punctuation, Text, Str, Text
end
rule /([^\r\n]+)(\r?\n|$)/ do
groups Str, Text
end
rule /\r?\n/, Text, :content
end
state :content do
rule /.+/m do |m|
delegate(content_lexer)
end
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/handlebars.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/handlebars.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Handlebars < TemplateLexer
title "Handlebars"
desc 'the Handlebars and Mustache templating languages'
tag 'handlebars'
aliases 'hbs', 'mustache'
filenames '*.handlebars', '*.hbs', '*.mustache'
mimetypes 'text/x-handlebars', 'text/x-mustache'
id = %r([\w$-]+)
state :root do
# escaped slashes
rule(/\\{+/) { delegate parent }
# block comments
rule /{{!--/, Comment, :comment
rule /{{!.*?}}/, Comment
rule /{{{?/ do
token Keyword
push :stache
push :open_sym
end
rule(/(.+?)(?=\\|{{)/m) { delegate parent }
# if we get here, there's no more mustache tags, so we eat
# the rest of the doc
rule(/.+/m) { delegate parent }
end
state :comment do
rule(/{{/) { token Comment; push }
rule(/}}/) { token Comment; pop! }
rule(/[^{}]+/m) { token Comment }
rule(/[{}]/) { token Comment }
end
state :stache do
rule /}}}?/, Keyword, :pop!
rule /\s+/m, Text
rule /[=]/, Operator
rule /[\[\]]/, Punctuation
rule /[.](?=[}\s])/, Name::Variable
rule /[.][.]/, Name::Variable
rule %r([/.]), Punctuation
rule /"(\\.|.)*?"/, Str::Double
rule /'(\\.|.)*?'/, Str::Single
rule /\d+(?=}\s)/, Num
rule /(true|false)(?=[}\s])/, Keyword::Constant
rule /else(?=[}\s])/, Keyword
rule /this(?=[}\s])/, Name::Builtin::Pseudo
rule /@#{id}/, Name::Attribute
rule id, Name::Variable
end
state :open_sym do
rule %r([#/]) do
token Keyword
goto :block_name
end
rule /[>^&]/, Keyword
rule(//) { pop! }
end
state :block_name do
rule /if(?=[}\s])/, Keyword
rule id, Name::Namespace, :pop!
rule(//) { pop! }
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/vue.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/vue.rb | # frozen_string_literal: true
module Rouge
module Lexers
load_lexer 'html.rb'
class Vue < HTML
desc 'Vue.js single-file components'
tag 'vue'
aliases 'vuejs'
filenames '*.vue'
mimetypes 'text/x-vue', 'application/x-vue'
def initialize(*)
super
@js = Javascript.new(options)
end
def lookup_lang(lang)
lang.downcase!
lang = lang.gsub(/["']*/, '')
case lang
when 'html' then HTML
when 'css' then CSS
when 'javascript' then Javascript
when 'sass' then Sass
when 'scss' then Scss
when 'coffee' then Coffeescript
# TODO: add more when the lexers are done
else
PlainText
end
end
start { @js.reset! }
prepend :root do
rule /(<)(\s*)(template)/ do
groups Name::Tag, Text, Keyword
@lang = HTML
push :template
push :lang_tag
end
rule /(<)(\s*)(style)/ do
groups Name::Tag, Text, Keyword
@lang = CSS
push :style
push :lang_tag
end
rule /(<)(\s*)(script)/ do
groups Name::Tag, Text, Keyword
@lang = Javascript
push :script
push :lang_tag
end
end
state :style do
rule /(<\s*\/\s*)(style)(\s*>)/ do
groups Name::Tag, Keyword, Name::Tag
pop!
end
mixin :style_content
mixin :embed
end
state :script do
rule /(<\s*\/\s*)(script)(\s*>)/ do
groups Name::Tag, Keyword, Name::Tag
pop!
end
mixin :script_content
mixin :embed
end
state :lang_tag do
rule /(lang\s*=)(\s*)("(?:\\.|[^\\])*?"|'(\\.|[^\\])*?'|[^\s>]+)/ do |m|
groups Name::Attribute, Text, Str
@lang = lookup_lang(m[3])
end
mixin :tag
end
state :template do
rule %r((<\s*/\s*)(template)(\s*>)) do
groups Name::Tag, Keyword, Name::Tag
pop!
end
rule /{{/ do
token Str::Interpol
push :template_interpol
@js.reset!
end
mixin :embed
end
state :template_interpol do
rule /}}/, Str::Interpol, :pop!
rule /}/, Error
mixin :template_interpol_inner
end
state :template_interpol_inner do
rule(/{/) { delegate @js; push }
rule(/}/) { delegate @js; pop! }
rule(/[^{}]+/) { delegate @js }
end
state :embed do
rule(/[^{<]+/) { delegate @lang }
rule(/[<{][^<{]*/) { delegate @lang }
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/glsl.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/glsl.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
load_lexer 'c.rb'
# This file defines the GLSL language lexer to the Rouge
# syntax highlighter.
#
# Author: Sri Harsha Chilakapati
class Glsl < C
tag 'glsl'
filenames '*.glsl', '*.frag', '*.vert', '*.geom', '*.vs', '*.gs', '*.shader'
mimetypes 'x-shader/x-vertex', 'x-shader/x-fragment', 'x-shader/x-geometry'
title "GLSL"
desc "The GLSL shader language"
# optional comment or whitespace
ws = %r((?:\s|//.*?\n|/[*].*?[*]/)+)
id = /[a-zA-Z_][a-zA-Z0-9_]*/
def self.keywords
@keywords ||= Set.new %w(
attribute const uniform varying
layout
centroid flat smooth noperspective
patch sample
break continue do for while switch case default
if else
subroutine
in out inout
invariant
discard return struct precision
)
end
def self.keywords_type
@keywords_type ||= Set.new %w(
float double int void bool true false
lowp mediump highp
mat2 mat3 mat4 dmat2 dmat3 dmat4
mat2x2 mat2x3 mat2x4 dmat2x2 dmat2x3 dmat2x4
mat3x2 mat3x3 mat3x4 dmat3x2 dmat3x3 dmat3x4
mat4x2 mat4x3 mat4x4 dmat4x2 dmat4x3 dmat4x4
vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 dvec2 dvec3 dvec4
uint uvec2 uvec3 uvec4
sampler1D sampler2D sampler3D samplerCube
sampler1DShadow sampler2DShadow samplerCubeShadow
sampler1DArray sampler2DArray
sampler1DArrayShadow sampler2DArrayShadow
isampler1D isampler2D isampler3D isamplerCube
isampler1DArray isampler2DArray
usampler1D usampler2D usampler3D usamplerCube
usampler1DArray usampler2DArray
sampler2DRect sampler2DRectShadow isampler2DRect usampler2DRect
samplerBuffer isamplerBuffer usamplerBuffer
sampler2DMS isampler2DMS usampler2DMS
sampler2DMSArray isampler2DMSArray usampler2DMSArray
samplerCubeArray samplerCubeArrayShadow isamplerCubeArray usamplerCubeArray
)
end
def self.reserved
@reserved ||= Set.new %w(
common partition active
asm
class union enum typedef template this packed
goto
inline noinline volatile public static extern external interface
long short half fixed unsigned superp
input output
hvec2 hvec3 hvec4 fvec2 fvec3 fvec4
sampler3DRect
filter
image1D image2D image3D imageCube
iimage1D iimage2D iimage3D iimageCube
uimage1D uimage2D uimage3D uimageCube
image1DArray image2DArray
iimage1DArray iimage2DArray uimage1DArray uimage2DArray
image1DShadow image2DShadow
image1DArrayShadow image2DArrayShadow
imageBuffer iimageBuffer uimageBuffer
sizeof cast
namespace using
row_major
)
end
def self.builtins
@builtins ||= Set.new %w(
gl_VertexID gl_InstanceID gl_PerVertex gl_Position gl_PointSize gl_ClipDistance
gl_PrimitiveIDIn gl_InvocationID gl_PrimitiveID gl_Layer gl_ViewportIndex
gl_MaxPatchVertices gl_PatchVerticesIn gl_TessLevelOuter gl_TessLevelInner
gl_TessCoord gl_FragCoord gl_FrontFacing gl_PointCoord gl_SampleID gl_SamplePosition
gl_FragColor gl_FragData gl_MaxDrawBuffers gl_FragDepth gl_SampleMask
gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor
gl_TexCoord gl_FogFragCoord gl_Color gl_SecondaryColor gl_Normal gl_VertexID
gl_MultiTexCord0 gl_MultiTexCord1 gl_MultiTexCord2 gl_MultiTexCord3
gl_MultiTexCord4 gl_MultiTexCord5 gl_MultiTexCord6 gl_MultiTexCord7
gl_FogCoord gl_MaxVertexAttribs gl_MaxVertexUniformComponents
gl_MaxVaryingFloats gl_MaxVaryingComponents gl_MaxVertexOutputComponents
gl_MaxGeometryInputComponents gl_MaxGeometryOutputComponents
gl_MaxFragmentInputComponents gl_MaxVertexTextureImageUnits
gl_MaxCombinedTextureImageUnits gl_MaxTextureImageUnits
gl_MaxFragmentUniformComponents gl_MaxClipDistances
gl_MaxGeometryTextureImageUnits gl_MaxGeometryUniformComponents
gl_MaxGeometryVaryingComponents gl_MaxTessControlInputComponents
gl_MaxTessControlOutputComponents gl_MaxTessControlTextureImageUnits
gl_MaxTessControlUniformComponents gl_MaxTessControlTotalOutputComponents
gl_MaxTessEvaluationInputComponents gl_MaxTessEvaluationOutputComponents
gl_MaxTessEvaluationTextureImageUnits gl_MaxTessEvaluationUniformComponents
gl_MaxTessPatchComponents gl_MaxTessGenLevel gl_MaxViewports
gl_MaxVertexUniformVectors gl_MaxFragmentUniformVectors gl_MaxVaryingVectors
gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxClipPlanes gl_DepthRange
gl_DepthRangeParameters gl_ModelViewMatrix gl_ProjectionMatrix
gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix
gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse
gl_TextureMatrixInverse gl_ModelViewMatrixTranspose
gl_ModelViewProjectionMatrixTranspose gl_TextureMatrixTranspose
gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose
gl_ModelViewProjectionMatrixInverseTranspose
gl_TextureMatrixInverseTranspose gl_NormalScale gl_ClipPlane gl_PointParameters
gl_Point gl_MaterialParameters gl_FrontMaterial gl_BackMaterial
gl_LightSourceParameters gl_LightSource gl_MaxLights gl_LightModelParameters
gl_LightModel gl_LightModelProducts gl_FrontLightModelProduct
gl_BackLightModelProduct gl_LightProducts gl_FrontLightProduct
gl_BackLightProduct gl_TextureEnvColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR
gl_EyePlaneQ gl_ObjectPlaneS gl_ObjectPlaneT gl_ObjectPlaneR gl_ObjectPlaneQ
gl_FogParameters gl_Fog
)
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/nasm.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/nasm.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Nasm < RegexLexer
tag 'nasm'
filenames '*.asm'
#mimetypes 'text/x-chdr', 'text/x-csrc'
title "Nasm"
desc "Netwide Assembler"
ws = %r((?:\s|;.*?\n/)+)
id = /[a-zA-Z_][a-zA-Z0-9_]*/
#todo: pull more instructions from: http://www.nasm.us/doc/nasmdocb.html
#so far, we have sections 1.1 and 1.2
def self.keywords
@keywords ||= Set.new %w(
aaa aad aam aas adc add and arpl bb0_reset bb1_reset bound bsf bsr bswap bt btc btr bts
call cbw cdq cdqe clc cld cli clts cmc cmp cmpsb cmpsd cmpsq cmpsw cmpxchg
cmpxchg16b cmpxchg486 cmpxchg8b cpuid cpu_read cpu_write cqo cwd cwde daa das dec div
dmint emms enter equ f2xm1 fabs fadd faddp fbld fbstp fchs fclex fcmovb fcmovbe fcmove
fcmovnb fcmovnbe fcmovne fcmovnu fcmovu fcom fcomi fcomip fcomp fcompp fcos fdecstp
fdisi fdiv fdivp fdivr fdivrp femms feni ffree ffreep fiadd ficom ficomp fidiv fidivr
fild fimul fincstp finit fist fistp fisttp fisub fisubr fld fld1 fldcw fldenv fldl2e
fldl2t fldlg2 fldln2 fldpi fldz fmul fmulp fnclex fndisi fneni fninit fnop fnsave fnstcw
fnstenv fnstsw fpatan fprem fprem1 fptan frndint frstor fsave fscale fsetpm fsin fsincos
fsqrt fst fstcw fstenv fstp fstsw fsub fsubp fsubr fsubrp ftst fucom fucomi fucomip
fucomp fucompp fwait fxam fxch fxtract fyl2x fyl2xp1 hlt ibts icebp idiv imul in inc
incbin insb insd insw int int01 int03 int1 int3 into invd invlpg invlpga invpcid iret
iretd iretq iretw jcxz jecxz jmp jmpe jrcxz lahf lar lds lea leave les lfence lfs
lgdt lgs lidt lldt lmsw loadall loadall286 lodsb lodsd lodsq lodsw loop loope loopne
loopnz loopz lsl lss ltr mfence monitor monitorx mov movd movq movsb movsd movsq movsw
movsx movsxd movzx mul mwait mwaitx neg nop not or out outsb outsd outsw packssdw
packsswb packuswb paddb paddd paddsb paddsiw paddsw paddusb paddusw paddw pand pandn
pause paveb pavgusb pcmpeqb pcmpeqd pcmpeqw pcmpgtb pcmpgtd pcmpgtw pdistib pf2id pfacc
pfadd pfcmpeq pfcmpge pfcmpgt pfmax pfmin pfmul pfrcp pfrcpit1 pfrcpit2 pfrsqit1 pfrsqrt
pfsub pfsubr pi2fd pmachriw pmaddwd pmagw pmulhriw pmulhrwa pmulhrwc pmulhw pmullw
pmvgezb pmvlzb pmvnzb pmvzb pop popa popad popaw popf popfd popfq popfw por prefetch
prefetchw pslld psllq psllw psrad psraw psrld psrlq psrlw psubb psubd psubsb psubsiw
psubsw psubusb psubusw psubw punpckhbw punpckhdq punpckhwd punpcklbw punpckldq punpcklwd
push pusha pushad pushaw pushf pushfd pushfq pushfw pxor rcl rcr rdm rdmsr rdpmc rdshr
rdtsc rdtscp ret retf retn rol ror rsdc rsldt rsm rsts sahf sal salc sar sbb scasb scasd
scasq scasw sfence sgdt shl shld shr shrd sidt skinit sldt smi smint smintold smsw
stc std sti stosb stosd stosq stosw str sub svdc svldt svts swapgs syscall sysenter
sysexit sysret test ud0 ud1 ud2 ud2a ud2b umov verr verw wbinvd wrmsr wrshr xadd xbts
xchg xlat xlatb xor
cmova cmovae cmovb cmovbe cmovc cmove cmovg cmovge cmovl cmovle cmovna cmovnae cmovnb cmovnbe cmovnc cmovne cmovng cmovnge cmovnl cmovnle cmovno cmovnp cmovns cmovnz cmovo cmovp cmovpe cmovpo cmovs cmovz
ja jae jb jbe jc jcxz jecxz je jg jge jl jle jna jnae jnb jnbe jnc jne jng jnge jnl jnle jno jnp jns jnz jo jp jpe jpo js jz
seta setae setb setbe setc sete setg setge setl setle setna setnae setnb setnbe setnc setne setng setnge setnl setnle setno setnp setns setnz seto setp setpe setpo sets setz
AAA AAD AAM AAS ADC ADD AND ARPL BB0_RESET BB1_RESET BOUND BSF BSR BSWAP BT BTC BTR BTS
CALL CBW CDQ CDQE CLC CLD CLI CLTS CMC CMP CMPSB CMPSD CMPSQ CMPSW CMPXCHG
CMPXCHG16B CMPXCHG486 CMPXCHG8B CPUID CPU_READ CPU_WRITE CQO CWD CWDE DAA DAS DEC DIV
DMINT EMMS ENTER EQU F2XM1 FABS FADD FADDP FBLD FBSTP FCHS FCLEX FCMOVB FCMOVBE FCMOVE
FCMOVNB FCMOVNBE FCMOVNE FCMOVNU FCMOVU FCOM FCOMI FCOMIP FCOMP FCOMPP FCOS FDECSTP
FDISI FDIV FDIVP FDIVR FDIVRP FEMMS FENI FFREE FFREEP FIADD FICOM FICOMP FIDIV FIDIVR
FILD FIMUL FINCSTP FINIT FIST FISTP FISTTP FISUB FISUBR FLD FLD1 FLDCW FLDENV FLDL2E
FLDL2T FLDLG2 FLDLN2 FLDPI FLDZ FMUL FMULP FNCLEX FNDISI FNENI FNINIT FNOP FNSAVE FNSTCW
FNSTENV FNSTSW FPATAN FPREM FPREM1 FPTAN FRNDINT FRSTOR FSAVE FSCALE FSETPM FSIN FSINCOS
FSQRT FST FSTCW FSTENV FSTP FSTSW FSUB FSUBP FSUBR FSUBRP FTST FUCOM FUCOMI FUCOMIP
FUCOMP FUCOMPP FWAIT FXAM FXCH FXTRACT FYL2X FYL2XP1 HLT IBTS ICEBP IDIV IMUL IN INC
INCBIN INSB INSD INSW INT INT01 INT03 INT1 INT3 INTO INVD INVLPG INVLPGA INVPCID IRET
IRETD IRETQ IRETW JCXZ JECXZ JMP JMPE JRCXZ LAHF LAR LDS LEA LEAVE LES LFENCE LFS
LGDT LGS LIDT LLDT LMSW LOADALL LOADALL286 LODSB LODSD LODSQ LODSW LOOP LOOPE LOOPNE
LOOPNZ LOOPZ LSL LSS LTR MFENCE MONITOR MONITORX MOV MOVD MOVQ MOVSB MOVSD MOVSQ MOVSW
MOVSX MOVSXD MOVZX MUL MWAIT MWAITX NEG NOP NOT OR OUT OUTSB OUTSD OUTSW PACKSSDW
PACKSSWB PACKUSWB PADDB PADDD PADDSB PADDSIW PADDSW PADDUSB PADDUSW PADDW PAND PANDN
PAUSE PAVEB PAVGUSB PCMPEQB PCMPEQD PCMPEQW PCMPGTB PCMPGTD PCMPGTW PDISTIB PF2ID PFACC
PFADD PFCMPEQ PFCMPGE PFCMPGT PFMAX PFMIN PFMUL PFRCP PFRCPIT1 PFRCPIT2 PFRSQIT1 PFRSQRT
PFSUB PFSUBR PI2FD PMACHRIW PMADDWD PMAGW PMULHRIW PMULHRWA PMULHRWC PMULHW PMULLW
PMVGEZB PMVLZB PMVNZB PMVZB POP POPA POPAD POPAW POPF POPFD POPFQ POPFW POR PREFETCH
PREFETCHW PSLLD PSLLQ PSLLW PSRAD PSRAW PSRLD PSRLQ PSRLW PSUBB PSUBD PSUBSB PSUBSIW
PSUBSW PSUBUSB PSUBUSW PSUBW PUNPCKHBW PUNPCKHDQ PUNPCKHWD PUNPCKLBW PUNPCKLDQ PUNPCKLWD
PUSH PUSHA PUSHAD PUSHAW PUSHF PUSHFD PUSHFQ PUSHFW PXOR RCL RCR RDM RDMSR RDPMC RDSHR
RDTSC RDTSCP RET RETF RETN ROL ROR RSDC RSLDT RSM RSTS SAHF SAL SALC SAR SBB SCASB SCASD
SCASQ SCASW SFENCE SGDT SHL SHLD SHR SHRD SIDT SKINIT SLDT SMI SMINT SMINTOLD SMSW
STC STD STI STOSB STOSD STOSQ STOSW STR SUB SVDC SVLDT SVTS SWAPGS SYSCALL SYSENTER
SYSEXIT SYSRET TEST UD0 UD1 UD2 UD2A UD2B UMOV VERR VERW WBINVD WRMSR WRSHR XADD XBTS
XCHG XLAT XLATB XOR
CMOVA CMOVAE CMOVB CMOVBE CMOVC CMOVE CMOVG CMOVGE CMOVL CMOVLE CMOVNA CMOVNAE CMOVNB CMOVNBE CMOVNC CMOVNE CMOVNG CMOVNGE CMOVNL CMOVNLE CMOVNO CMOVNP CMOVNS CMOVNZ CMOVO CMOVP CMOVPE CMOVPO CMOVS CMOVZ
JA JAE JB JBE JC JCXZ JECXZ JE JG JGE JL JLE JNA JNAE JNB JNBE JNC JNE JNG JNGE JNL JNLE JNO JNP JNS JNZ JO JP JPE JPO JS JZ
SETA SETAE SETB SETBE SETC SETE SETG SETGE SETL SETLE SETNA SETNAE SETNB SETNBE SETNC SETNE SETNG SETNGE SETNL SETNLE SETNO SETNP SETNS SETNZ SETO SETP SETPE SETPO SETS SETZ
)
end
def self.keywords_type
@keywords_type ||= Set.new %w(
DB DW DD DQ DT DO DY DZ RESB RESW RESD RESQ REST RESO RESY RESZ
db dq dd dq dt do dy dz resb resw resd resq rest reso resy resz
)
end
def self.reserved
@reserved ||= Set.new %w(
global extern macro endmacro assign rep endrep section
GLOBAL EXTERN MACRO ENDMACRO ASSIGN REP ENDREP SECTION
)
end
def self.builtins
@builtins ||= []
end
start { push :expr_bol }
state :expr_bol do
mixin :inline_whitespace
rule(//) { pop! }
end
state :inline_whitespace do
rule /[ \t\r]+/, Text
end
state :whitespace do
rule /\n+/m, Text, :expr_bol
rule %r(//(\\.|.)*?\n), Comment::Single, :expr_bol
mixin :inline_whitespace
end
state :expr_whitespace do
rule /\n+/m, Text, :expr_bol
mixin :whitespace
end
state :root do
mixin :expr_whitespace
rule(//) { push :statement }
rule /^%[a-zA-Z0-9]+/, Comment::Preproc, :statement
rule(
%r(&=|[*]=|/=|\\=|\^=|\+=|-=|<<=|>>=|<<|>>|:=|<=|>=|<>|[-&*/\\^+=<>.]),
Operator
)
rule /;.*/, Comment, :statement
rule /^[a-zA-Z]+[a-zA-Z0-9]*:/, Name::Function
rule /;.*/, Comment
end
state :statement do
mixin :expr_whitespace
mixin :statements
rule /;.*/, Comment
rule /^%[a-zA-Z0-9]+/, Comment::Preproc
rule /[a-zA-Z]+%[0-9]+:/, Name::Function
end
state :statements do
mixin :whitespace
rule /L?"/, Str, :string
rule /[a-zA-Z]+%[0-9]+:/, Name::Function #labels/subroutines/functions
rule %r(L?'(\\.|\\[0-7]{1,3}|\\x[a-f0-9]{1,2}|[^\\'\n])')i, Str::Char
rule /0x[0-9a-f]+[lu]*/i, Num::Hex
rule /\d+[lu]*/i, Num::Integer
rule %r(\*/), Error
rule %r([~&*+=\|?:<>/-]), Operator
rule /[(),.]/, Punctuation
rule /\[[a-zA-Z0-9]*\]/, Punctuation
rule /%[0-9]+/, Keyword::Reserved
rule /[a-zA-Z]+%[0-9]+/, Name::Function #labels/subroutines/functions
#rule /(?<!\.)#{id}/ do |m|
rule id do |m|
name = m[0]
if self.class.keywords.include? name
token Keyword
elsif self.class.keywords_type.include? name
token Keyword::Type
elsif self.class.reserved.include? name
token Keyword::Reserved
elsif self.class.builtins.include? name
token Name::Builtin
else
token Name
end
end
end
state :string do
rule /"/, Str, :pop!
rule /\\([\\abfnrtv"']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})/, Str::Escape
rule /[^\\"\n]+/, Str
rule /\\\n/, Str
rule /\\/, Str # stray backslash
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/make.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/make.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Make < RegexLexer
title "Make"
desc "Makefile syntax"
tag 'make'
aliases 'makefile', 'mf', 'gnumake', 'bsdmake'
filenames '*.make', 'Makefile', 'makefile', 'Makefile.*', 'GNUmakefile'
mimetypes 'text/x-makefile'
bsd_special = %w(
include undef error warning if else elif endif for endfor
)
gnu_special = %w(
ifeq ifneq ifdef ifndef else endif include -include define endef :
)
line = /(?:\\.|\\\n|[^\\\n])*/m
def initialize(opts={})
super
@shell = Shell.new(opts)
end
start { @shell.reset! }
state :root do
rule /\s+/, Text
rule /#.*?\n/, Comment
rule /(export)(\s+)(?=[a-zA-Z0-9_\${}\t -]+\n)/ do
groups Keyword, Text
push :export
end
rule /export\s+/, Keyword
# assignment
rule /([a-zA-Z0-9_${}.-]+)(\s*)([!?:+]?=)/m do |m|
token Name::Variable, m[1]
token Text, m[2]
token Operator, m[3]
push :shell_line
end
rule /"(\\\\|\\.|[^"\\])*"/, Str::Double
rule /'(\\\\|\\.|[^'\\])*'/, Str::Single
rule /([^\n:]+)(:+)([ \t]*)/ do
groups Name::Label, Operator, Text
push :block_header
end
end
state :export do
rule /[\w\${}-]/, Name::Variable
rule /\n/, Text, :pop!
rule /\s+/, Text
end
state :block_header do
rule /[^,\\\n#]+/, Name::Function
rule /,/, Punctuation
rule /#.*?/, Comment
rule /\\\n/, Text
rule /\\./, Text
rule /\n/ do
token Text
goto :block_body
end
end
state :block_body do
rule /(\t[\t ]*)([@-]?)/ do |m|
groups Text, Punctuation
push :shell_line
end
rule(//) { @shell.reset!; pop! }
end
state :shell do
# macro interpolation
rule /\$\(\s*[a-z_]\w*\s*\)/i, Name::Variable
# $(shell ...)
rule /(\$\()(\s*)(shell)(\s+)/m do
groups Name::Function, Text, Name::Builtin, Text
push :shell_expr
end
rule(/\\./m) { delegate @shell }
stop = /\$\(|\(|\)|\\|$/
rule(/.+?(?=#{stop})/m) { delegate @shell }
rule(stop) { delegate @shell }
end
state :shell_expr do
rule(/\(/) { delegate @shell; push }
rule /\)/, Name::Variable, :pop!
mixin :shell
end
state :shell_line do
rule /\n/, Text, :pop!
mixin :shell
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/turtle.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/turtle.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Turtle < RegexLexer
title "Turtle/TriG"
desc "Terse RDF Triple Language, TriG"
tag 'turtle'
filenames *%w(*.ttl *.trig)
mimetypes *%w(
text/turtle
application/trig
)
state :root do
rule /@base\b/, Keyword::Declaration
rule /@prefix\b/, Keyword::Declaration
rule /true\b/, Keyword::Constant
rule /false\b/, Keyword::Constant
rule /""".*?"""/m, Literal::String
rule /"([^"\\]|\\.)*"/, Literal::String
rule /'''.*?'''/m, Literal::String
rule /'([^'\\]|\\.)*'/, Literal::String
rule /#.*$/, Comment::Single
rule /@[^\s,.; ]+/, Name::Attribute
rule /[+-]?[0-9]+\.[0-9]*E[+-]?[0-9]+/, Literal::Number::Float
rule /[+-]?\.[0-9]+E[+-]?[0-9]+/, Literal::Number::Float
rule /[+-]?[0-9]+E[+-]?[0-9]+/, Literal::Number::Float
rule /[+-]?[0-9]*\.[0-9]+?/, Literal::Number::Float
rule /[+-]?[0-9]+/, Literal::Number::Integer
rule /\./, Punctuation
rule /,/, Punctuation
rule /;/, Punctuation
rule /\(/, Punctuation
rule /\)/, Punctuation
rule /\{/, Punctuation
rule /\}/, Punctuation
rule /\[/, Punctuation
rule /\]/, Punctuation
rule /\^\^/, Punctuation
rule /<[^>]*>/, Name::Label
rule /base\b/i, Keyword::Declaration
rule /prefix\b/i, Keyword::Declaration
rule /GRAPH\b/, Keyword
rule /a\b/, Keyword
rule /\s+/, Text::Whitespace
rule /[^:;<>#\@"\(\).\[\]\{\} ]+:/, Name::Namespace
rule /[^:;<>#\@"\(\).\[\]\{\} ]+/, Name
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/matlab.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/matlab.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Matlab < RegexLexer
title "MATLAB"
desc "Matlab"
tag 'matlab'
aliases 'm'
filenames '*.m'
mimetypes 'text/x-matlab', 'application/x-matlab'
def self.keywords
@keywords = Set.new %w(
break case catch classdef continue else elseif end for function
global if otherwise parfor persistent return spmd switch try while
)
end
def self.builtins
load Pathname.new(__FILE__).dirname.join('matlab/builtins.rb')
self.builtins
end
state :root do
rule /\s+/m, Text # Whitespace
rule %r([{]%.*?%[}])m, Comment::Multiline
rule /%.*$/, Comment::Single
rule /([.][.][.])(.*?)$/ do
groups(Keyword, Comment)
end
rule /^(!)(.*?)(?=%|$)/ do |m|
token Keyword, m[1]
delegate Shell, m[2]
end
rule /[a-zA-Z][_a-zA-Z0-9]*/m do |m|
match = m[0]
if self.class.keywords.include? match
token Keyword
elsif self.class.builtins.include? match
token Name::Builtin
else
token Name
end
end
rule %r{[(){};:,\/\\\]\[]}, Punctuation
rule /~=|==|<<|>>|[-~+\/*%=<>&^|.@]/, Operator
rule /(\d+\.\d*|\d*\.\d+)(e[+-]?[0-9]+)?/i, Num::Float
rule /\d+e[+-]?[0-9]+/i, Num::Float
rule /\d+L/, Num::Integer::Long
rule /\d+/, Num::Integer
rule /'(?=(.*'))/, Str::Single, :string
rule /'/, Operator
end
state :string do
rule /[^']+/, Str::Single
rule /''/, Str::Escape
rule /'/, Str::Single, :pop!
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/properties.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/properties.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Properties < RegexLexer
title ".properties"
desc '.properties config files for Java'
tag 'properties'
filenames '*.properties'
mimetypes 'text/x-java-properties'
identifier = /[\w.-]+/
state :basic do
rule /[!#].*?\n/, Comment
rule /\s+/, Text
rule /\\\n/, Str::Escape
end
state :root do
mixin :basic
rule /(#{identifier})(\s*)([=:])/ do
groups Name::Property, Text, Punctuation
push :value
end
end
state :value do
rule /\n/, Text, :pop!
mixin :basic
rule /"/, Str, :dq
rule /'.*?'/, Str
mixin :esc_str
rule /[^\\\n]+/, Str
end
state :dq do
rule /"/, Str, :pop!
mixin :esc_str
rule /[^\\"]+/m, Str
end
state :esc_str do
rule /\\u[0-9]{4}/, Str::Escape
rule /\\./m, Str::Escape
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/liquid.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/liquid.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Liquid < RegexLexer
title "Liquid"
desc 'Liquid is a templating engine for Ruby (liquidmarkup.org)'
tag 'liquid'
filenames '*.liquid'
state :root do
rule /[^\{]+/, Text
rule /(\{%)(\s*)/ do
groups Punctuation, Text::Whitespace
push :tag_or_block
end
rule /(\{\{)(\s*)/ do
groups Punctuation, Text::Whitespace
push :output
end
rule /\{/, Text
end
state :tag_or_block do
# builtin logic blocks
rule /(if|unless|elsif|case)(?=\s+)/, Keyword::Reserved, :condition
rule /(when)(\s+)/ do
groups Keyword::Reserved, Text::Whitespace
push :when
end
rule /(else)(\s*)(%\})/ do
groups Keyword::Reserved, Text::Whitespace, Punctuation
pop!
end
# other builtin blocks
rule /(capture)(\s+)([^\s%]+)(\s*)(%\})/ do
groups Name::Tag, Text::Whitespace, Name::Attribute, Text::Whitespace, Punctuation
pop!
end
rule /(comment)(\s*)(%\})/ do
groups Name::Tag, Text::Whitespace, Punctuation
push :comment
end
rule /(raw)(\s*)(%\})/ do
groups Name::Tag, Text::Whitespace, Punctuation
push :raw
end
rule /assign/, Name::Tag, :assign
rule /include/, Name::Tag, :include
# end of block
rule /(end(case|unless|if))(\s*)(%\})/ do
groups Keyword::Reserved, nil, Text::Whitespace, Punctuation
pop!
end
rule /(end([^\s%]+))(\s*)(%\})/ do
groups Name::Tag, nil, Text::Whitespace, Punctuation
pop!
end
# builtin tags
rule /(cycle)(\s+)(([^\s:]*)(:))?(\s*)/ do |m|
token Name::Tag, m[1]
token Text::Whitespace, m[2]
if m[4] =~ /'[^']*'/
token Str::Single, m[4]
elsif m[4] =~ /"[^"]*"/
token Str::Double, m[4]
else
token Name::Attribute, m[4]
end
token Punctuation, m[5]
token Text::Whitespace, m[6]
push :variable_tag_markup
end
# other tags or blocks
rule /([^\s%]+)(\s*)/ do
groups Name::Tag, Text::Whitespace
push :tag_markup
end
end
state :output do
mixin :whitespace
mixin :generic
rule /\}\}/, Punctuation, :pop!
rule /\|/, Punctuation, :filters
end
state :filters do
mixin :whitespace
rule(/\}\}/) { token Punctuation; reset_stack }
rule /([^\s\|:]+)(:?)(\s*)/ do
groups Name::Function, Punctuation, Text::Whitespace
push :filter_markup
end
end
state :filter_markup do
rule /\|/, Punctuation, :pop!
mixin :end_of_tag
mixin :end_of_block
mixin :default_param_markup
end
state :condition do
mixin :end_of_block
mixin :whitespace
rule /([=!><]=?)/, Operator
rule /\b((!)|(not\b))/ do
groups nil, Operator, Operator::Word
end
rule /(contains)/, Operator::Word
mixin :generic
mixin :whitespace
end
state :when do
mixin :end_of_block
mixin :whitespace
mixin :generic
end
state :operator do
rule /(\s*)((=|!|>|<)=?)(\s*)/ do
groups Text::Whitespace, Operator, nil, Text::Whitespace
pop!
end
rule /(\s*)(\bcontains\b)(\s*)/ do
groups Text::Whitespace, Operator::Word, Text::Whitespace
pop!
end
end
state :end_of_tag do
rule(/\}\}/) { token Punctuation; reset_stack }
end
state :end_of_block do
rule(/%\}/) { token Punctuation; reset_stack }
end
# states for unknown markup
state :param_markup do
mixin :whitespace
mixin :string
rule /([^\s=:]+)(\s*)(=|:)/ do
groups Name::Attribute, Text::Whitespace, Operator
end
rule /(\{\{)(\s*)([^\s\}])(\s*)(\}\})/ do
groups Punctuation, Text::Whitespace, nil, Text::Whitespace, Punctuation
end
mixin :number
mixin :keyword
rule /,/, Punctuation
end
state :default_param_markup do
mixin :param_markup
rule /./, Text
end
state :variable_param_markup do
mixin :param_markup
mixin :variable
rule /./, Text
end
state :tag_markup do
mixin :end_of_block
mixin :default_param_markup
end
state :variable_tag_markup do
mixin :end_of_block
mixin :variable_param_markup
end
# states for different values types
state :keyword do
rule /\b(false|true)\b/, Keyword::Constant
end
state :variable do
rule /\.(?=\w)/, Punctuation
rule /[a-zA-Z_]\w*\??/, Name::Variable
end
state :string do
rule /'[^']*'/, Str::Single
rule /"[^"]*"/, Str::Double
end
state :number do
rule /\d+\.\d+/, Num::Float
rule /\d+/, Num::Integer
end
state :array_index do
rule /\[/, Punctuation
rule /\]/, Punctuation
end
state :generic do
mixin :array_index
mixin :keyword
mixin :string
mixin :variable
mixin :number
end
state :whitespace do
rule /[ \t]+/, Text::Whitespace
end
state :comment do
rule /(\{%)(\s*)(endcomment)(\s*)(%\})/ do
groups Punctuation, Text::Whitespace, Name::Tag, Text::Whitespace, Punctuation
reset_stack
end
rule /./, Comment
end
state :raw do
rule /[^\{]+/, Text
rule /(\{%)(\s*)(endraw)(\s*)(%\})/ do
groups Punctuation, Text::Whitespace, Name::Tag, Text::Whitespace, Punctuation
reset_stack
end
rule /\{/, Text
end
state :assign do
mixin :whitespace
mixin :end_of_block
rule /(\s*)(=)(\s*)/ do
groups Text::Whitespace, Operator, Text::Whitespace
end
rule /\|/, Punctuation, :filters
mixin :generic
end
state :include do
mixin :whitespace
rule /([^\.]+)(\.)(html|liquid)/ do
groups Name::Attribute, Punctuation, Name::Attribute
end
mixin :variable_tag_markup
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/scheme.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/scheme.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Scheme < RegexLexer
title "Scheme"
desc "The Scheme variant of Lisp"
tag 'scheme'
filenames '*.scm', '*.ss'
mimetypes 'text/x-scheme', 'application/x-scheme'
def self.keywords
@keywords ||= Set.new %w(
lambda define if else cond and or case let let* letrec begin
do delay set! => quote quasiquote unquote unquote-splicing
define-syntax let-syntax letrec-syntax syntax-rules
)
end
def self.builtins
@builtins ||= Set.new %w(
* + - / < <= = > >= abs acos angle append apply asin
assoc assq assv atan boolean? caaaar caaadr caaar caadar
caaddr caadr caar cadaar cadadr cadar caddar cadddr caddr
cadr call-with-current-continuation call-with-input-file
call-with-output-file call-with-values call/cc car cdaaar cdaadr
cdaar cdadar cdaddr cdadr cdar cddaar cddadr cddar cdddar cddddr
cdddr cddr cdr ceiling char->integer char-alphabetic? char-ci<=?
char-ci<? char-ci=? char-ci>=? char-ci>? char-downcase
char-lower-case? char-numeric? char-ready? char-upcase
char-upper-case? char-whitespace? char<=? char<? char=? char>=?
char>? char? close-input-port close-output-port complex? cons
cos current-input-port current-output-port denominator
display dynamic-wind eof-object? eq? equal? eqv? eval
even? exact->inexact exact? exp expt floor for-each force gcd
imag-part inexact->exact inexact? input-port? integer->char
integer? interaction-environment lcm length list list->string
list->vector list-ref list-tail list? load log magnitude
make-polar make-rectangular make-string make-vector map
max member memq memv min modulo negative? newline not
null-environment null? number->string number? numerator odd?
open-input-file open-output-file output-port? pair? peek-char
port? positive? procedure? quotient rational? rationalize
read read-char real-part real? remainder reverse round
scheme-report-environment set-car! set-cdr! sin sqrt string
string->list string->number string->symbol string-append
string-ci<=? string-ci<? string-ci=? string-ci>=? string-ci>?
string-copy string-fill! string-length string-ref
string-set! string<=? string<? string=? string>=?
string>? string? substring symbol->string symbol?
tan transcript-off transcript-on truncate values vector
vector->list vector-fill! vector-length vector-ref
vector-set! vector? with-input-from-file with-output-to-file
write write-char zero?
)
end
id = /[a-z0-9!$\%&*+,\/:<=>?@^_~|-]+/i
state :root do
# comments
rule /;.*$/, Comment::Single
rule /\s+/m, Text
rule /-?\d+\.\d+/, Num::Float
rule /-?\d+/, Num::Integer
# Racket infinitites
rule /[+-]inf[.][f0]/, Num
rule /#b[01]+/, Num::Bin
rule /#o[0-7]+/, Num::Oct
rule /#d[0-9]+/, Num::Integer
rule /#x[0-9a-f]+/i, Num::Hex
rule /#[ei][\d.]+/, Num::Other
rule /"(\\\\|\\"|[^"])*"/, Str
rule /'#{id}/i, Str::Symbol
rule /#\\([()\/'"._!\$%& ?=+-]{1}|[a-z0-9]+)/i,
Str::Char
rule /#t|#f/, Name::Constant
rule /(?:'|#|`|,@|,|\.)/, Operator
rule /(['#])(\s*)(\()/m do
groups Str::Symbol, Text, Punctuation
end
rule /\(|\[/, Punctuation, :command
rule /\)|\]/, Punctuation
rule id, Name::Variable
end
state :command do
rule id, Name::Function do |m|
if self.class.keywords.include? m[0]
token Keyword
elsif self.class.builtins.include? m[0]
token Name::Builtin
else
token Name::Function
end
pop!
end
rule(//) { pop! }
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/cmake.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/cmake.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class CMake < RegexLexer
title 'CMake'
desc 'The cross-platform, open-source build system'
tag 'cmake'
filenames 'CMakeLists.txt', '*.cmake'
mimetypes 'text/x-cmake'
SPACE = '[ \t]'
BRACKET_OPEN = '\[=*\['
STATES_MAP = {
:root => Text,
:bracket_string => Str::Double,
:quoted_argument => Str::Double,
:bracket_comment => Comment::Multiline,
:variable_reference => Name::Variable,
}
BUILTIN_COMMANDS = Set.new %w[
add_compile_options
add_custom_command
add_custom_target
add_definitions
add_dependencies
add_executable
add_library
add_subdirectory
add_test
aux_source_directory
break
build_command
build_name
cmake_host_system_information
cmake_minimum_required
cmake_policy
configure_file
create_test_sourcelist
define_property
else
elseif
enable_language
enable_testing
endforeach
endfunction
endif
endmacro
endwhile
exec_program
execute_process
export
export_library_dependencies
file
find_file
find_library
find_package
find_path
find_program
fltk_wrap_ui
foreach
function
get_cmake_property
get_directory_property
get_filename_component
get_property
get_source_file_property
get_target_property
get_test_property
if
include
include_directories
include_external_msproject
include_regular_expression
install
install_files
install_programs
install_targets
link_directories
link_libraries
list
load_cache
load_command
macro
make_directory
mark_as_advanced
math
message
option
output_required_files
project
qt_wrap_cpp
qt_wrap_ui
remove
remove_definitions
return
separate_arguments
set
set_directory_properties
set_property
set_source_files_properties
set_target_properties
set_tests_properties
site_name
source_group
string
subdir_depends
subdirs
target_compile_definitions
target_compile_options
target_include_directories
target_link_libraries
try_compile
try_run
unset
use_mangled_mesa
utility_source
variable_requires
variable_watch
while
write_file
]
state :default do
rule /\r\n?|\n/ do
token STATES_MAP[state.name.to_sym]
end
rule /./ do
token STATES_MAP[state.name.to_sym]
end
end
state :variable_interpolation do
rule /\$\{/ do
token Str::Interpol
push :variable_reference
end
end
state :bracket_close do
rule /\]=*\]/ do |m|
token STATES_MAP[state.name.to_sym]
goto :root if m[0].length == @bracket_len
end
end
state :root do
mixin :variable_interpolation
rule /#{SPACE}/, Text
rule /[()]/, Punctuation
rule /##{BRACKET_OPEN}/ do |m|
token Comment::Multiline
@bracket_len = m[0].length - 1 # decount '#'
goto :bracket_comment
end
rule /#{BRACKET_OPEN}/ do |m|
token Str::Double
@bracket_len = m[0].length
goto :bracket_string
end
rule /"/, Str::Double, :quoted_argument
rule /([A-Za-z_][A-Za-z0-9_]*)(#{SPACE}*)(\()/ do |m|
groups BUILTIN_COMMANDS.include?(m[1]) ? Name::Builtin : Name::Function, Text, Punctuation
end
rule /#.*/, Comment::Single
mixin :default
end
state :bracket_string do
mixin :bracket_close
mixin :variable_interpolation
mixin :default
end
state :bracket_comment do
mixin :bracket_close
mixin :default
end
state :variable_reference do
mixin :variable_interpolation
rule /}/, Str::Interpol, :pop!
mixin :default
end
state :quoted_argument do
mixin :variable_interpolation
rule /"/, Str::Double, :root
rule /\\[()#" \\$@^trn;]/, Str::Escape
mixin :default
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/powershell.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/powershell.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
load_lexer 'shell.rb'
class Powershell < Shell
title 'powershell'
desc 'powershell'
tag 'powershell'
aliases 'posh'
filenames '*.ps1', '*.psm1', '*.psd1', '*.psrc', '*.pssc'
mimetypes 'text/x-powershell'
ATTRIBUTES = %w(
CmdletBinding ConfirmImpact DefaultParameterSetName HelpURI SupportsPaging
SupportsShouldProcess PositionalBinding
).join('|')
KEYWORDS = %w(
Begin Exit Process Break Filter Return Catch Finally Sequence Class For
Switch Continue ForEach Throw Data From Trap Define Function Try Do If
Until DynamicParam In Using Else InlineScript Var ElseIf Parallel While
End Param Workflow
).join('|')
KEYWORDS_TYPE = %w(
bool byte char decimal double float int long object sbyte
short string uint ulong ushort
).join('|')
OPERATORS = %w(
-split -isplit -csplit -join -is -isnot -as -eq -ieq -ceq -ne -ine
-cne -gt -igt -cgt -ge -ige -cge -lt -ilt -clt -le -ile -cle -like
-ilike -clike -notlike -inotlike -cnotlike -match -imatch -cmatch
-notmatch -inotmatch -cnotmatch -contains -icontains -ccontains
-notcontains -inotcontains -cnotcontains -replace -ireplace
-creplace -band -bor -bxor -and -or -xor \. & = \+= -= \*= \/= %=
).join('|')
BUILTINS = %w(
Add-ProvisionedAppxPackage Add-WindowsFeature Apply-WindowsUnattend
Begin-WebCommitDelay Disable-PhysicalDiskIndication
Disable-StorageDiagnosticLog Enable-PhysicalDiskIndication
Enable-StorageDiagnosticLog End-WebCommitDelay Expand-IscsiVirtualDisk
Flush-Volume Get-DiskSNV Get-PhysicalDiskSNV Get-ProvisionedAppxPackage
Get-StorageEnclosureSNV Initialize-Volume Move-SmbClient
Remove-ProvisionedAppxPackage Remove-WindowsFeature Write-FileSystemCache
Add-BCDataCacheExtension Add-DnsClientNrptRule Add-DtcClusterTMMapping
Add-EtwTraceProvider Add-InitiatorIdToMaskingSet Add-MpPreference
Add-NetEventNetworkAdapter Add-NetEventPacketCaptureProvider
Add-NetEventProvider Add-NetEventVFPProvider Add-NetEventVmNetworkAdapter
Add-NetEventVmSwitch Add-NetEventVmSwitchProvider
Add-NetEventWFPCaptureProvider Add-NetIPHttpsCertBinding Add-NetLbfoTeamMember
Add-NetLbfoTeamNic Add-NetNatExternalAddress Add-NetNatStaticMapping
Add-NetSwitchTeamMember Add-OdbcDsn Add-PartitionAccessPath Add-PhysicalDisk
Add-Printer Add-PrinterDriver Add-PrinterPort Add-RDServer Add-RDSessionHost
Add-RDVirtualDesktopToCollection Add-TargetPortToMaskingSet
Add-VirtualDiskToMaskingSet Add-VpnConnection Add-VpnConnectionRoute
Add-VpnConnectionTriggerApplication Add-VpnConnectionTriggerDnsConfiguration
Add-VpnConnectionTriggerTrustedNetwork Block-FileShareAccess
Block-SmbShareAccess Clear-AssignedAccess Clear-BCCache Clear-Disk
Clear-DnsClientCache Clear-FileStorageTier Clear-PcsvDeviceLog
Clear-StorageDiagnosticInfo Close-SmbOpenFile Close-SmbSession Compress-Archive
Configuration Connect-IscsiTarget Connect-VirtualDisk ConvertFrom-SddlString
Copy-NetFirewallRule Copy-NetIPsecMainModeCryptoSet Copy-NetIPsecMainModeRule
Copy-NetIPsecPhase1AuthSet Copy-NetIPsecPhase2AuthSet
Copy-NetIPsecQuickModeCryptoSet Copy-NetIPsecRule Debug-FileShare
Debug-MMAppPrelaunch Debug-StorageSubSystem Debug-Volume Disable-BC
Disable-BCDowngrading Disable-BCServeOnBattery
Disable-DAManualEntryPointSelection Disable-DscDebug Disable-MMAgent
Disable-NetAdapter Disable-NetAdapterBinding Disable-NetAdapterChecksumOffload
Disable-NetAdapterEncapsulatedPacketTaskOffload Disable-NetAdapterIPsecOffload
Disable-NetAdapterLso Disable-NetAdapterPacketDirect
Disable-NetAdapterPowerManagement Disable-NetAdapterQos Disable-NetAdapterRdma
Disable-NetAdapterRsc Disable-NetAdapterRss Disable-NetAdapterSriov
Disable-NetAdapterVmq Disable-NetDnsTransitionConfiguration
Disable-NetFirewallRule Disable-NetIPHttpsProfile Disable-NetIPsecMainModeRule
Disable-NetIPsecRule Disable-NetNatTransitionConfiguration
Disable-NetworkSwitchEthernetPort Disable-NetworkSwitchFeature
Disable-NetworkSwitchVlan Disable-OdbcPerfCounter
Disable-PhysicalDiskIdentification Disable-PnpDevice Disable-PSTrace
Disable-PSWSManCombinedTrace Disable-RDVirtualDesktopADMachineAccountReuse
Disable-ScheduledTask Disable-ServerManagerStandardUserRemoting
Disable-SmbDelegation Disable-StorageEnclosureIdentification
Disable-StorageHighAvailability Disable-StorageMaintenanceMode Disable-Ual
Disable-WdacBidTrace Disable-WSManTrace Disconnect-IscsiTarget
Disconnect-NfsSession Disconnect-RDUser Disconnect-VirtualDisk
Dismount-DiskImage Enable-BCDistributed Enable-BCDowngrading
Enable-BCHostedClient Enable-BCHostedServer Enable-BCLocal
Enable-BCServeOnBattery Enable-DAManualEntryPointSelection Enable-DscDebug
Enable-MMAgent Enable-NetAdapter Enable-NetAdapterBinding
Enable-NetAdapterChecksumOffload Enable-NetAdapterEncapsulatedPacketTaskOffload
Enable-NetAdapterIPsecOffload Enable-NetAdapterLso
Enable-NetAdapterPacketDirect Enable-NetAdapterPowerManagement
Enable-NetAdapterQos Enable-NetAdapterRdma Enable-NetAdapterRsc
Enable-NetAdapterRss Enable-NetAdapterSriov Enable-NetAdapterVmq
Enable-NetDnsTransitionConfiguration Enable-NetFirewallRule
Enable-NetIPHttpsProfile Enable-NetIPsecMainModeRule Enable-NetIPsecRule
Enable-NetNatTransitionConfiguration Enable-NetworkSwitchEthernetPort
Enable-NetworkSwitchFeature Enable-NetworkSwitchVlan Enable-OdbcPerfCounter
Enable-PhysicalDiskIdentification Enable-PnpDevice Enable-PSTrace
Enable-PSWSManCombinedTrace Enable-RDVirtualDesktopADMachineAccountReuse
Enable-ScheduledTask Enable-ServerManagerStandardUserRemoting
Enable-SmbDelegation Enable-StorageEnclosureIdentification
Enable-StorageHighAvailability Enable-StorageMaintenanceMode Enable-Ual
Enable-WdacBidTrace Enable-WSManTrace Expand-Archive Export-BCCachePackage
Export-BCSecretKey Export-IscsiTargetServerConfiguration
Export-ODataEndpointProxy Export-RDPersonalSessionDesktopAssignment
Export-RDPersonalVirtualDesktopAssignment Export-ScheduledTask
Find-NetIPsecRule Find-NetRoute Format-Hex Format-Volume Get-AppBackgroundTask
Get-AppvVirtualProcess Get-AppxLastError Get-AppxLog Get-AssignedAccess
Get-AutologgerConfig Get-BCClientConfiguration Get-BCContentServerConfiguration
Get-BCDataCache Get-BCDataCacheExtension Get-BCHashCache
Get-BCHostedCacheServerConfiguration Get-BCNetworkConfiguration Get-BCStatus
Get-ClusteredScheduledTask Get-DAClientExperienceConfiguration
Get-DAConnectionStatus Get-DAEntryPointTableItem Get-DedupProperties Get-Disk
Get-DiskImage Get-DiskStorageNodeView Get-DisplayResolution Get-DnsClient
Get-DnsClientCache Get-DnsClientGlobalSetting Get-DnsClientNrptGlobal
Get-DnsClientNrptPolicy Get-DnsClientNrptRule Get-DnsClientServerAddress
Get-DscConfiguration Get-DscConfigurationStatus
Get-DscLocalConfigurationManager Get-DscResource Get-Dtc
Get-DtcAdvancedHostSetting Get-DtcAdvancedSetting Get-DtcClusterDefault
Get-DtcClusterTMMapping Get-DtcDefault Get-DtcLog Get-DtcNetworkSetting
Get-DtcTransaction Get-DtcTransactionsStatistics
Get-DtcTransactionsTraceSession Get-DtcTransactionsTraceSetting
Get-EtwTraceProvider Get-EtwTraceSession Get-FileHash Get-FileIntegrity
Get-FileShare Get-FileShareAccessControlEntry Get-FileStorageTier
Get-InitiatorId Get-InitiatorPort Get-IscsiConnection Get-IscsiSession
Get-IscsiTarget Get-IscsiTargetPortal Get-IseSnippet Get-LogProperties
Get-MaskingSet Get-MMAgent Get-MpComputerStatus Get-MpPreference Get-MpThreat
Get-MpThreatCatalog Get-MpThreatDetection Get-NCSIPolicyConfiguration
Get-Net6to4Configuration Get-NetAdapter Get-NetAdapterAdvancedProperty
Get-NetAdapterBinding Get-NetAdapterChecksumOffload
Get-NetAdapterEncapsulatedPacketTaskOffload Get-NetAdapterHardwareInfo
Get-NetAdapterIPsecOffload Get-NetAdapterLso Get-NetAdapterPacketDirect
Get-NetAdapterPowerManagement Get-NetAdapterQos Get-NetAdapterRdma
Get-NetAdapterRsc Get-NetAdapterRss Get-NetAdapterSriov Get-NetAdapterSriovVf
Get-NetAdapterStatistics Get-NetAdapterVmq Get-NetAdapterVMQQueue
Get-NetAdapterVPort Get-NetCompartment Get-NetConnectionProfile
Get-NetDnsTransitionConfiguration Get-NetDnsTransitionMonitoring
Get-NetEventNetworkAdapter Get-NetEventPacketCaptureProvider
Get-NetEventProvider Get-NetEventSession Get-NetEventVFPProvider
Get-NetEventVmNetworkAdapter Get-NetEventVmSwitch Get-NetEventVmSwitchProvider
Get-NetEventWFPCaptureProvider Get-NetFirewallAddressFilter
Get-NetFirewallApplicationFilter Get-NetFirewallInterfaceFilter
Get-NetFirewallInterfaceTypeFilter Get-NetFirewallPortFilter
Get-NetFirewallProfile Get-NetFirewallRule Get-NetFirewallSecurityFilter
Get-NetFirewallServiceFilter Get-NetFirewallSetting Get-NetIPAddress
Get-NetIPConfiguration Get-NetIPHttpsConfiguration Get-NetIPHttpsState
Get-NetIPInterface Get-NetIPsecDospSetting Get-NetIPsecMainModeCryptoSet
Get-NetIPsecMainModeRule Get-NetIPsecMainModeSA Get-NetIPsecPhase1AuthSet
Get-NetIPsecPhase2AuthSet Get-NetIPsecQuickModeCryptoSet
Get-NetIPsecQuickModeSA Get-NetIPsecRule Get-NetIPv4Protocol
Get-NetIPv6Protocol Get-NetIsatapConfiguration Get-NetLbfoTeam
Get-NetLbfoTeamMember Get-NetLbfoTeamNic Get-NetNat Get-NetNatExternalAddress
Get-NetNatGlobal Get-NetNatSession Get-NetNatStaticMapping
Get-NetNatTransitionConfiguration Get-NetNatTransitionMonitoring
Get-NetNeighbor Get-NetOffloadGlobalSetting Get-NetPrefixPolicy
Get-NetQosPolicy Get-NetRoute Get-NetSwitchTeam Get-NetSwitchTeamMember
Get-NetTCPConnection Get-NetTCPSetting Get-NetTeredoConfiguration
Get-NetTeredoState Get-NetTransportFilter Get-NetUDPEndpoint Get-NetUDPSetting
Get-NetworkSwitchEthernetPort Get-NetworkSwitchFeature
Get-NetworkSwitchGlobalData Get-NetworkSwitchVlan Get-NfsClientConfiguration
Get-NfsClientgroup Get-NfsClientLock Get-NfsMappingStore Get-NfsMountedClient
Get-NfsNetgroupStore Get-NfsOpenFile Get-NfsServerConfiguration Get-NfsSession
Get-NfsShare Get-NfsSharePermission Get-NfsStatistics Get-OdbcDriver
Get-OdbcDsn Get-OdbcPerfCounter Get-OffloadDataTransferSetting Get-Partition
Get-PartitionSupportedSize Get-PcsvDevice Get-PcsvDeviceLog Get-PhysicalDisk
Get-PhysicalDiskStorageNodeView Get-PhysicalExtent
Get-PhysicalExtentAssociation Get-PlatformIdentifier Get-PnpDevice
Get-PnpDeviceProperty Get-PrintConfiguration Get-Printer Get-PrinterDriver
Get-PrinterPort Get-PrinterProperty Get-PrintJob Get-RDAvailableApp
Get-RDCertificate Get-RDConnectionBrokerHighAvailability
Get-RDDeploymentGatewayConfiguration Get-RDFileTypeAssociation
Get-RDLicenseConfiguration Get-RDPersonalSessionDesktopAssignment
Get-RDPersonalVirtualDesktopAssignment
Get-RDPersonalVirtualDesktopPatchSchedule Get-RDRemoteApp Get-RDRemoteDesktop
Get-RDServer Get-RDSessionCollection Get-RDSessionCollectionConfiguration
Get-RDSessionHost Get-RDUserSession Get-RDVirtualDesktop
Get-RDVirtualDesktopCollection Get-RDVirtualDesktopCollectionConfiguration
Get-RDVirtualDesktopCollectionJobStatus Get-RDVirtualDesktopConcurrency
Get-RDVirtualDesktopIdleCount Get-RDVirtualDesktopTemplateExportPath
Get-RDWorkspace Get-ResiliencySetting Get-ScheduledTask Get-ScheduledTaskInfo
Get-SilComputer Get-SilComputerIdentity Get-SilData Get-SilLogging
Get-SilSoftware Get-SilUalAccess Get-SilWindowsUpdate Get-SmbBandWidthLimit
Get-SmbClientConfiguration Get-SmbClientNetworkInterface Get-SmbConnection
Get-SmbDelegation Get-SmbMapping Get-SmbMultichannelConnection
Get-SmbMultichannelConstraint Get-SmbOpenFile Get-SmbServerConfiguration
Get-SmbServerNetworkInterface Get-SmbSession Get-SmbShare Get-SmbShareAccess
Get-SmbWitnessClient Get-SMCounterSample Get-SMPerformanceCollector
Get-SMServerBpaResult Get-SMServerClusterName Get-SMServerEvent
Get-SMServerFeature Get-SMServerInventory Get-SMServerService Get-StartApps
Get-StorageAdvancedProperty Get-StorageDiagnosticInfo Get-StorageEnclosure
Get-StorageEnclosureStorageNodeView Get-StorageEnclosureVendorData
Get-StorageFaultDomain Get-StorageFileServer Get-StorageFirmwareInformation
Get-StorageHealthAction Get-StorageHealthReport Get-StorageHealthSetting
Get-StorageJob Get-StorageNode Get-StoragePool Get-StorageProvider
Get-StorageReliabilityCounter Get-StorageSetting Get-StorageSubSystem
Get-StorageTier Get-StorageTierSupportedSize Get-SupportedClusterSizes
Get-SupportedFileSystems Get-TargetPort Get-TargetPortal Get-Ual
Get-UalDailyAccess Get-UalDailyDeviceAccess Get-UalDailyUserAccess
Get-UalDeviceAccess Get-UalDns Get-UalHyperV Get-UalOverview
Get-UalServerDevice Get-UalServerUser Get-UalSystemId Get-UalUserAccess
Get-VirtualDisk Get-VirtualDiskSupportedSize Get-Volume
Get-VolumeCorruptionCount Get-VolumeScrubPolicy Get-VpnConnection
Get-VpnConnectionTrigger Get-WdacBidTrace Get-WindowsFeature
Get-WindowsUpdateLog Grant-FileShareAccess Grant-NfsSharePermission
Grant-RDOUAccess Grant-SmbShareAccess Hide-VirtualDisk Import-BCCachePackage
Import-BCSecretKey Import-IscsiTargetServerConfiguration Import-IseSnippet
Import-PowerShellDataFile Import-RDPersonalSessionDesktopAssignment
Import-RDPersonalVirtualDesktopAssignment Initialize-Disk Install-Dtc
Install-WindowsFeature Invoke-AsWorkflow Invoke-RDUserLogoff Mount-DiskImage
Move-RDVirtualDesktop Move-SmbWitnessClient New-AutologgerConfig
New-DAEntryPointTableItem New-DscChecksum New-EapConfiguration
New-EtwTraceSession New-FileShare New-Guid New-IscsiTargetPortal New-IseSnippet
New-MaskingSet New-NetAdapterAdvancedProperty New-NetEventSession
New-NetFirewallRule New-NetIPAddress New-NetIPHttpsConfiguration
New-NetIPsecDospSetting New-NetIPsecMainModeCryptoSet New-NetIPsecMainModeRule
New-NetIPsecPhase1AuthSet New-NetIPsecPhase2AuthSet
New-NetIPsecQuickModeCryptoSet New-NetIPsecRule New-NetLbfoTeam New-NetNat
New-NetNatTransitionConfiguration New-NetNeighbor New-NetQosPolicy New-NetRoute
New-NetSwitchTeam New-NetTransportFilter New-NetworkSwitchVlan
New-NfsClientgroup New-NfsShare New-Partition New-PSWorkflowSession
New-RDCertificate New-RDPersonalVirtualDesktopPatchSchedule New-RDRemoteApp
New-RDSessionCollection New-RDSessionDeployment New-RDVirtualDesktopCollection
New-RDVirtualDesktopDeployment New-ScheduledTask New-ScheduledTaskAction
New-ScheduledTaskPrincipal New-ScheduledTaskSettingsSet
New-ScheduledTaskTrigger New-SmbMapping New-SmbMultichannelConstraint
New-SmbShare New-StorageFileServer New-StoragePool
New-StorageSubsystemVirtualDisk New-StorageTier New-TemporaryFile
New-VirtualDisk New-VirtualDiskClone New-VirtualDiskSnapshot New-Volume
New-VpnServerAddress Open-NetGPO Optimize-StoragePool Optimize-Volume
Publish-BCFileContent Publish-BCWebContent Publish-SilData Read-PrinterNfcTag
Register-ClusteredScheduledTask Register-DnsClient Register-IscsiSession
Register-ScheduledTask Register-StorageSubsystem Remove-AutologgerConfig
Remove-BCDataCacheExtension Remove-DAEntryPointTableItem
Remove-DnsClientNrptRule Remove-DscConfigurationDocument
Remove-DtcClusterTMMapping Remove-EtwTraceProvider Remove-EtwTraceSession
Remove-FileShare Remove-InitiatorId Remove-InitiatorIdFromMaskingSet
Remove-IscsiTargetPortal Remove-MaskingSet Remove-MpPreference Remove-MpThreat
Remove-NetAdapterAdvancedProperty Remove-NetEventNetworkAdapter
Remove-NetEventPacketCaptureProvider Remove-NetEventProvider
Remove-NetEventSession Remove-NetEventVFPProvider
Remove-NetEventVmNetworkAdapter Remove-NetEventVmSwitch
Remove-NetEventVmSwitchProvider Remove-NetEventWFPCaptureProvider
Remove-NetFirewallRule Remove-NetIPAddress Remove-NetIPHttpsCertBinding
Remove-NetIPHttpsConfiguration Remove-NetIPsecDospSetting
Remove-NetIPsecMainModeCryptoSet Remove-NetIPsecMainModeRule
Remove-NetIPsecMainModeSA Remove-NetIPsecPhase1AuthSet
Remove-NetIPsecPhase2AuthSet Remove-NetIPsecQuickModeCryptoSet
Remove-NetIPsecQuickModeSA Remove-NetIPsecRule Remove-NetLbfoTeam
Remove-NetLbfoTeamMember Remove-NetLbfoTeamNic Remove-NetNat
Remove-NetNatExternalAddress Remove-NetNatStaticMapping
Remove-NetNatTransitionConfiguration Remove-NetNeighbor Remove-NetQosPolicy
Remove-NetRoute Remove-NetSwitchTeam Remove-NetSwitchTeamMember
Remove-NetTransportFilter Remove-NetworkSwitchEthernetPortIPAddress
Remove-NetworkSwitchVlan Remove-NfsClientgroup Remove-NfsShare Remove-OdbcDsn
Remove-Partition Remove-PartitionAccessPath Remove-PhysicalDisk Remove-Printer
Remove-PrinterDriver Remove-PrinterPort Remove-PrintJob
Remove-RDDatabaseConnectionString Remove-RDPersonalSessionDesktopAssignment
Remove-RDPersonalVirtualDesktopAssignment
Remove-RDPersonalVirtualDesktopPatchSchedule Remove-RDRemoteApp Remove-RDServer
Remove-RDSessionCollection Remove-RDSessionHost
Remove-RDVirtualDesktopCollection Remove-RDVirtualDesktopFromCollection
Remove-SmbBandwidthLimit Remove-SmbMapping Remove-SmbMultichannelConstraint
Remove-SmbShare Remove-SMServerPerformanceLog Remove-StorageFileServer
Remove-StorageHealthSetting Remove-StoragePool Remove-StorageTier
Remove-TargetPortFromMaskingSet Remove-VirtualDisk
Remove-VirtualDiskFromMaskingSet Remove-VpnConnection Remove-VpnConnectionRoute
Remove-VpnConnectionTriggerApplication
Remove-VpnConnectionTriggerDnsConfiguration
Remove-VpnConnectionTriggerTrustedNetwork Rename-DAEntryPointTableItem
Rename-MaskingSet Rename-NetAdapter Rename-NetFirewallRule
Rename-NetIPHttpsConfiguration Rename-NetIPsecMainModeCryptoSet
Rename-NetIPsecMainModeRule Rename-NetIPsecPhase1AuthSet
Rename-NetIPsecPhase2AuthSet Rename-NetIPsecQuickModeCryptoSet
Rename-NetIPsecRule Rename-NetLbfoTeam Rename-NetSwitchTeam
Rename-NfsClientgroup Rename-Printer Repair-FileIntegrity Repair-VirtualDisk
Repair-Volume Reset-BC Reset-DAClientExperienceConfiguration
Reset-DAEntryPointTableItem Reset-DtcLog Reset-NCSIPolicyConfiguration
Reset-Net6to4Configuration Reset-NetAdapterAdvancedProperty
Reset-NetDnsTransitionConfiguration Reset-NetIPHttpsConfiguration
Reset-NetIsatapConfiguration Reset-NetTeredoConfiguration Reset-NfsStatistics
Reset-PhysicalDisk Reset-StorageReliabilityCounter Resize-Partition
Resize-StorageTier Resize-VirtualDisk Resolve-NfsMappedIdentity
Restart-NetAdapter Restart-PcsvDevice Restart-PrintJob Restore-DscConfiguration
Restore-NetworkSwitchConfiguration Resume-PrintJob Revoke-FileShareAccess
Revoke-NfsClientLock Revoke-NfsMountedClient Revoke-NfsOpenFile
Revoke-NfsSharePermission Revoke-SmbShareAccess Save-NetGPO
Save-NetworkSwitchConfiguration Send-EtwTraceSession Send-RDUserMessage
Set-AssignedAccess Set-AutologgerConfig Set-BCAuthentication Set-BCCache
Set-BCDataCacheEntryMaxAge Set-BCMinSMBLatency Set-BCSecretKey
Set-ClusteredScheduledTask Set-DAClientExperienceConfiguration
Set-DAEntryPointTableItem Set-Disk Set-DisplayResolution Set-DnsClient
Set-DnsClientGlobalSetting Set-DnsClientNrptGlobal Set-DnsClientNrptRule
Set-DnsClientServerAddress Set-DtcAdvancedHostSetting Set-DtcAdvancedSetting
Set-DtcClusterDefault Set-DtcClusterTMMapping Set-DtcDefault Set-DtcLog
Set-DtcNetworkSetting Set-DtcTransaction Set-DtcTransactionsTraceSession
Set-DtcTransactionsTraceSetting Set-EtwTraceProvider Set-EtwTraceSession
Set-FileIntegrity Set-FileShare Set-FileStorageTier Set-InitiatorPort
Set-IscsiChapSecret Set-LogProperties Set-MMAgent Set-MpPreference
Set-NCSIPolicyConfiguration Set-Net6to4Configuration Set-NetAdapter
Set-NetAdapterAdvancedProperty Set-NetAdapterBinding
Set-NetAdapterChecksumOffload Set-NetAdapterEncapsulatedPacketTaskOffload
Set-NetAdapterIPsecOffload Set-NetAdapterLso Set-NetAdapterPacketDirect
Set-NetAdapterPowerManagement Set-NetAdapterQos Set-NetAdapterRdma
Set-NetAdapterRsc Set-NetAdapterRss Set-NetAdapterSriov Set-NetAdapterVmq
Set-NetConnectionProfile Set-NetDnsTransitionConfiguration
Set-NetEventPacketCaptureProvider Set-NetEventProvider Set-NetEventSession
Set-NetEventVFPProvider Set-NetEventVmSwitchProvider
Set-NetEventWFPCaptureProvider Set-NetFirewallAddressFilter
Set-NetFirewallApplicationFilter Set-NetFirewallInterfaceFilter
Set-NetFirewallInterfaceTypeFilter Set-NetFirewallPortFilter
Set-NetFirewallProfile Set-NetFirewallRule Set-NetFirewallSecurityFilter
Set-NetFirewallServiceFilter Set-NetFirewallSetting Set-NetIPAddress
Set-NetIPHttpsConfiguration Set-NetIPInterface Set-NetIPsecDospSetting
Set-NetIPsecMainModeCryptoSet Set-NetIPsecMainModeRule
Set-NetIPsecPhase1AuthSet Set-NetIPsecPhase2AuthSet
Set-NetIPsecQuickModeCryptoSet Set-NetIPsecRule Set-NetIPv4Protocol
Set-NetIPv6Protocol Set-NetIsatapConfiguration Set-NetLbfoTeam
Set-NetLbfoTeamMember Set-NetLbfoTeamNic Set-NetNat Set-NetNatGlobal
Set-NetNatTransitionConfiguration Set-NetNeighbor Set-NetOffloadGlobalSetting
Set-NetQosPolicy Set-NetRoute Set-NetTCPSetting Set-NetTeredoConfiguration
Set-NetUDPSetting Set-NetworkSwitchEthernetPortIPAddress
Set-NetworkSwitchPortMode Set-NetworkSwitchPortProperty
Set-NetworkSwitchVlanProperty Set-NfsClientConfiguration Set-NfsClientgroup
Set-NfsMappingStore Set-NfsNetgroupStore Set-NfsServerConfiguration
Set-NfsShare Set-OdbcDriver Set-OdbcDsn Set-Partition
Set-PcsvDeviceBootConfiguration Set-PcsvDeviceNetworkConfiguration
Set-PcsvDeviceUserPassword Set-PhysicalDisk Set-PrintConfiguration Set-Printer
Set-PrinterProperty Set-RDActiveManagementServer Set-RDCertificate
Set-RDClientAccessName Set-RDConnectionBrokerHighAvailability
Set-RDDatabaseConnectionString Set-RDDeploymentGatewayConfiguration
Set-RDFileTypeAssociation Set-RDLicenseConfiguration
Set-RDPersonalSessionDesktopAssignment Set-RDPersonalVirtualDesktopAssignment
Set-RDPersonalVirtualDesktopPatchSchedule Set-RDRemoteApp Set-RDRemoteDesktop
Set-RDSessionCollectionConfiguration Set-RDSessionHost
Set-RDVirtualDesktopCollectionConfiguration Set-RDVirtualDesktopConcurrency
Set-RDVirtualDesktopIdleCount Set-RDVirtualDesktopTemplateExportPath
Set-RDWorkspace Set-ResiliencySetting Set-ScheduledTask Set-SilLogging
Set-SmbBandwidthLimit Set-SmbClientConfiguration Set-SmbPathAcl
Set-SmbServerConfiguration Set-SmbShare Set-StorageFileServer
Set-StorageHealthSetting Set-StoragePool Set-StorageProvider Set-StorageSetting
Set-StorageSubSystem Set-StorageTier Set-VirtualDisk Set-Volume
Set-VolumeScrubPolicy Set-VpnConnection Set-VpnConnectionIPsecConfiguration
Set-VpnConnectionProxy Set-VpnConnectionTriggerDnsConfiguration
Set-VpnConnectionTriggerTrustedNetwork Show-NetFirewallRule Show-NetIPsecRule
Show-VirtualDisk Start-AppBackgroundTask Start-AppvVirtualProcess
Start-AutologgerConfig Start-Dtc Start-DtcTransactionsTraceSession Start-MpScan
Start-MpWDOScan Start-NetEventSession Start-PcsvDevice Start-ScheduledTask
Start-SilLogging Start-SMPerformanceCollector Start-StorageDiagnosticLog
Start-Trace Stop-DscConfiguration Stop-Dtc Stop-DtcTransactionsTraceSession
Stop-NetEventSession Stop-PcsvDevice Stop-RDVirtualDesktopCollectionJob
Stop-ScheduledTask Stop-SilLogging Stop-SMPerformanceCollector
Stop-StorageDiagnosticLog Stop-StorageJob Stop-Trace Suspend-PrintJob
Sync-NetIPsecRule Test-Dtc Test-NetConnection Test-NfsMappingStore
Test-RDOUAccess Test-RDVirtualDesktopADMachineAccountReuse
Unblock-FileShareAccess Unblock-SmbShareAccess Uninstall-Dtc
Uninstall-WindowsFeature Unregister-AppBackgroundTask
Unregister-ClusteredScheduledTask Unregister-IscsiSession
Unregister-ScheduledTask Unregister-StorageSubsystem Update-Disk
Update-DscConfiguration Update-HostStorageCache Update-IscsiTarget
Update-IscsiTargetPortal Update-MpSignature Update-NetIPsecRule
Update-RDVirtualDesktopCollection Update-SmbMultichannelConnection
Update-StorageFirmware Update-StoragePool Update-StorageProviderCache
Write-DtcTransactionsTraceSession Write-PrinterNfcTag Write-VolumeCache
Add-ADCentralAccessPolicyMember Add-ADComputerServiceAccount
Add-ADDomainControllerPasswordReplicationPolicy
Add-ADFineGrainedPasswordPolicySubject Add-ADGroupMember
Add-ADPrincipalGroupMembership Add-ADResourcePropertyListMember
Add-AppvClientConnectionGroup Add-AppvClientPackage Add-AppvPublishingServer
Add-AppxPackage Add-AppxProvisionedPackage Add-AppxVolume Add-BitsFile
Add-CertificateEnrollmentPolicyServer Add-ClusteriSCSITargetServerRole
Add-Computer Add-Content Add-IscsiVirtualDiskTargetMapping Add-JobTrigger
Add-KdsRootKey Add-LocalGroupMember Add-Member Add-SignerRule Add-Type
Add-WebConfiguration Add-WebConfigurationLock Add-WebConfigurationProperty
Add-WindowsCapability Add-WindowsDriver Add-WindowsImage Add-WindowsPackage
Backup-AuditPolicy Backup-SecurityPolicy Backup-WebConfiguration
Checkpoint-Computer Checkpoint-IscsiVirtualDisk Clear-ADAccountExpiration
Clear-ADClaimTransformLink Clear-Content Clear-EventLog
Clear-IISCentralCertProvider Clear-IISConfigCollection Clear-Item
Clear-ItemProperty Clear-KdsCache Clear-RecycleBin Clear-Tpm
Clear-UevAppxPackage Clear-UevConfiguration Clear-Variable
Clear-WebCentralCertProvider Clear-WebConfiguration
Clear-WebRequestTracingSetting Clear-WebRequestTracingSettings
Clear-WindowsCorruptMountPoint Compare-Object Complete-BitsTransfer
Complete-DtcDiagnosticTransaction Complete-Transaction Confirm-SecureBootUEFI
Connect-WSMan ConvertFrom-CIPolicy ConvertFrom-Csv ConvertFrom-Json
ConvertFrom-SecureString ConvertFrom-String ConvertFrom-StringData
Convert-IscsiVirtualDisk Convert-Path Convert-String ConvertTo-Csv
ConvertTo-Html ConvertTo-Json ConvertTo-SecureString ConvertTo-TpmOwnerAuth
ConvertTo-WebApplication ConvertTo-Xml Copy-Item Copy-ItemProperty
Debug-Process Debug-Runspace Disable-ADAccount Disable-ADOptionalFeature
Disable-AppBackgroundTaskDiagnosticLog Disable-Appv
Disable-AppvClientConnectionGroup Disable-ComputerRestore
Disable-IISCentralCertProvider Disable-IISSharedConfig Disable-JobTrigger
Disable-LocalUser Disable-PSBreakpoint Disable-RunspaceDebug
Disable-ScheduledJob Disable-TlsCipherSuite Disable-TlsEccCurve
Disable-TlsSessionTicketKey Disable-TpmAutoProvisioning Disable-Uev
Disable-UevAppxPackage Disable-UevTemplate Disable-WebCentralCertProvider
Disable-WebGlobalModule Disable-WebRequestTracing Disable-WindowsErrorReporting
Disable-WindowsOptionalFeature Disable-WSManCredSSP Disconnect-WSMan
Dismount-AppxVolume Dismount-IscsiVirtualDiskSnapshot Dismount-WindowsImage
Edit-CIPolicyRule Enable-ADAccount Enable-ADOptionalFeature
Enable-AppBackgroundTaskDiagnosticLog Enable-Appv
Enable-AppvClientConnectionGroup Enable-ComputerRestore
Enable-IISCentralCertProvider Enable-IISSharedConfig Enable-JobTrigger
Enable-LocalUser Enable-PSBreakpoint Enable-RunspaceDebug Enable-ScheduledJob
Enable-TlsCipherSuite Enable-TlsEccCurve Enable-TlsSessionTicketKey
Enable-TpmAutoProvisioning Enable-Uev Enable-UevAppxPackage Enable-UevTemplate
Enable-WebCentralCertProvider Enable-WebGlobalModule Enable-WebRequestTracing
Enable-WindowsErrorReporting Enable-WindowsOptionalFeature Enable-WSManCredSSP
Expand-WindowsCustomDataImage Expand-WindowsImage Export-Alias
Export-BinaryMiLog Export-Certificate Export-Clixml Export-Counter Export-Csv
Export-FormatData Export-IISConfiguration Export-IscsiVirtualDiskSnapshot
Export-PfxCertificate Export-PSSession Export-StartLayout
Export-TlsSessionTicketKey Export-UevConfiguration Export-UevPackage
Export-WindowsDriver Export-WindowsImage Format-Custom Format-List
Format-SecureBootUEFI Format-Table Format-Wide Get-Acl
Get-ADAccountAuthorizationGroup Get-ADAccountResultantPasswordReplicationPolicy
Get-ADAuthenticationPolicy Get-ADAuthenticationPolicySilo
Get-ADCentralAccessPolicy Get-ADCentralAccessRule Get-ADClaimTransformPolicy
Get-ADClaimType Get-ADComputer Get-ADComputerServiceAccount
Get-ADDCCloningExcludedApplicationList Get-ADDefaultDomainPasswordPolicy
Get-ADDomain Get-ADDomainController
Get-ADDomainControllerPasswordReplicationPolicy
Get-ADDomainControllerPasswordReplicationPolicyUsage
Get-ADFineGrainedPasswordPolicy Get-ADFineGrainedPasswordPolicySubject
Get-ADForest Get-ADGroup Get-ADGroupMember Get-ADObject Get-ADOptionalFeature
Get-ADOrganizationalUnit Get-ADPrincipalGroupMembership
Get-ADReplicationAttributeMetadata Get-ADReplicationConnection
Get-ADReplicationFailure Get-ADReplicationPartnerMetadata
Get-ADReplicationQueueOperation Get-ADReplicationSite Get-ADReplicationSiteLink
Get-ADReplicationSiteLinkBridge Get-ADReplicationSubnet
Get-ADReplicationUpToDatenessVectorTable Get-ADResourceProperty
Get-ADResourcePropertyList Get-ADResourcePropertyValueType Get-ADRootDSE
Get-ADServiceAccount Get-ADTrust Get-ADUser Get-ADUserResultantPasswordPolicy
Get-Alias Get-AppLockerFileInformation Get-AppLockerPolicy
Get-AppvClientApplication Get-AppvClientConfiguration
Get-AppvClientConnectionGroup Get-AppvClientMode Get-AppvClientPackage
Get-AppvPublishingServer Get-AppvStatus Get-AppxDefaultVolume Get-AppxPackage
Get-AppxPackageManifest Get-AppxProvisionedPackage Get-AppxVolume
Get-AuthenticodeSignature Get-BitsTransfer Get-BpaModel Get-BpaResult
Get-Certificate Get-CertificateAutoEnrollmentPolicy
Get-CertificateEnrollmentPolicyServer Get-CertificateNotificationTask
Get-ChildItem Get-CimAssociatedInstance Get-CimClass Get-CimInstance
Get-CimSession Get-CIPolicy Get-CIPolicyIdInfo Get-CIPolicyInfo Get-Clipboard
Get-CmsMessage Get-ComputerInfo Get-ComputerRestorePoint Get-Content
Get-ControlPanelItem Get-Counter Get-Credential Get-Culture Get-DAPolicyChange
Get-Date Get-Event Get-EventLog Get-EventSubscriber Get-ExecutionPolicy
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | true |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/tex.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/tex.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class TeX < RegexLexer
title "TeX"
desc "The TeX typesetting system"
tag 'tex'
aliases 'TeX', 'LaTeX', 'latex'
filenames '*.tex', '*.aux', '*.toc', '*.sty', '*.cls'
mimetypes 'text/x-tex', 'text/x-latex'
def self.detect?(text)
return true if text =~ /\A\s*\\(documentclass|input|documentstyle|relax|ProvidesPackage|ProvidesClass)/
end
command = /\\([a-z]+|\s+|.)/i
state :general do
rule /%.*$/, Comment
rule /[{}&_^]/, Punctuation
end
state :root do
rule /\\\[/, Punctuation, :displaymath
rule /\\\(/, Punctuation, :inlinemath
rule /\$\$/, Punctuation, :displaymath
rule /\$/, Punctuation, :inlinemath
rule /\\(begin|end)\{.*?\}/, Name::Tag
rule /(\\verb)\b(\S)(.*?)(\2)/ do |m|
groups Name::Builtin, Keyword::Pseudo, Str::Other, Keyword::Pseudo
end
rule command, Keyword, :command
mixin :general
rule /[^\\$%&_^{}]+/, Text
end
state :math do
rule command, Name::Variable
mixin :general
rule /[0-9]+/, Num
rule /[-=!+*\/()\[\]]/, Operator
rule /[^=!+*\/()\[\]\\$%&_^{}0-9-]+/, Name::Builtin
end
state :inlinemath do
rule /\\\)/, Punctuation, :pop!
rule /\$/, Punctuation, :pop!
mixin :math
end
state :displaymath do
rule /\\\]/, Punctuation, :pop!
rule /\$\$/, Punctuation, :pop!
rule /\$/, Name::Builtin
mixin :math
end
state :command do
rule /\[.*?\]/, Name::Attribute
rule /\*/, Keyword
rule(//) { pop! }
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/java.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/java.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Java < RegexLexer
title "Java"
desc "The Java programming language (java.com)"
tag 'java'
filenames '*.java'
mimetypes 'text/x-java'
keywords = %w(
assert break case catch continue default do else finally for
if goto instanceof new return switch this throw try while
)
declarations = %w(
abstract const enum extends final implements native private protected
public static strictfp super synchronized throws transient volatile
)
types = %w(boolean byte char double float int long short var void)
id = /[a-zA-Z_][a-zA-Z0-9_]*/
state :root do
rule /[^\S\n]+/, Text
rule %r(//.*?$), Comment::Single
rule %r(/\*.*?\*/)m, Comment::Multiline
# keywords: go before method names to avoid lexing "throw new XYZ"
# as a method signature
rule /(?:#{keywords.join('|')})\b/, Keyword
rule %r(
(\s*(?:[a-zA-Z_][a-zA-Z0-9_.\[\]<>]*\s+)+?) # return arguments
([a-zA-Z_][a-zA-Z0-9_]*) # method name
(\s*)(\() # signature start
)mx do |m|
# TODO: do this better, this shouldn't need a delegation
delegate Java, m[1]
token Name::Function, m[2]
token Text, m[3]
token Operator, m[4]
end
rule /@#{id}/, Name::Decorator
rule /(?:#{declarations.join('|')})\b/, Keyword::Declaration
rule /(?:#{types.join('|')})\b/, Keyword::Type
rule /package\b/, Keyword::Namespace
rule /(?:true|false|null)\b/, Keyword::Constant
rule /(?:class|interface)\b/, Keyword::Declaration, :class
rule /import\b/, Keyword::Namespace, :import
rule /"(\\\\|\\"|[^"])*"/, Str
rule /'(?:\\.|[^\\]|\\u[0-9a-f]{4})'/, Str::Char
rule /(\.)(#{id})/ do
groups Operator, Name::Attribute
end
rule /#{id}:/, Name::Label
rule /\$?#{id}/, Name
rule /[~^*!%&\[\](){}<>\|+=:;,.\/?-]/, Operator
digit = /[0-9]_+[0-9]|[0-9]/
bin_digit = /[01]_+[01]|[01]/
oct_digit = /[0-7]_+[0-7]|[0-7]/
hex_digit = /[0-9a-f]_+[0-9a-f]|[0-9a-f]/i
rule /#{digit}+\.#{digit}+([eE]#{digit}+)?[fd]?/, Num::Float
rule /0b#{bin_digit}+/i, Num::Bin
rule /0x#{hex_digit}+/i, Num::Hex
rule /0#{oct_digit}+/, Num::Oct
rule /#{digit}+L?/, Num::Integer
rule /\n/, Text
end
state :class do
rule /\s+/m, Text
rule id, Name::Class, :pop!
end
state :import do
rule /\s+/m, Text
rule /[a-z0-9_.]+\*?/i, Name::Namespace, :pop!
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/digdag.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/digdag.rb | # frozen_string_literal: true
require 'set'
module Rouge
module Lexers
load_lexer 'yaml.rb'
class Digdag < YAML
title 'digdag'
desc 'A simple, open source, multi-cloud workflow engine (https://www.digdag.io/)'
tag 'digdag'
filenames '*.dig'
mimetypes 'application/x-digdag'
# http://docs.digdag.io/operators.html
# as of digdag v0.9.10
KEYWORD_PATTERN = Regexp.union(%w(
call
require
loop
for_each
if
fail
echo
td
td_run
td_ddl
td_load
td_for_each
td_wait
td_wait_table
td_partial_delete
td_table_export
pg
mail
http
s3_wait
redshift
redshift_load
redshift_unload
emr
gcs_wait
bq
bq_ddl
bq_extract
bq_load
sh
py
rb
embulk
).map { |name| "#{name}>"} + %w(
_do
_parallel
))
prepend :block_nodes do
rule /(#{KEYWORD_PATTERN})(:)(?=\s|$)/ do |m|
groups Keyword::Reserved, Punctuation::Indicator
set_indent m[0], :implicit => true
end
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/tap.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/tap.rb | # frozen_string_literal: true
module Rouge
module Lexers
class Tap < RegexLexer
title 'TAP'
desc 'Test Anything Protocol'
tag 'tap'
aliases 'tap'
filenames '*.tap'
mimetypes 'text/x-tap', 'application/x-tap'
state :root do
# A TAP version may be specified.
rule /^TAP version \d+\n/, Name::Namespace
# Specify a plan with a plan line.
rule /^1\.\.\d+/, Keyword::Declaration, :plan
# A test failure
rule /^(not ok)([^\S\n]*)(\d*)/ do
groups Generic::Error, Text, Literal::Number::Integer
push :test
end
# A test success
rule /^(ok)([^\S\n]*)(\d*)/ do
groups Keyword::Reserved, Text, Literal::Number::Integer
push :test
end
# Diagnostics start with a hash.
rule /^#.*\n/, Comment
# TAP's version of an abort statement.
rule /^Bail out!.*\n/, Generic::Error
# # TAP ignores any unrecognized lines.
rule /^.*\n/, Text
end
state :plan do
# Consume whitespace (but not newline).
rule /[^\S\n]+/, Text
# A plan may have a directive with it.
rule /#/, Comment, :directive
# Or it could just end.
rule /\n/, Comment, :pop!
# Anything else is wrong.
rule /.*\n/, Generic::Error, :pop!
end
state :test do
# Consume whitespace (but not newline).
rule /[^\S\n]+/, Text
# A test may have a directive with it.
rule /#/, Comment, :directive
rule /\S+/, Text
rule /\n/, Text, :pop!
end
state :directive do
# Consume whitespace (but not newline).
rule /[^\S\n]+/, Comment
# Extract todo items.
rule /(?i)\bTODO\b/, Comment::Preproc
# Extract skip items.
rule /(?i)\bSKIP\S*/, Comment::Preproc
rule /\S+/, Comment
rule /\n/ do
token Comment
pop! 2
end
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/sieve.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/sieve.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Sieve < RegexLexer
title "Sieve"
desc "mail filtering language"
tag 'sieve'
filenames '*.sieve'
id = /:?[a-zA-Z_][a-zA-Z0-9_]*/
# control commands (rfc5228 § 3)
def self.controls
@controls ||= %w(if elsif else require stop)
end
def self.actions
@actions ||= Set.new(
# action commands (rfc5228 § 2.9)
%w(keep fileinto redirect discard) +
# Editheader Extension (rfc5293)
%w(addheader deleteheader) +
# Reject and Extended Reject Extensions (rfc5429)
%w(reject ereject) +
# Extension for Notifications (rfc5435)
%w(notify) +
# Imap4flags Extension (rfc5232)
%w(setflag addflag removeflag) +
# Vacation Extension (rfc5230)
%w(vacation) +
# MIME Part Tests, Iteration, Extraction, Replacement, and Enclosure (rfc5703)
%w(replace enclose extracttext)
)
end
def self.tests
@tests ||= Set.new(
# test commands (rfc5228 § 5)
%w(address allof anyof exists false header not size true) +
# Body Extension (rfc5173)
%w(body) +
# Imap4flags Extension (rfc5232)
%w(hasflag) +
# Spamtest and Virustest Extensions (rfc5235)
%w(spamtest virustest) +
# Date and Index Extensions (rfc5260)
%w(date currentdate) +
# Extension for Notifications (rfc5435)
%w(valid_notify_method notify_method_capability) +
# Extensions for Checking Mailbox Status and Accessing Mailbox
# Metadata (rfc5490)
%w(mailboxexists metadata metadataexists servermetadata servermetadataexists)
)
end
state :comments_and_whitespace do
rule /\s+/, Text
rule %r(#.*?\n), Comment::Single
rule %r(/(\\\n)?[*].*?[*](\\\n)?/)m, Comment::Multiline
end
state :string do
rule /\\./, Str::Escape
rule /"/, Str::Double, :pop!
# Variables Extension (rfc5229)
rule /\${(?:[0-9][.0-9]*|[a-zA-Z_][.a-zA-Z0-9_]*)}/, Str::Interpol
rule /./, Str::Double
end
state :root do
mixin :comments_and_whitespace
rule /[\[\](),;{}]/, Punctuation
rule id do |m|
if self.class.controls.include? m[0]
token Keyword
elsif self.class.tests.include? m[0]
token Name::Variable
elsif self.class.actions.include? m[0]
token Name::Function
elsif m[0] =~ /^:/ # tags like :contains, :matches etc.
token Operator
else
token Name::Other
end
end
rule /"/, Str::Double, :string
rule /[0-9]+[KMG]/, Num::Integer
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/protobuf.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/protobuf.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Protobuf < RegexLexer
title 'Protobuf'
desc 'Google\'s language-neutral, platform-neutral, extensible mechanism for serializing structured data'
tag 'protobuf'
aliases 'proto'
filenames '*.proto'
mimetypes 'text/x-proto'
kw = /\b(ctype|default|extensions|import|max|oneof|option|optional|packed|repeated|required|returns|rpc|to)\b/
datatype = /\b(bool|bytes|double|fixed32|fixed64|float|int32|int64|sfixed32|sfixed64|sint32|sint64|string|uint32|uint64)\b/
state :root do
rule /[\s]+/, Text
rule /[,;{}\[\]()]/, Punctuation
rule /\/(\\\n)?\/(\n|(.|\n)*?[^\\]\n)/, Comment::Single
rule /\/(\\\n)?\*(.|\n)*?\*(\\\n)?\//, Comment::Multiline
rule kw, Keyword
rule datatype, Keyword::Type
rule /true|false/, Keyword::Constant
rule /(package)(\s+)/ do
groups Keyword::Namespace, Text
push :package
end
rule /(message|extend)(\s+)/ do
groups Keyword::Declaration, Text
push :message
end
rule /(enum|group|service)(\s+)/ do
groups Keyword::Declaration, Text
push :type
end
rule /".*?"/, Str
rule /'.*?'/, Str
rule /(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*/, Num::Float
rule /(\d+\.\d*|\.\d+|\d+[fF])[fF]?/, Num::Float
rule /(\-?(inf|nan))\b/, Num::Float
rule /0x[0-9a-fA-F]+[LlUu]*/, Num::Hex
rule /0[0-7]+[LlUu]*/, Num::Oct
rule /\d+[LlUu]*/, Num::Integer
rule /[+-=]/, Operator
rule /([a-zA-Z_][\w.]*)([ \t]*)(=)/ do
groups Name::Attribute, Text, Operator
end
rule /[a-zA-Z_][\w.]*/, Name
end
state :package do
rule /[a-zA-Z_]\w*/, Name::Namespace, :pop!
rule(//) { pop! }
end
state :message do
rule /[a-zA-Z_]\w*/, Name::Class, :pop!
rule(//) { pop! }
end
state :type do
rule /[a-zA-Z_]\w*/, Name, :pop!
rule(//) { pop! }
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/tulip.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/tulip.rb | # frozen_string_literal: true
module Rouge
module Lexers
class Tulip < RegexLexer
desc 'the tulip programming language (twitter.com/tuliplang)'
tag 'tulip'
aliases 'tulip'
filenames '*.tlp'
mimetypes 'text/x-tulip', 'application/x-tulip'
def self.detect?(text)
return true if text.shebang? 'tulip'
end
id = /[a-z][\w-]*/i
upper_id = /[A-Z][\w-]*/
state :comments_and_whitespace do
rule /\s+/, Text
rule /#.*?$/, Comment
end
state :root do
mixin :comments_and_whitespace
rule /@#{id}/, Keyword
rule /(\\#{id})([{])/ do
groups Name::Function, Str
push :nested_string
end
rule /([+]#{id})([{])/ do
groups Name::Decorator, Str
push :nested_string
end
rule /\\#{id}/, Name::Function
rule /[+]#{id}/, Name::Decorator
rule /"[{]/, Str, :dqi
rule /"/, Str, :dq
rule /'{/, Str, :nested_string
rule /'#{id}/, Str
rule /[.]#{id}/, Name::Tag
rule /[$]#{id}?/, Name::Variable
rule /-#{id}:?/, Name::Label
rule /%#{id}/, Name::Function
rule /`#{id}/, Operator::Word
rule /[?~%._>,!\[\]:{}()=;\/-]/, Punctuation
rule /[0-9]+([.][0-9]+)?/, Num
rule /#{id}/, Name
rule /</, Comment::Preproc, :angle_brackets
end
state :dq do
rule /[^\\"]+/, Str
rule /"/, Str, :pop!
rule /\\./, Str::Escape
end
state :dqi do
rule /[$][(]/, Str::Interpol, :interp_root
rule /[{]/, Str, :dqi
rule /[}]/, Str, :pop!
rule /[^{}$]+/, Str
rule /./, Str
end
state :interp_root do
rule /[)]/, Str::Interpol, :pop!
mixin :interp
end
state :interp do
rule /[(]/, Punctuation, :interp
rule /[)]/, Punctuation, :pop!
mixin :root
end
state :nested_string do
rule /\\./, Str::Escape
rule(/{/) { token Str; push :nested_string }
rule(/}/) { token Str; pop! }
rule(/[^{}\\]+/) { token Str }
end
state :angle_brackets do
mixin :comments_and_whitespace
rule />/, Comment::Preproc, :pop!
rule /[*:]/, Punctuation
rule /#{upper_id}/, Keyword::Type
rule /#{id}/, Name::Variable
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/groovy.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/groovy.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Groovy < RegexLexer
title "Groovy"
desc 'The Groovy programming language (http://www.groovy-lang.org/)'
tag 'groovy'
filenames '*.groovy', 'Jenkinsfile'
mimetypes 'text/x-groovy'
ws = %r((?:\s|//.*?\n|/[*].*?[*]/)+)
def self.detect?(text)
return true if text.shebang?(/groovy/)
end
def self.keywords
@keywords ||= Set.new %w(
assert break case catch continue default do else finally for
if goto instanceof new return switch this throw try while in as
)
end
def self.declarations
@declarations ||= Set.new %w(
abstract const enum extends final implements native private
protected public static strictfp super synchronized throws
transient volatile
)
end
def self.types
@types ||= Set.new %w(
def boolean byte char double float int long short void
)
end
def self.constants
@constants ||= Set.new %w(true false null)
end
state :root do
rule %r(^
(\s*(?:\w[\w\d.\[\]]*\s+)+?) # return arguments
(\w[\w\d]*) # method name
(\s*) (\() # signature start
)x do |m|
delegate self.clone, m[1]
token Name::Function, m[2]
token Text, m[3]
token Operator, m[4]
end
# whitespace
rule /[^\S\n]+/, Text
rule %r(//.*?$), Comment::Single
rule %r(/[*].*?[*]/)m, Comment::Multiline
rule /@\w[\w\d.]*/, Name::Decorator
rule /(class|interface|trait)\b/, Keyword::Declaration, :class
rule /package\b/, Keyword::Namespace, :import
rule /import\b/, Keyword::Namespace, :import
# TODO: highlight backslash escapes
rule /""".*?"""/m, Str::Double
rule /'''.*?'''/m, Str::Single
rule /"(\\.|\\\n|.)*?"/, Str::Double
rule /'(\\.|\\\n|.)*?'/, Str::Single
rule %r(\$/(\$.|.)*?/\$)m, Str
rule %r(/(\\.|\\\n|.)*?/), Str
rule /'\\.'|'[^\\]'|'\\u[0-9a-f]{4}'/, Str::Char
rule /(\.)([a-zA-Z_][a-zA-Z0-9_]*)/ do
groups Operator, Name::Attribute
end
rule /[a-zA-Z_][a-zA-Z0-9_]*:/, Name::Label
rule /[a-zA-Z_\$][a-zA-Z0-9_]*/ do |m|
if self.class.keywords.include? m[0]
token Keyword
elsif self.class.declarations.include? m[0]
token Keyword::Declaration
elsif self.class.types.include? m[0]
token Keyword::Type
elsif self.class.constants.include? m[0]
token Keyword::Constant
else
token Name
end
end
rule %r([~^*!%&\[\](){}<>\|+=:;,./?-]), Operator
# numbers
rule /\d+\.\d+([eE]\d+)?[fd]?/, Num::Float
rule /0x[0-9a-f]+/, Num::Hex
rule /[0-9]+L?/, Num::Integer
rule /\n/, Text
end
state :class do
rule /\s+/, Text
rule /\w[\w\d]*/, Name::Class, :pop!
end
state :import do
rule /\s+/, Text
rule /[\w\d.]+[*]?/, Name::Namespace, :pop!
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/twig.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/twig.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
load_lexer 'jinja.rb'
class Twig < Jinja
title "Twig"
desc "Twig template engine (twig.sensiolabs.org)"
tag "twig"
filenames '*.twig'
mimetypes 'application/x-twig', 'text/html+twig'
def self.keywords
@@keywords ||= %w(as do extends flush from import include use else starts
ends with without autoescape endautoescape block endblock
embed endembed filter endfilter for endfor if endif
macro endmacro sandbox endsandbox set endset
spaceless endspaceless verbatim endverbatim)
end
def self.tests
@@tests ||= %w(constant defined divisibleby empty even iterable null odd
sameas)
end
def self.pseudo_keywords
@@pseudo_keywords ||= %w(true false none)
end
def self.word_operators
@@word_operators ||= %w(b-and b-or b-xor is in and or not)
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/shell.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/shell.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Shell < RegexLexer
title "shell"
desc "Various shell languages, including sh and bash"
tag 'shell'
aliases 'bash', 'zsh', 'ksh', 'sh'
filenames '*.sh', '*.bash', '*.zsh', '*.ksh',
'.bashrc', '.zshrc', '.kshrc', '.profile', 'PKGBUILD'
mimetypes 'application/x-sh', 'application/x-shellscript'
def self.detect?(text)
return true if text.shebang?(/(ba|z|k)?sh/)
end
KEYWORDS = %w(
if fi else while do done for then return function
select continue until esac elif in
).join('|')
BUILTINS = %w(
alias bg bind break builtin caller cd command compgen
complete declare dirs disown enable eval exec exit
export false fc fg getopts hash help history jobs let
local logout mapfile popd pushd pwd read readonly set
shift shopt source suspend test time times trap true type
typeset ulimit umask unalias unset wait
cat tac nl od base32 base64 fmt pr fold head tail split csplit
wc sum cksum b2sum md5sum sha1sum sha224sum sha256sum sha384sum
sha512sum sort shuf uniq comm ptx tsort cut paste join tr expand
unexpand ls dir vdir dircolors cp dd install mv rm shred link ln
mkdir mkfifo mknod readlink rmdir unlink chown chgrp chmod touch
df du stat sync truncate echo printf yes expr tee basename dirname
pathchk mktemp realpath pwd stty printenv tty id logname whoami
groups users who date arch nproc uname hostname hostid uptime chcon
runcon chroot env nice nohup stdbuf timeout kill sleep factor numfmt
seq tar grep sudo awk sed gzip gunzip
).join('|')
state :basic do
rule /#.*$/, Comment
rule /\b(#{KEYWORDS})\s*\b/, Keyword
rule /\bcase\b/, Keyword, :case
rule /\b(#{BUILTINS})\s*\b(?!(\.|-))/, Name::Builtin
rule /[.](?=\s)/, Name::Builtin
rule /(\b\w+)(=)/ do |m|
groups Name::Variable, Operator
end
rule /[\[\]{}()!=>]/, Operator
rule /&&|\|\|/, Operator
# here-string
rule /<<</, Operator
rule /(<<-?)(\s*)(\'?)(\\?)(\w+)(\3)/ do |m|
groups Operator, Text, Str::Heredoc, Str::Heredoc, Name::Constant, Str::Heredoc
@heredocstr = Regexp.escape(m[5])
push :heredoc
end
end
state :heredoc do
rule /\n/, Str::Heredoc, :heredoc_nl
rule /[^$\n]+/, Str::Heredoc
mixin :interp
rule /[$]/, Str::Heredoc
end
state :heredoc_nl do
rule /\s*(\w+)\s*\n/ do |m|
if m[1] == @heredocstr
token Name::Constant
pop! 2
else
token Str::Heredoc
end
end
rule(//) { pop! }
end
state :double_quotes do
# NB: "abc$" is literally the string abc$.
# Here we prevent :interp from interpreting $" as a variable.
rule /(?:\$#?)?"/, Str::Double, :pop!
mixin :interp
rule /[^"`\\$]+/, Str::Double
end
state :ansi_string do
rule /\\./, Str::Escape
rule /[^\\']+/, Str::Single
mixin :single_quotes
end
state :single_quotes do
rule /'/, Str::Single, :pop!
rule /[^']+/, Str::Single
end
state :data do
rule /\s+/, Text
rule /\\./, Str::Escape
rule /\$?"/, Str::Double, :double_quotes
rule /\$'/, Str::Single, :ansi_string
# single quotes are much easier than double quotes - we can
# literally just scan until the next single quote.
# POSIX: Enclosing characters in single-quotes ( '' )
# shall preserve the literal value of each character within the
# single-quotes. A single-quote cannot occur within single-quotes.
rule /'/, Str::Single, :single_quotes
rule /\*/, Keyword
rule /;/, Punctuation
rule /--?[\w-]+/, Name::Tag
rule /[^=\*\s{}()$"'`;\\<]+/, Text
rule /\d+(?= |\Z)/, Num
rule /</, Text
mixin :interp
end
state :curly do
rule /}/, Keyword, :pop!
rule /:-/, Keyword
rule /[a-zA-Z0-9_]+/, Name::Variable
rule /[^}:"`'$]+/, Punctuation
mixin :root
end
state :paren do
rule /\)/, Keyword, :pop!
mixin :root
end
state :math do
rule /\)\)/, Keyword, :pop!
rule %r([-+*/%^|&!]|\*\*|\|\|), Operator
rule /\d+(#\w+)?/, Num
mixin :root
end
state :case do
rule /\besac\b/, Keyword, :pop!
rule /\|/, Punctuation
rule /\)/, Punctuation, :case_stanza
mixin :root
end
state :case_stanza do
rule /;;/, Punctuation, :pop!
mixin :root
end
state :backticks do
rule /`/, Str::Backtick, :pop!
mixin :root
end
state :interp do
rule /\\$/, Str::Escape # line continuation
rule /\\./, Str::Escape
rule /\$\(\(/, Keyword, :math
rule /\$\(/, Keyword, :paren
rule /\${#?/, Keyword, :curly
rule /`/, Str::Backtick, :backticks
rule /\$#?(\w+|.)/, Name::Variable
rule /\$[*@]/, Name::Variable
end
state :root do
mixin :basic
mixin :data
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/markdown.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/markdown.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Markdown < RegexLexer
title "Markdown"
desc "Markdown, a light-weight markup language for authors"
tag 'markdown'
aliases 'md', 'mkd'
filenames '*.markdown', '*.md', '*.mkd'
mimetypes 'text/x-markdown'
def html
@html ||= HTML.new(options)
end
start { html.reset! }
edot = /\\.|[^\\\n]/
state :root do
# YAML frontmatter
rule(/\A(---\s*\n.*?\n?)^(---\s*$\n?)/m) { delegate YAML }
rule /\\./, Str::Escape
rule /^[\S ]+\n(?:---*)\n/, Generic::Heading
rule /^[\S ]+\n(?:===*)\n/, Generic::Subheading
rule /^#(?=[^#]).*?$/, Generic::Heading
rule /^##*.*?$/, Generic::Subheading
rule /(\n[ \t]*)(```|~~~)(.*?)(\n.*?\n)(\2)/m do |m|
sublexer = Lexer.find_fancy(m[3].strip, m[4], @options)
sublexer ||= PlainText.new(@options.merge(:token => Str::Backtick))
sublexer.reset!
token Text, m[1]
token Punctuation, m[2]
token Name::Label, m[3]
delegate sublexer, m[4]
token Punctuation, m[5]
end
rule /\n\n(( |\t).*?\n|\n)+/, Str::Backtick
rule /(`+)(?:#{edot}|\n)+?\1/, Str::Backtick
# various uses of * are in order of precedence
# line breaks
rule /^(\s*[*]){3,}\s*$/, Punctuation
rule /^(\s*[-]){3,}\s*$/, Punctuation
# bulleted lists
rule /^\s*[*+-](?=\s)/, Punctuation
# numbered lists
rule /^\s*\d+\./, Punctuation
# blockquotes
rule /^\s*>.*?$/, Generic::Traceback
# link references
# [foo]: bar "baz"
rule %r(^
(\s*) # leading whitespace
(\[) (#{edot}+?) (\]) # the reference
(\s*) (:) # colon
)x do
groups Text, Punctuation, Str::Symbol, Punctuation, Text, Punctuation
push :title
push :url
end
# links and images
rule /(!?\[)(#{edot}*?)(\])/ do
groups Punctuation, Name::Variable, Punctuation
push :link
end
rule /[*][*]#{edot}*?[*][*]/, Generic::Strong
rule /__#{edot}*?__/, Generic::Strong
rule /[*]#{edot}*?[*]/, Generic::Emph
rule /_#{edot}*?_/, Generic::Emph
# Automatic links
rule /<.*?@.+[.].+>/, Name::Variable
rule %r[<(https?|mailto|ftp)://#{edot}*?>], Name::Variable
rule /[^\\`\[*\n&<]+/, Text
# inline html
rule(/&\S*;/) { delegate html }
rule(/<#{edot}*?>/) { delegate html }
rule /[&<]/, Text
rule /\n/, Text
end
state :link do
rule /(\[)(#{edot}*?)(\])/ do
groups Punctuation, Str::Symbol, Punctuation
pop!
end
rule /[(]/ do
token Punctuation
push :inline_title
push :inline_url
end
rule /[ \t]+/, Text
rule(//) { pop! }
end
state :url do
rule /[ \t]+/, Text
# the url
rule /(<)(#{edot}*?)(>)/ do
groups Name::Tag, Str::Other, Name::Tag
pop!
end
rule /\S+/, Str::Other, :pop!
end
state :title do
rule /"#{edot}*?"/, Name::Namespace
rule /'#{edot}*?'/, Name::Namespace
rule /[(]#{edot}*?[)]/, Name::Namespace
rule /\s*(?=["'()])/, Text
rule(//) { pop! }
end
state :inline_title do
rule /[)]/, Punctuation, :pop!
mixin :title
end
state :inline_url do
rule /[^<\s)]+/, Str::Other, :pop!
rule /\s+/m, Text
mixin :url
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/coq.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/coq.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Coq < RegexLexer
title "Coq"
desc 'Coq (coq.inria.fr)'
tag 'coq'
mimetypes 'text/x-coq'
def self.gallina
@gallina ||= Set.new %w(
as fun if in let match then else return end Type Set Prop
forall
)
end
def self.coq
@coq ||= Set.new %w(
Definition Theorem Lemma Remark Example Fixpoint CoFixpoint
Record Inductive CoInductive Corollary Goal Proof
Ltac Require Import Export Module Section End Variable
Context Polymorphic Monomorphic Universe Universes
Variables Class Instance Global Local Include
Printing Notation Infix Arguments Hint Rewrite Immediate
Qed Defined Opaque Transparent Existing
Compute Eval Print SearchAbout Search About Check
)
end
def self.ltac
@ltac ||= Set.new %w(
apply eapply auto eauto rewrite setoid_rewrite
with in as at destruct split inversion injection
intro intros unfold fold cbv cbn lazy subst
clear symmetry transitivity etransitivity erewrite
edestruct constructor econstructor eexists exists
f_equal refine instantiate revert simpl
specialize generalize dependent red induction
beta iota zeta delta exfalso autorewrite setoid_rewrite
compute vm_compute native_compute
)
end
def self.tacticals
@tacticals ||= Set.new %w(
repeat first try
)
end
def self.terminators
@terminators ||= Set.new %w(
omega solve congruence reflexivity exact
assumption eassumption
)
end
def self.keyopts
@keyopts ||= Set.new %w(
:= => -> /\\ \\/ _ ; :> :
)
end
def self.end_sentence
@end_sentence ||= Punctuation::Indicator
end
def self.classify(x)
if self.coq.include? x
return Keyword
elsif self.gallina.include? x
return Keyword::Reserved
elsif self.ltac.include? x
return Keyword::Pseudo
elsif self.terminators.include? x
return Name::Exception
elsif self.tacticals.include? x
return Keyword::Pseudo
else
return Name::Constant
end
end
operator = %r([\[\];,{}_()!$%&*+./:<=>?@^|~#-]+)
id = /(?:[a-z][\w']*)|(?:[_a-z][\w']+)/i
dot_id = /\.((?:[a-z][\w']*)|(?:[_a-z][\w']+))/i
dot_space = /\.(\s+)/
module_type = /Module(\s+)Type(\s+)/
set_options = /(Set|Unset)(\s+)(Universe|Printing|Implicit|Strict)(\s+)(Polymorphism|All|Notations|Arguments|Universes|Implicit)(\s*)\./m
state :root do
rule /[(][*](?![)])/, Comment, :comment
rule /\s+/m, Text::Whitespace
rule module_type do |m|
token Keyword , 'Module'
token Text::Whitespace , m[1]
token Keyword , 'Type'
token Text::Whitespace , m[2]
end
rule set_options do |m|
token Keyword , m[1]
i = 2
while m[i] != ''
token Text::Whitespace , m[i]
token Keyword , m[i+1]
i += 2
end
token self.class.end_sentence , '.'
end
rule id do |m|
@name = m[0]
@continue = false
push :continue_id
end
rule /\/\\/, Operator
rule /\\\//, Operator
rule operator do |m|
match = m[0]
if self.class.keyopts.include? match
token Punctuation
else
token Operator
end
end
rule /-?\d[\d_]*(.[\d_]*)?(e[+-]?\d[\d_]*)/i, Num::Float
rule /\d[\d_]*/, Num::Integer
rule /'(?:(\\[\\"'ntbr ])|(\\[0-9]{3})|(\\x\h{2}))'/, Str::Char
rule /'/, Keyword
rule /"/, Str::Double, :string
rule /[~?]#{id}/, Name::Variable
end
state :comment do
rule /[^(*)]+/, Comment
rule(/[(][*]/) { token Comment; push }
rule /[*][)]/, Comment, :pop!
rule /[(*)]/, Comment
end
state :string do
rule /[^\\"]+/, Str::Double
mixin :escape_sequence
rule /\\\n/, Str::Double
rule /"/, Str::Double, :pop!
end
state :escape_sequence do
rule /\\[\\"'ntbr]/, Str::Escape
end
state :continue_id do
# the stream starts with an id (stored in @name) and continues here
rule dot_id do |m|
token Name::Namespace , @name
token Punctuation , '.'
@continue = true
@name = m[1]
end
rule dot_space do |m|
if @continue
token Name::Constant , @name
else
token self.class.classify(@name) , @name
end
token self.class.end_sentence , '.'
token Text::Whitespace , m[1]
@name = false
@continue = false
pop!
end
rule // do
if @continue
token Name::Constant , @name
else
token self.class.classify(@name) , @name
end
@name = false
@continue = false
pop!
end
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/jsp.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/jsp.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class JSP < TemplateLexer
desc 'JSP'
tag 'jsp'
filenames '*.jsp'
mimetypes 'text/x-jsp', 'application/x-jsp'
def initialize(*)
super
@java = Java.new
end
directives = %w(page include taglib)
actions = %w(scriptlet declaration expression)
state :root do
rule /<%--/, Comment, :jsp_comment
rule /<%@\s*(#{directives.join('|')})\s*/, Name::Tag, :jsp_directive
rule /<jsp:directive\.(#{directives.join('|')})/, Name::Tag, :jsp_directive2
rule /<jsp:(#{actions.join('|')})>/, Name::Tag, :jsp_expression
# start of tag, e.g. <c:if>
rule /<[a-zA-Z]*:[a-zA-Z]*\s*/, Name::Tag, :jsp_tag
# end of tag, e.g. </c:if>
rule /<\/[a-zA-Z]*:[a-zA-Z]*>/, Name::Tag
rule /<%[!=]?/, Name::Tag, :jsp_expression2
# fallback to HTML
rule(/(.+?)(?=(<%|<\/?[a-zA-Z]*:))/m) { delegate parent }
rule(/.+/m) { delegate parent }
end
state :jsp_comment do
rule /(--%>)/, Comment, :pop!
rule /./m, Comment
end
state :jsp_directive do
rule /(%>)/, Name::Tag, :pop!
mixin :attributes
rule(/(.+?)(?=%>)/m) { delegate parent }
end
state :jsp_directive2 do
rule /(\/>)/, Name::Tag, :pop!
mixin :attributes
rule(/(.+?)(?=\/>)/m) { delegate parent }
end
state :jsp_expression do
rule /<\/jsp:(#{actions.join('|')})>/, Name::Tag, :pop!
mixin :attributes
rule(/[^<\/]+/) { delegate @java }
end
state :jsp_expression2 do
rule /%>/, Name::Tag, :pop!
rule(/[^%>]+/) { delegate @java }
end
state :jsp_tag do
rule /\/?>/, Name::Tag, :pop!
mixin :attributes
rule(/(.+?)(?=\/?>)/m) { delegate parent }
end
state :attributes do
rule /\s*[a-zA-Z0-9_:-]+\s*=\s*/m, Name::Attribute, :attr
end
state :attr do
rule /"/ do
token Str
goto :double_quotes
end
rule /'/ do
token Str
goto :single_quotes
end
rule /[^\s>]+/, Str, :pop!
end
state :double_quotes do
rule /"/, Str, :pop!
rule /\$\{/, Str::Interpol, :jsp_interp
rule /[^"]+/, Str
end
state :single_quotes do
rule /'/, Str, :pop!
rule /\$\{/, Str::Interpol, :jsp_interp
rule /[^']+/, Str
end
state :jsp_interp do
rule /\}/, Str::Interpol, :pop!
rule /'/, Literal, :jsp_interp_literal_start
rule(/[^'\}]+/) { delegate @java }
end
state :jsp_interp_literal_start do
rule /'/, Literal, :pop!
rule /[^']*/, Literal
end
end
end
end | ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/plain_text.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/plain_text.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class PlainText < Lexer
title "Plain Text"
desc "A boring lexer that doesn't highlight anything"
tag 'plaintext'
aliases 'text'
filenames '*.txt'
mimetypes 'text/plain'
attr_reader :token
def initialize(*)
super
@token = token_option(:token) || Text
end
def stream_tokens(string, &b)
yield self.token, string
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/nim.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/nim.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Nim < RegexLexer
# This is pretty much a 1-1 port of the pygments NimrodLexer class
title "Nim"
desc "The Nim programming language (http://nim-lang.org/)"
tag 'nim'
aliases 'nimrod'
filenames '*.nim'
KEYWORDS = %w(
addr as asm atomic bind block break case cast const continue
converter defer discard distinct do elif else end enum except export
func finally for from generic if import include interface iterator let
macro method mixin nil object of out proc ptr raise ref return static
template try tuple type using var when while with without yield
)
OPWORDS = %w(
and or not xor shl shr div mod in notin is isnot
)
PSEUDOKEYWORDS = %w(
nil true false
)
TYPES = %w(
int int8 int16 int32 int64 float float32 float64 bool char range array
seq set string
)
NAMESPACE = %w(
from import include
)
def self.underscorize(words)
words.map do |w|
w.gsub(/./) { |x| "#{Regexp.escape(x)}_?" }
end.join('|')
end
state :chars do
rule(/\\([\\abcefnrtvl"\']|x[a-fA-F0-9]{2}|[0-9]{1,3})/, Str::Escape)
rule(/'/, Str::Char, :pop!)
rule(/./, Str::Char)
end
state :strings do
rule(/(?<!\$)\$(\d+|#|\w+)+/, Str::Interpol)
rule(/[^\\\'"\$\n]+/, Str)
rule(/[\'"\\]/, Str)
rule(/\$/, Str)
end
state :dqs do
rule(/\\([\\abcefnrtvl"\']|\n|x[a-fA-F0-9]{2}|[0-9]{1,3})/,
Str::Escape)
rule(/"/, Str, :pop!)
mixin :strings
end
state :rdqs do
rule(/"(?!")/, Str, :pop!)
rule(/"/, Str::Escape, :pop!)
mixin :strings
end
state :tdqs do
rule(/"""(?!")/, Str, :pop!)
mixin :strings
mixin :nl
end
state :funcname do
rule(/((?![\d_])\w)(((?!_)\w)|(_(?!_)\w))*/, Name::Function, :pop!)
rule(/`.+`/, Name::Function, :pop!)
end
state :nl do
rule(/\n/, Str)
end
state :floatnumber do
rule(/\.(?!\.)[0-9_]*/, Num::Float)
rule(/[eE][+-]?[0-9][0-9_]*/, Num::Float)
rule(//, Text, :pop!)
end
# Making apostrophes optional, as only hexadecimal with type suffix
# possibly ambiguous.
state :floatsuffix do
rule(/'?[fF](32|64)/, Num::Float)
rule(//, Text, :pop!)
end
state :intsuffix do
rule(/'?[iI](32|64)/, Num::Integer::Long)
rule(/'?[iI](8|16)/, Num::Integer)
rule(/'?[uU]/, Num::Integer)
rule(//, Text, :pop!)
end
state :root do
rule(/##.*$/, Str::Doc)
rule(/#.*$/, Comment)
rule(/\*|=|>|<|\+|-|\/|@|\$|~|&|%|\!|\?|\||\\|\[|\]/, Operator)
rule(/\.\.|\.|,|\[\.|\.\]|{\.|\.}|\(\.|\.\)|{|}|\(|\)|:|\^|`|;/,
Punctuation)
# Strings
rule(/(?:[\w]+)"/,Str, :rdqs)
rule(/"""/, Str, :tdqs)
rule(/"/, Str, :dqs)
# Char
rule(/'/, Str::Char, :chars)
# Keywords
rule(%r[(#{Nim.underscorize(OPWORDS)})\b], Operator::Word)
rule(/(p_?r_?o_?c_?\s)(?![\(\[\]])/, Keyword, :funcname)
rule(%r[(#{Nim.underscorize(KEYWORDS)})\b], Keyword)
rule(%r[(#{Nim.underscorize(NAMESPACE)})\b], Keyword::Namespace)
rule(/(v_?a_?r)\b/, Keyword::Declaration)
rule(%r[(#{Nim.underscorize(TYPES)})\b], Keyword::Type)
rule(%r[(#{Nim.underscorize(PSEUDOKEYWORDS)})\b], Keyword::Pseudo)
# Identifiers
rule(/\b((?![_\d])\w)(((?!_)\w)|(_(?!_)\w))*/, Name)
# Numbers
# Note: Have to do this with a block to push multiple states first,
# since we can't pass array of states like w/ Pygments.
rule(/[0-9][0-9_]*(?=([eE.]|'?[fF](32|64)))/) do |number|
push :floatsuffix
push :floatnumber
token Num::Float
end
rule(/0[xX][a-fA-F0-9][a-fA-F0-9_]*/, Num::Hex, :intsuffix)
rule(/0[bB][01][01_]*/, Num, :intsuffix)
rule(/0o[0-7][0-7_]*/, Num::Oct, :intsuffix)
rule(/[0-9][0-9_]*/, Num::Integer, :intsuffix)
# Whitespace
rule(/\s+/, Text)
rule(/.+$/, Error)
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/gradle.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/gradle.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
load_lexer 'groovy.rb'
class Gradle < Groovy
title "Gradle"
desc "A powerful build system for the JVM"
tag 'gradle'
filenames '*.gradle'
mimetypes 'text/x-gradle'
def self.keywords
@keywords ||= super + Set.new(%w(
allprojects artifacts buildscript configuration dependencies
repositories sourceSets subprojects publishing
))
end
def self.types
@types ||= super + Set.new(%w(
Project Task Gradle Settings Script JavaToolChain SourceSet
SourceSetOutput IncrementalTaskInputs Configuration
ResolutionStrategy ArtifactResolutionQuery ComponentSelection
ComponentSelectionRules ConventionProperty ExtensionAware
ExtraPropertiesExtension PublishingExtension IvyPublication
IvyArtifact IvyArtifactSet IvyModuleDescriptorSpec
MavenPublication MavenArtifact MavenArtifactSet MavenPom
PluginDependenciesSpec PluginDependencySpec ResourceHandler
TextResourceFactory
))
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/conf.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/conf.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Conf < RegexLexer
tag 'conf'
aliases 'config', 'configuration'
title "Config File"
desc 'A generic lexer for configuration files'
filenames '*.conf', '*.config'
# short and sweet
state :root do
rule /#.*?\n/, Comment
rule /".*?"/, Str::Double
rule /'.*?'/, Str::Single
rule /[a-z]\w*/i, Name
rule /\d+/, Num
rule /[^\d\w#"']+/, Text
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/prometheus.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/prometheus.rb | # frozen_string_literal: true
module Rouge
module Lexers
class Prometheus < RegexLexer
desc 'prometheus'
tag 'prometheus'
aliases 'prometheus'
filenames '*.prometheus'
mimetypes 'text/x-prometheus', 'application/x-prometheus'
def self.functions
@functions ||= Set.new %w(
abs absent ceil changes clamp_max clamp_min count_scalar day_of_month
day_of_week days_in_month delta deriv drop_common_labels exp floor
histogram_quantile holt_winters hour idelta increase irate label_replace
ln log2 log10 month predict_linear rate resets round scalar sort
sort_desc sqrt time vector year avg_over_time min_over_time
max_over_time sum_over_time count_over_time quantile_over_time
stddev_over_time stdvar_over_time
)
end
state :root do
mixin :strings
mixin :whitespace
rule /-?\d+\.\d+/, Num::Float
rule /-?\d+[smhdwy]?/, Num::Integer
mixin :operators
rule /(ignoring|on)(\()/ do
groups Keyword::Pseudo, Punctuation
push :label_list
end
rule /(group_left|group_right)(\()/ do
groups Keyword::Type, Punctuation
end
rule /(bool|offset)\b/, Keyword
rule /(without|by)\b/, Keyword, :label_list
rule /[\w:]+/ do |m|
if self.class.functions.include?(m[0])
token Name::Builtin
else
token Name
end
end
mixin :metrics
end
state :metrics do
rule /[a-zA-Z0-9_-]+/, Name
rule /[\(\)\]:.,]/, Punctuation
rule /\{/, Punctuation, :filters
rule /\[/, Punctuation
end
state :strings do
rule /"/, Str::Double, :double_string_escaped
rule /'/, Str::Single, :single_string_escaped
rule /`.*`/, Str::Backtick
end
[
[:double, Str::Double, '"'],
[:single, Str::Single, "'"]
].each do |name, tok, fin|
state :"#{name}_string_escaped" do
rule /\\[\\abfnrtv#{fin}]/, Str::Escape
rule /[^\\#{fin}]+/m, tok
rule /#{fin}/, tok, :pop!
end
end
state :filters do
mixin :inline_whitespace
rule /,/, Punctuation
mixin :labels
mixin :filter_matching_operators
mixin :strings
rule /}/, Punctuation, :pop!
end
state :label_list do
rule /\(/, Punctuation
rule /[a-zA-Z0-9_:-]+/, Name::Attribute
rule /,/, Punctuation
mixin :whitespace
rule /\)/, Punctuation, :pop!
end
state :labels do
rule /[a-zA-Z0-9_:-]+/, Name::Attribute
end
state :operators do
rule %r([+\-\*/%\^]), Operator # Arithmetic
rule %r(=|==|!=|<|>|<=|>=), Operator # Comparison
rule /and|or|unless/, Operator # Logical/Set
rule /(sum|min|max|avg|stddev|stdvar|count|count_values|bottomk|topk)\b/, Name::Function
end
state :filter_matching_operators do
rule /!(=|~)|=~?/, Operator
end
state :inline_whitespace do
rule /[ \t\r]+/, Text
end
state :whitespace do
mixin :inline_whitespace
rule /\n\s*/m, Text
rule /#.*?$/, Comment
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/csharp.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/csharp.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class CSharp < RegexLexer
tag 'csharp'
aliases 'c#', 'cs'
filenames '*.cs'
mimetypes 'text/x-csharp'
title "C#"
desc 'a multi-paradigm language targeting .NET'
# TODO: support more of unicode
id = /@?[_a-z]\w*/i
#Reserved Identifiers
#Contextual Keywords
#LINQ Query Expressions
keywords = %w(
abstract as base break case catch checked const continue
default delegate do else enum event explicit extern false
finally fixed for foreach goto if implicit in interface
internal is lock new null operator out override params private
protected public readonly ref return sealed sizeof stackalloc
static switch this throw true try typeof unchecked unsafe
virtual void volatile while
add alias async await get global partial remove set value where
yield nameof
ascending by descending equals from group in into join let on
orderby select
)
keywords_type = %w(
bool byte char decimal double dynamic float int long object
sbyte short string uint ulong ushort var
)
cpp_keywords = %w(
if endif else elif define undef line error warning region
endregion pragma
)
state :whitespace do
rule /\s+/m, Text
rule %r(//.*?$), Comment::Single
rule %r(/[*].*?[*]/)m, Comment::Multiline
end
state :nest do
rule /{/, Punctuation, :nest
rule /}/, Punctuation, :pop!
mixin :root
end
state :splice_string do
rule /\\./, Str
rule /{/, Punctuation, :nest
rule /"|\n/, Str, :pop!
rule /./, Str
end
state :splice_literal do
rule /""/, Str
rule /{/, Punctuation, :nest
rule /"/, Str, :pop!
rule /./, Str
end
state :root do
mixin :whitespace
rule /^\s*\[.*?\]/, Name::Attribute
rule /[$]\s*"/, Str, :splice_string
rule /[$]@\s*"/, Str, :splice_literal
rule /(<\[)\s*(#{id}:)?/, Keyword
rule /\]>/, Keyword
rule /[~!%^&*()+=|\[\]{}:;,.<>\/?-]/, Punctuation
rule /@"(""|[^"])*"/m, Str
rule /"(\\.|.)*?["\n]/, Str
rule /'(\\.|.)'/, Str::Char
rule /0x[0-9a-f]+[lu]?/i, Num
rule %r(
[0-9]
([.][0-9]*)? # decimal
(e[+-][0-9]+)? # exponent
[fldu]? # type
)ix, Num
rule /\b(?:class|struct|interface)\b/, Keyword, :class
rule /\b(?:namespace|using)\b/, Keyword, :namespace
rule /^#[ \t]*(#{cpp_keywords.join('|')})\b.*?\n/,
Comment::Preproc
rule /\b(#{keywords.join('|')})\b/, Keyword
rule /\b(#{keywords_type.join('|')})\b/, Keyword::Type
rule /#{id}(?=\s*[(])/, Name::Function
rule id, Name
end
state :class do
mixin :whitespace
rule id, Name::Class, :pop!
end
state :namespace do
mixin :whitespace
rule /(?=[(])/, Text, :pop!
rule /(#{id}|[.])+/, Name::Namespace, :pop!
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/erb.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/erb.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class ERB < TemplateLexer
title "ERB"
desc "Embedded ruby template files"
tag 'erb'
aliases 'eruby', 'rhtml'
filenames '*.erb', '*.erubis', '*.rhtml', '*.eruby'
def initialize(opts={})
@ruby_lexer = Ruby.new(opts)
super(opts)
end
start do
parent.reset!
@ruby_lexer.reset!
end
open = /<%%|<%=|<%#|<%-|<%/
close = /%%>|-%>|%>/
state :root do
rule /<%#/, Comment, :comment
rule open, Comment::Preproc, :ruby
rule /.+?(?=#{open})|.+/m do
delegate parent
end
end
state :comment do
rule close, Comment, :pop!
rule /.+?(?=#{close})|.+/m, Comment
end
state :ruby do
rule close, Comment::Preproc, :pop!
rule /.+?(?=#{close})|.+/m do
delegate @ruby_lexer
end
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/haml.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/haml.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
# A lexer for the Haml templating system for Ruby.
# @see http://haml.info
class Haml < RegexLexer
include Indentation
title "Haml"
desc "The Haml templating system for Ruby (haml.info)"
tag 'haml'
aliases 'HAML'
filenames '*.haml'
mimetypes 'text/x-haml'
option 'filters[filter_name]', 'Mapping of lexers to use for haml :filters'
attr_reader :filters
# @option opts :filters
# A hash of filter name to lexer of how various filters should be
# highlighted. By default, :javascript, :css, :ruby, and :erb
# are supported.
def initialize(opts={})
super
default_filters = {
'javascript' => Javascript.new(options),
'css' => CSS.new(options),
'ruby' => ruby,
'erb' => ERB.new(options),
'markdown' => Markdown.new(options),
'sass' => Sass.new(options),
# TODO
# 'textile' => Textile.new(options),
# 'maruku' => Maruku.new(options),
}
@filters = hash_option(:filters, default_filters) do |v|
as_lexer(v) || PlainText.new(@options)
end
end
def ruby
@ruby ||= Ruby.new(@options)
end
def html
@html ||= HTML.new(@options)
end
def ruby!(state)
ruby.reset!
push state
end
start { ruby.reset!; html.reset! }
identifier = /[\w:-]+/
ruby_var = /[a-z]\w*/
# Haml can include " |\n" anywhere,
# which is ignored and used to wrap long lines.
# To accomodate this, use this custom faux dot instead.
dot = /[ ]\|\n(?=.*[ ]\|)|./
# In certain places, a comma at the end of the line
# allows line wrapping as well.
comma_dot = /,\s*\n|#{dot}/
state :root do
rule /\s*\n/, Text
rule(/\s*/) { |m| token Text; indentation(m[0]) }
end
state :content do
mixin :css
rule(/%#{identifier}/) { token Name::Tag; goto :tag }
rule /!!!#{dot}*\n/, Name::Namespace, :pop!
rule %r(
(/) (\[#{dot}*?\]) (#{dot}*\n)
)x do
groups Comment, Comment::Special, Comment
pop!
end
rule %r(/#{dot}*\n) do
token Comment
pop!
starts_block :html_comment_block
end
rule /-##{dot}*\n/ do
token Comment
pop!
starts_block :haml_comment_block
end
rule /-/ do
token Punctuation
reset_stack
ruby! :ruby_line
end
# filters
rule /:(#{dot}*)\n/ do |m|
token Name::Decorator
pop!
starts_block :filter_block
filter_name = m[1].strip
@filter_lexer = self.filters[filter_name]
@filter_lexer.reset! unless @filter_lexer.nil?
puts " haml: filter #{filter_name.inspect} #{@filter_lexer.inspect}" if @debug
end
mixin :eval_or_plain
end
state :css do
rule(/\.#{identifier}/) { token Name::Class; goto :tag }
rule(/##{identifier}/) { token Name::Function; goto :tag }
end
state :tag do
mixin :css
rule(/[{]/) { token Punctuation; ruby! :ruby_tag }
rule(/\[#{dot}*?\]/) { delegate ruby }
rule /\(/, Punctuation, :html_attributes
rule /\s*\n/, Text, :pop!
# whitespace chompers
rule /[<>]{1,2}(?=[ \t=])/, Punctuation
mixin :eval_or_plain
end
state :plain do
rule(/([^#\n]|#[^{\n]|(\\\\)*\\#\{)+/) { delegate html }
mixin :interpolation
rule(/\n/) { token Text; reset_stack }
end
state :eval_or_plain do
rule /[&!]?==/, Punctuation, :plain
rule /[&!]?[=!]/ do
token Punctuation
reset_stack
ruby! :ruby_line
end
rule(//) { push :plain }
end
state :ruby_line do
rule /\n/, Text, :pop!
rule(/,[ \t]*\n/) { delegate ruby }
rule /[ ]\|[ \t]*\n/, Str::Escape
rule(/.*?(?=(,$| \|)?[ \t]*$)/) { delegate ruby }
end
state :ruby_tag do
mixin :ruby_inner
end
state :html_attributes do
rule /\s+/, Text
rule /#{identifier}\s*=/, Name::Attribute, :html_attribute_value
rule identifier, Name::Attribute
rule /\)/, Text, :pop!
end
state :html_attribute_value do
rule /\s+/, Text
rule ruby_var, Name::Variable, :pop!
rule /@#{ruby_var}/, Name::Variable::Instance, :pop!
rule /\$#{ruby_var}/, Name::Variable::Global, :pop!
rule /'(\\\\|\\'|[^'\n])*'/, Str, :pop!
rule /"(\\\\|\\"|[^"\n])*"/, Str, :pop!
end
state :html_comment_block do
rule /#{dot}+/, Comment
mixin :indented_block
end
state :haml_comment_block do
rule /#{dot}+/, Comment::Preproc
mixin :indented_block
end
state :filter_block do
rule /([^#\n]|#[^{\n]|(\\\\)*\\#\{)+/ do
if @filter_lexer
delegate @filter_lexer
else
token Name::Decorator
end
end
mixin :interpolation
mixin :indented_block
end
state :interpolation do
rule /#[{]/, Str::Interpol, :ruby
end
state :ruby do
rule /[}]/, Str::Interpol, :pop!
mixin :ruby_inner
end
state :ruby_inner do
rule(/[{]/) { delegate ruby; push :ruby_inner }
rule(/[}]/) { delegate ruby; pop! }
rule(/[^{}]+/) { delegate ruby }
end
state :indented_block do
rule(/\n/) { token Text; reset_stack }
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/graphql.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/graphql.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class GraphQL < RegexLexer
desc 'GraphQL'
tag 'graphql'
filenames '*.graphql', '*.gql'
mimetypes 'application/graphql'
name = /[_A-Za-z][_0-9A-Za-z]*/
state :root do
rule /\b(?:query|mutation|subscription)\b/, Keyword, :query_definition
rule /\{/ do
token Punctuation
push :query_definition
push :selection_set
end
rule /\bfragment\b/, Keyword, :fragment_definition
rule /\b(?:type|interface|enum)\b/, Keyword, :type_definition
rule /\b(?:input|schema)\b/, Keyword, :type_definition
rule /\bunion\b/, Keyword, :union_definition
mixin :basic
end
state :basic do
rule /\s+/m, Text::Whitespace
rule /#.*$/, Comment
rule /[!,]/, Punctuation
end
state :has_directives do
rule /(@#{name})(\s*)(\()/ do
groups Keyword, Text::Whitespace, Punctuation
push :arguments
end
rule /@#{name}\b/, Keyword
end
state :fragment_definition do
rule /\bon\b/, Keyword
mixin :query_definition
end
state :query_definition do
mixin :has_directives
rule /\b#{name}\b/, Name
rule /\(/, Punctuation, :variable_definitions
rule /\{/, Punctuation, :selection_set
mixin :basic
end
state :type_definition do
rule /\bimplements\b/, Keyword
rule /\b#{name}\b/, Name
rule /\(/, Punctuation, :variable_definitions
rule /\{/, Punctuation, :type_definition_set
mixin :basic
end
state :union_definition do
rule /\b#{name}\b/, Name
rule /\=/, Punctuation, :union_definition_variant
mixin :basic
end
state :union_definition_variant do
rule /\b#{name}\b/ do
token Name
pop!
push :union_definition_pipe
end
mixin :basic
end
state :union_definition_pipe do
rule /\|/ do
token Punctuation
pop!
push :union_definition_variant
end
rule /(?!\||\s+|#[^\n]*)/ do
pop! 2
end
mixin :basic
end
state :type_definition_set do
rule /\}/ do
token Punctuation
pop! 2
end
rule /\b(#{name})(\s*)(\()/ do
groups Name, Text::Whitespace, Punctuation
push :variable_definitions
end
rule /\b#{name}\b/, Name
rule /:/, Punctuation, :type_names
mixin :basic
end
state :arguments do
rule /\)/ do
token Punctuation
pop!
end
rule /\b#{name}\b/, Name
rule /:/, Punctuation, :value
mixin :basic
end
state :variable_definitions do
rule /\)/ do
token Punctuation
pop!
end
rule /\$#{name}\b/, Name::Variable
rule /\b#{name}\b/, Name
rule /:/, Punctuation, :type_names
rule /\=/, Punctuation, :value
mixin :basic
end
state :type_names do
rule /\b(?:Int|Float|String|Boolean|ID)\b/, Name::Builtin, :pop!
rule /\b#{name}\b/, Name, :pop!
rule /\[/, Punctuation, :type_name_list
mixin :basic
end
state :type_name_list do
rule /\b(?:Int|Float|String|Boolean|ID)\b/, Name::Builtin
rule /\b#{name}\b/, Name
rule /\]/ do
token Punctuation
pop! 2
end
mixin :basic
end
state :selection_set do
mixin :has_directives
rule /\}/ do
token Punctuation
pop!
pop! if state?(:query_definition) || state?(:fragment_definition)
end
rule /\b(#{name})(\s*)(\()/ do
groups Name, Text::Whitespace, Punctuation
push :arguments
end
rule /\b(#{name})(\s*)(:)/ do
groups Name, Text::Whitespace, Punctuation
end
rule /\b#{name}\b/, Name
rule /(\.\.\.)(\s+)(on)\b/ do
groups Punctuation, Text::Whitespace, Keyword
end
rule /\.\.\./, Punctuation
rule /\{/, Punctuation, :selection_set
mixin :basic
end
state :list do
rule /\]/ do
token Punctuation
pop!
pop! if state?(:value)
end
mixin :value
end
state :object do
rule /\}/ do
token Punctuation
pop!
pop! if state?(:value)
end
rule /\b(#{name})(\s*)(:)/ do
groups Name, Text::Whitespace, Punctuation
push :value
end
mixin :basic
end
state :value do
pop_unless_list = ->(t) {
->(m) {
token t
pop! unless state?(:list)
}
}
rule /\$#{name}\b/, &pop_unless_list[Name::Variable]
rule /\b(?:true|false|null)\b/, &pop_unless_list[Keyword::Constant]
rule /[+-]?[0-9]+\.[0-9]+(?:[eE][+-]?[0-9]+)?/, &pop_unless_list[Num::Float]
rule /[+-]?[1-9][0-9]*(?:[eE][+-]?[0-9]+)?/, &pop_unless_list[Num::Integer]
rule /"(\\[\\"]|[^"])*"/, &pop_unless_list[Str::Double]
rule /\b#{name}\b/, &pop_unless_list[Name]
rule /\{/, Punctuation, :object
rule /\[/, Punctuation, :list
mixin :basic
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/scss.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/scss.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
load_lexer 'sass/common.rb'
class Scss < SassCommon
title "SCSS"
desc "SCSS stylesheets (sass-lang.com)"
tag 'scss'
filenames '*.scss'
mimetypes 'text/x-scss'
state :root do
rule /\s+/, Text
rule %r(//.*?$), Comment::Single
rule %r(/[*].*?[*]/)m, Comment::Multiline
rule /@import\b/, Keyword, :value
mixin :content_common
rule(/(?=[^;{}][;}])/) { push :attribute }
rule(/(?=[^;{}:\[]+:[^a-z])/) { push :attribute }
rule(//) { push :selector }
end
state :end_section do
rule /\n/, Text
rule(/[;{}]/) { token Punctuation; reset_stack }
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/praat.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/praat.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Praat < RegexLexer
title "Praat"
desc "The Praat scripting language (praat.org)"
tag 'praat'
filenames '*.praat', '*.proc', '*.psc'
def self.detect?(text)
return true if text.shebang? 'praat'
end
keywords = %w(
if then else elsif elif endif fi for from to endfor endproc while
endwhile repeat until select plus minus demo assert stopwatch
nocheck nowarn noprogress editor endeditor clearinfo
)
functions_string = %w(
backslashTrigraphsToUnicode chooseDirectory chooseReadFile
chooseWriteFile date demoKey do environment extractLine extractWord
fixed info left mid percent readFile replace replace_regex right
selected string unicodeToBackslashTrigraphs
)
functions_numeric = %w(
abs appendFile appendFileLine appendInfo appendInfoLine arccos arccosh
arcsin arcsinh arctan arctan2 arctanh barkToHertz beginPause
beginSendPraat besselI besselK beta beta2 binomialP binomialQ boolean
ceiling chiSquareP chiSquareQ choice comment cos cosh createDirectory
deleteFile demoClicked demoClickedIn demoCommandKeyPressed
demoExtraControlKeyPressed demoInput demoKeyPressed
demoOptionKeyPressed demoShiftKeyPressed demoShow demoWaitForInput
demoWindowTitle demoX demoY differenceLimensToPhon do editor endPause
endSendPraat endsWith erb erbToHertz erf erfc exitScript exp
extractNumber fileReadable fisherP fisherQ floor gaussP gaussQ hash
hertzToBark hertzToErb hertzToMel hertzToSemitones imax imin
incompleteBeta incompleteGammaP index index_regex integer invBinomialP
invBinomialQ invChiSquareQ invFisherQ invGaussQ invSigmoid invStudentQ
length ln lnBeta lnGamma log10 log2 max melToHertz min minusObject
natural number numberOfColumns numberOfRows numberOfSelected
objectsAreIdentical option optionMenu pauseScript
phonToDifferenceLimens plusObject positive randomBinomial randomGauss
randomInteger randomPoisson randomUniform real readFile removeObject
rindex rindex_regex round runScript runSystem runSystem_nocheck
selectObject selected semitonesToHertz sentence sentencetext sigmoid
sin sinc sincpi sinh soundPressureToPhon sqrt startsWith studentP
studentQ tan tanh text variableExists word writeFile writeFileLine
writeInfo writeInfoLine
)
functions_array = %w(
linear randomGauss randomInteger randomUniform zero
)
objects = %w(
Activation AffineTransform AmplitudeTier Art Artword Autosegment
BarkFilter BarkSpectrogram CCA Categories Cepstrogram Cepstrum
Cepstrumc ChebyshevSeries ClassificationTable Cochleagram Collection
ComplexSpectrogram Configuration Confusion ContingencyTable Corpus
Correlation Covariance CrossCorrelationTable CrossCorrelationTableList
CrossCorrelationTables DTW DataModeler Diagonalizer Discriminant
Dissimilarity Distance Distributions DurationTier EEG ERP ERPTier
EditCostsTable EditDistanceTable Eigen Excitation Excitations
ExperimentMFC FFNet FeatureWeights FileInMemory FilesInMemory Formant
FormantFilter FormantGrid FormantModeler FormantPoint FormantTier
GaussianMixture HMM HMM_Observation HMM_ObservationSequence HMM_State
HMM_StateSequence HMMObservation HMMObservationSequence HMMState
HMMStateSequence Harmonicity ISpline Index Intensity IntensityTier
IntervalTier KNN KlattGrid KlattTable LFCC LPC Label LegendreSeries
LinearRegression LogisticRegression LongSound Ltas MFCC MSpline ManPages
Manipulation Matrix MelFilter MelSpectrogram MixingMatrix Movie Network
OTGrammar OTHistory OTMulti PCA PairDistribution ParamCurve Pattern
Permutation Photo Pitch PitchModeler PitchTier PointProcess Polygon
Polynomial PowerCepstrogram PowerCepstrum Procrustes RealPoint RealTier
ResultsMFC Roots SPINET SSCP SVD Salience ScalarProduct Similarity
SimpleString SortedSetOfString Sound Speaker Spectrogram Spectrum
SpectrumTier SpeechSynthesizer SpellingChecker Strings StringsIndex
Table TableOfReal TextGrid TextInterval TextPoint TextTier Tier
Transition VocalTract VocalTractTier Weight WordList
)
variables_numeric = %w(
all average e left macintosh mono pi praatVersion right stereo
undefined unix windows
)
variables_string = %w(
praatVersion tab shellDirectory homeDirectory
preferencesDirectory newline temporaryDirectory
defaultDirectory
)
object_attributes = %w(
ncol nrow xmin ymin xmax ymax nx ny dx dy
)
state :root do
rule /(\s+)(#.*?$)/ do
groups Text, Comment::Single
end
rule /^#.*?$/, Comment::Single
rule /;[^\n]*/, Comment::Single
rule /\s+/, Text
rule /(\bprocedure)(\s+)/ do
groups Keyword, Text
push :procedure_definition
end
rule /(\bcall)(\s+)/ do
groups Keyword, Text
push :procedure_call
end
rule /@/, Name::Function, :procedure_call
mixin :function_call
rule /\b(?:select all)\b/, Keyword
rule /\b(?:#{keywords.join('|')})\b/, Keyword
rule /(\bform\b)(\s+)([^\n]+)/ do
groups Keyword, Text, Literal::String
push :old_form
end
rule /(print(?:line|tab)?|echo|exit|asserterror|pause|send(?:praat|socket)|include|execute|system(?:_nocheck)?)(\s+)/ do
groups Keyword, Text
push :string_unquoted
end
rule /(goto|label)(\s+)(\w+)/ do
groups Keyword, Text, Name::Label
end
mixin :variable_name
mixin :number
rule /"/, Literal::String, :string
rule /\b(?:#{objects.join('|')})(?=\s+\S+\n)/, Name::Class, :string_unquoted
rule /\b(?=[A-Z])/, Text, :command
rule /(\.{3}|[)(,\$])/, Punctuation
end
state :command do
rule /( ?([^\s:\.'])+ ?)/, Keyword
mixin :string_interpolated
rule /\.{3}/ do
token Keyword
pop!
push :old_arguments
end
rule /:/ do
token Keyword
pop!
push :comma_list
end
rule /[\s]/, Text, :pop!
end
state :procedure_call do
mixin :string_interpolated
rule /(:|\s*\()/, Punctuation, :pop!
rule /'/, Name::Function
rule /[^:\('\s]+/, Name::Function
rule /(?=\s+)/ do
token Text
pop!
push :old_arguments
end
end
state :procedure_definition do
rule /(:|\s*\()/, Punctuation, :pop!
rule /[^:\(\s]+/, Name::Function
rule /(\s+)/, Text, :pop!
end
state :function_call do
rule /\b(#{functions_string.join('|')})\$(?=\s*[:(])/, Name::Function, :function
rule /\b(#{functions_array.join('|')})#(?=\s*[:(])/, Name::Function, :function
rule /\b(#{functions_numeric.join('|')})(?=\s*[:(])/, Name::Function, :function
end
state :function do
rule /\s+/, Text
rule /(?::|\s*\()/ do
token Text
pop!
push :comma_list
end
end
state :comma_list do
rule /(\s*\n\s*)(\.{3})/ do
groups Text, Punctuation
end
rule /\s*[\])\n]/, Text, :pop!
rule /\s+/, Text
rule /"/, Literal::String, :string
rule /\b(if|then|else|fi|endif)\b/, Keyword
mixin :function_call
mixin :variable_name
mixin :operator
mixin :number
rule /[()]/, Text
rule /,/, Punctuation
end
state :old_arguments do
rule /\n/, Text, :pop!
mixin :variable_name
mixin :operator
mixin :number
rule /"/, Literal::String, :string
rule /[^\n]/, Text
end
state :number do
rule /\n/, Text, :pop!
rule /\b\d+(\.\d*)?([eE][-+]?\d+)?%?/, Literal::Number
end
state :variable_name do
mixin :operator
mixin :number
rule /\b(?:#{variables_string.join('|')})\$/, Name::Builtin
rule /\b(?:#{variables_numeric.join('|')})(?!\$)\b/, Name::Builtin
rule /\b(Object|#{objects.join('|')})_/ do
token Name::Builtin
push :object_reference
end
rule /\.?[a-z][a-zA-Z0-9_.]*(\$|#)?/, Text
rule /[\[\]]/, Text, :comma_list
mixin :string_interpolated
end
state :object_reference do
mixin :string_interpolated
rule /([a-z][a-zA-Z0-9_]*|\d+)/, Name::Builtin
rule /\.(#{object_attributes.join('|')})\b/, Name::Builtin, :pop!
rule /\$/, Name::Builtin
rule /\[/, Text, :pop!
end
state :operator do
# This rule incorrectly matches === or +++++, which are not operators
rule /([+\/*<>=!-]=?|[&*|][&*|]?|\^|<>)/, Operator
rule /(?<![\w.])(and|or|not|div|mod)(?![\w.])/, Operator::Word
end
state :string_interpolated do
rule /'[\._a-z][^\[\]'":]*(\[([\d,]+|"[\w\d,]+")\])?(:[0-9]+)?'/, Literal::String::Interpol
end
state :string_unquoted do
rule /\n\s*\.{3}/, Punctuation
rule /\n/, Text, :pop!
rule /\s/, Text
mixin :string_interpolated
rule /'/, Literal::String
rule /[^'\n]+/, Literal::String
end
state :string do
rule /\n\s*\.{3}/, Punctuation
rule /"/, Literal::String, :pop!
mixin :string_interpolated
rule /'/, Literal::String
rule /[^'"\n]+/, Literal::String
end
state :old_form do
rule /(\s+)(#.*?$)/ do
groups Text, Comment::Single
end
rule /\s+/, Text
rule /(optionmenu|choice)([ \t]+\S+:[ \t]+)/ do
groups Keyword, Text
push :number
end
rule /(option|button)([ \t]+)/ do
groups Keyword, Text
push :string_unquoted
end
rule /(sentence|text)([ \t]+\S+)/ do
groups Keyword, Text
push :string_unquoted
end
rule /(word)([ \t]+\S+[ \t]*)(\S+)?([ \t]+.*)?/ do
groups Keyword, Text, Literal::String, Text
end
rule /(boolean)(\s+\S+\s*)(0|1|"?(?:yes|no)"?)/ do
groups Keyword, Text, Name::Variable
end
rule /(real|natural|positive|integer)([ \t]+\S+[ \t]*)([+-]?)/ do
groups Keyword, Text, Operator
push :number
end
rule /(comment)(\s+)/ do
groups Keyword, Text
push :string_unquoted
end
rule /\bendform\b/, Keyword, :pop!
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/dot.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/dot.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Dot < RegexLexer
title "DOT"
desc "graph description language"
tag 'dot'
filenames '*.dot'
mimetypes 'text/vnd.graphviz'
start do
@html = HTML.new(options)
end
state :comments_and_whitespace do
rule /\s+/, Text
rule %r(#.*?\n), Comment::Single
rule %r(//.*?\n), Comment::Single
rule %r(/(\\\n)?[*].*?[*](\\\n)?/)m, Comment::Multiline
end
state :html do
rule /[^<>]+/ do
delegate @html
end
rule /<.+?>/m do
delegate @html
end
rule />/, Punctuation, :pop!
end
state :ID do
rule /([a-zA-Z][a-zA-Z_0-9]*)(\s*)(=)/ do |m|
token Name, m[1]
token Text, m[2]
token Punctuation, m[3]
end
rule /[a-zA-Z][a-zA-Z_0-9]*/, Name::Variable
rule /([0-9]+)?\.[0-9]+/, Num::Float
rule /[0-9]+/, Num::Integer
rule /"(\\"|[^"])*"/, Str::Double
rule /</ do
token Punctuation
@html.reset!
push :html
end
end
state :a_list do
mixin :comments_and_whitespace
mixin :ID
rule /[=;,]/, Punctuation
rule /\]/, Operator, :pop!
end
state :root do
mixin :comments_and_whitespace
rule /\b(strict|graph|digraph|subgraph|node|edge)\b/i, Keyword
rule /[{};:=]/, Punctuation
rule /-[->]/, Operator
rule /\[/, Operator, :a_list
mixin :ID
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/javascript.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/javascript.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
# IMPORTANT NOTICE:
#
# Please do not copy this lexer and open a pull request
# for a new language. It will not get merged, you will
# be unhappy, and kittens will cry.
#
class Javascript < RegexLexer
title "JavaScript"
desc "JavaScript, the browser scripting language"
tag 'javascript'
aliases 'js'
filenames '*.js', '*.mjs'
mimetypes 'application/javascript', 'application/x-javascript',
'text/javascript', 'text/x-javascript'
def self.detect?(text)
return 1 if text.shebang?('node')
return 1 if text.shebang?('jsc')
# TODO: rhino, spidermonkey, etc
end
state :multiline_comment do
rule %r([*]/), Comment::Multiline, :pop!
rule %r([^*/]+), Comment::Multiline
rule %r([*/]), Comment::Multiline
end
state :comments_and_whitespace do
rule /\s+/, Text
rule /<!--/, Comment # really...?
rule %r(//.*?$), Comment::Single
rule %r(/[*]), Comment::Multiline, :multiline_comment
end
state :expr_start do
mixin :comments_and_whitespace
rule %r(/) do
token Str::Regex
goto :regex
end
rule /[{]/ do
token Punctuation
goto :object
end
rule //, Text, :pop!
end
state :regex do
rule %r(/) do
token Str::Regex
goto :regex_end
end
rule %r([^/]\n), Error, :pop!
rule /\n/, Error, :pop!
rule /\[\^/, Str::Escape, :regex_group
rule /\[/, Str::Escape, :regex_group
rule /\\./, Str::Escape
rule %r{[(][?][:=<!]}, Str::Escape
rule /[{][\d,]+[}]/, Str::Escape
rule /[()?]/, Str::Escape
rule /./, Str::Regex
end
state :regex_end do
rule /[gim]+/, Str::Regex, :pop!
rule(//) { pop! }
end
state :regex_group do
# specially highlight / in a group to indicate that it doesn't
# close the regex
rule /\//, Str::Escape
rule %r([^/]\n) do
token Error
pop! 2
end
rule /\]/, Str::Escape, :pop!
rule /\\./, Str::Escape
rule /./, Str::Regex
end
state :bad_regex do
rule /[^\n]+/, Error, :pop!
end
def self.keywords
@keywords ||= Set.new %w(
for in of while do break return continue switch case default
if else throw try catch finally new delete typeof instanceof
void this yield import export from as async super this
)
end
def self.declarations
@declarations ||= Set.new %w(
var let const with function class
extends constructor get set
)
end
def self.reserved
@reserved ||= Set.new %w(
abstract boolean byte char debugger double enum
final float goto implements int interface
long native package private protected public short static
synchronized throws transient volatile
eval arguments await
)
end
def self.constants
@constants ||= Set.new %w(true false null NaN Infinity undefined)
end
def self.builtins
@builtins ||= %w(
Array Boolean Date Error Function Math netscape
Number Object Packages RegExp String sun decodeURI
decodeURIComponent encodeURI encodeURIComponent
Error eval isFinite isNaN parseFloat parseInt
document window navigator self global
Promise Set Map WeakSet WeakMap Symbol Proxy Reflect
Int8Array Uint8Array Uint8ClampedArray
Int16Array Uint16Array Uint16ClampedArray
Int32Array Uint32Array Uint32ClampedArray
Float32Array Float64Array DataView ArrayBuffer
)
end
def self.id_regex
/[$a-z_][a-z0-9_]*/io
end
id = self.id_regex
state :root do
rule /\A\s*#!.*?\n/m, Comment::Preproc, :statement
rule %r((?<=\n)(?=\s|/|<!--)), Text, :expr_start
mixin :comments_and_whitespace
rule %r(\+\+ | -- | ~ | && | \|\| | \\(?=\n) | << | >>>? | ===
| !== )x,
Operator, :expr_start
rule %r([-<>+*%&|\^/!=]=?), Operator, :expr_start
rule /[(\[,]/, Punctuation, :expr_start
rule /;/, Punctuation, :statement
rule /[)\].]/, Punctuation
rule /`/ do
token Str::Double
push :template_string
end
rule /[?]/ do
token Punctuation
push :ternary
push :expr_start
end
rule /(\@)(\w+)?/ do
groups Punctuation, Name::Decorator
push :expr_start
end
rule /[{}]/, Punctuation, :statement
rule id do |m|
if self.class.keywords.include? m[0]
token Keyword
push :expr_start
elsif self.class.declarations.include? m[0]
token Keyword::Declaration
push :expr_start
elsif self.class.reserved.include? m[0]
token Keyword::Reserved
elsif self.class.constants.include? m[0]
token Keyword::Constant
elsif self.class.builtins.include? m[0]
token Name::Builtin
else
token Name::Other
end
end
rule /[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?/, Num::Float
rule /0x[0-9a-fA-F]+/i, Num::Hex
rule /0o[0-7][0-7_]*/i, Num::Oct
rule /0b[01][01_]*/i, Num::Bin
rule /[0-9]+/, Num::Integer
rule /"/, Str::Double, :dq
rule /'/, Str::Single, :sq
rule /:/, Punctuation
end
state :dq do
rule /[^\\"]+/, Str::Double
rule /\\n/, Str::Escape
rule /\\"/, Str::Escape
rule /"/, Str::Double, :pop!
end
state :sq do
rule /[^\\']+/, Str::Single
rule /\\'/, Str::Escape
rule /'/, Str::Single, :pop!
end
# braced parts that aren't object literals
state :statement do
rule /case\b/ do
token Keyword
goto :expr_start
end
rule /(#{id})(\s*)(:)/ do
groups Name::Label, Text, Punctuation
end
rule /[{}]/, Punctuation
mixin :expr_start
end
# object literals
state :object do
mixin :comments_and_whitespace
rule /[{]/ do
token Punctuation
push
end
rule /[}]/ do
token Punctuation
goto :statement
end
rule /(#{id})(\s*)(:)/ do
groups Name::Attribute, Text, Punctuation
push :expr_start
end
rule /:/, Punctuation
mixin :root
end
# ternary expressions, where <id>: is not a label!
state :ternary do
rule /:/ do
token Punctuation
goto :expr_start
end
mixin :root
end
# template strings
state :template_string do
rule /\${/, Punctuation, :template_string_expr
rule /`/, Str::Double, :pop!
rule /(\\\\|\\[\$`]|[^\$`]|\$(?!{))*/, Str::Double
end
state :template_string_expr do
rule /}/, Punctuation, :pop!
mixin :root
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/sed.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/sed.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Sed < RegexLexer
title "sed"
desc 'sed, the ultimate stream editor'
tag 'sed'
filenames '*.sed'
mimetypes 'text/x-sed'
def self.detect?(text)
return true if text.shebang? 'sed'
end
class Regex < RegexLexer
state :root do
rule /\\./, Str::Escape
rule /\[/, Punctuation, :brackets
rule /[$^.*]/, Operator
rule /[()]/, Punctuation
rule /./, Str::Regex
end
state :brackets do
rule /\^/ do
token Punctuation
goto :brackets_int
end
rule(//) { goto :brackets_int }
end
state :brackets_int do
# ranges
rule /.-./, Name::Variable
rule /\]/, Punctuation, :pop!
rule /./, Str::Regex
end
end
class Replacement < RegexLexer
state :root do
rule /\\./m, Str::Escape
rule /&/, Operator
rule /[^\\&]+/m, Text
end
end
def regex
@regex ||= Regex.new(options)
end
def replacement
@replacement ||= Replacement.new(options)
end
start { regex.reset!; replacement.reset! }
state :whitespace do
rule /\s+/m, Text
rule(/#.*?\n/) { token Comment; reset_stack }
rule(/\n/) { token Text; reset_stack }
rule(/;/) { token Punctuation; reset_stack }
end
state :root do
mixin :addr_range
end
edot = /\\.|./m
state :command do
mixin :whitespace
# subst and transliteration
rule /(s)(.)(#{edot}*?)(\2)(#{edot}*?)(\2)/m do |m|
token Keyword, m[1]
token Punctuation, m[2]
delegate regex, m[3]
token Punctuation, m[4]
delegate replacement, m[5]
token Punctuation, m[6]
goto :flags
end
rule /(y)(.)(#{edot}*?)(\2)(#{edot}*?)(\2)/m do |m|
token Keyword, m[1]
token Punctuation, m[2]
delegate replacement, m[3]
token Punctuation, m[4]
delegate replacement, m[5]
token Punctuation, m[6]
pop!
end
# commands that take a text segment as an argument
rule /([aic])(\s*)/ do
groups Keyword, Text; goto :text
end
rule /[pd]/, Keyword
# commands that take a number argument
rule /([qQl])(\s+)(\d+)/i do
groups Keyword, Text, Num
pop!
end
# no-argument commands
rule /[={}dDgGhHlnpPqx]/, Keyword, :pop!
# commands that take a filename argument
rule /([rRwW])(\s+)(\S+)/ do
groups Keyword, Text, Name
pop!
end
# commands that take a label argument
rule /([:btT])(\s+)(\S+)/ do
groups Keyword, Text, Name::Label
pop!
end
end
state :addr_range do
mixin :whitespace
### address ranges ###
addr_tok = Keyword::Namespace
rule /\d+/, addr_tok
rule /[$,~+!]/, addr_tok
rule %r((/)((?:\\.|.)*?)(/)) do |m|
token addr_tok, m[1]; delegate regex, m[2]; token addr_tok, m[3]
end
# alternate regex rage delimiters
rule %r((\\)(.)(\\.|.)*?(\2)) do |m|
token addr_tok, m[1] + m[2]
delegate regex, m[3]
token addr_tok, m[4]
end
rule(//) { push :command }
end
state :text do
rule /[^\\\n]+/, Str
rule /\\\n/, Str::Escape
rule /\\/, Str
rule /\n/, Text, :pop!
end
state :flags do
rule /[gp]+/, Keyword, :pop!
# writing to a file with the subst command.
# who'da thunk...?
rule /([wW])(\s+)(\S+)/ do
token Keyword; token Text; token Name
end
rule(//) { pop! }
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/objective_c.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/objective_c.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
load_lexer 'c.rb'
class ObjectiveC < C
tag 'objective_c'
title "Objective-C"
desc 'an extension of C commonly used to write Apple software'
aliases 'objc', 'obj-c', 'obj_c', 'objectivec'
filenames '*.m', '*.h'
mimetypes 'text/x-objective_c', 'application/x-objective_c'
def self.at_keywords
@at_keywords ||= %w(
selector private protected public encode synchronized try
throw catch finally end property synthesize dynamic optional
interface implementation import
)
end
def self.at_builtins
@at_builtins ||= %w(true false YES NO)
end
def self.builtins
@builtins ||= %w(YES NO nil)
end
id = /[a-z$_][a-z0-9$_]*/i
prepend :statements do
rule /@"/, Str, :string
rule /@'(\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|\\.|[^\\'\n]')/,
Str::Char
rule /@(\d+[.]\d*|[.]\d+|\d+)e[+-]?\d+l?/i,
Num::Float
rule /@(\d+[.]\d*|[.]\d+|\d+f)f?/i, Num::Float
rule /@0x\h+[lL]?/, Num::Hex
rule /@0[0-7]+l?/i, Num::Oct
rule /@\d+l?/, Num::Integer
rule /\bin\b/, Keyword
rule /@(?:interface|implementation)\b/ do
token Keyword
goto :classname
end
rule /@(?:class|protocol)\b/ do
token Keyword
goto :forward_classname
end
rule /@([[:alnum:]]+)/ do |m|
if self.class.at_keywords.include? m[1]
token Keyword
elsif self.class.at_builtins.include? m[1]
token Name::Builtin
else
token Error
end
end
rule /[?]/, Punctuation, :ternary
rule /\[/, Punctuation, :message
rule /@\[/, Punctuation, :array_literal
rule /@\{/, Punctuation, :dictionary_literal
end
state :ternary do
rule /:/, Punctuation, :pop!
mixin :statements
end
state :message_shared do
rule /\]/, Punctuation, :pop!
rule /\{/, Punctuation, :pop!
rule /;/, Error
mixin :statement
end
state :message do
rule /(#{id})(\s*)(:)/ do
groups(Name::Function, Text, Punctuation)
goto :message_with_args
end
rule /(#{id})(\s*)(\])/ do
groups(Name::Function, Text, Punctuation)
pop!
end
mixin :message_shared
end
state :message_with_args do
rule /\{/, Punctuation, :function
rule /(#{id})(\s*)(:)/ do
groups(Name::Function, Text, Punctuation)
pop!
end
mixin :message_shared
end
state :array_literal do
rule /]/, Punctuation, :pop!
rule /,/, Punctuation
mixin :statements
end
state :dictionary_literal do
rule /}/, Punctuation, :pop!
rule /,/, Punctuation
mixin :statements
end
state :classname do
mixin :whitespace
rule /(#{id})(\s*)(:)(\s*)(#{id})/ do
groups(Name::Class, Text,
Punctuation, Text,
Name::Class)
pop!
end
rule /(#{id})(\s*)([(])(\s*)(#{id})(\s*)([)])/ do
groups(Name::Class, Text,
Punctuation, Text,
Name::Label, Text,
Punctuation)
pop!
end
rule id, Name::Class, :pop!
end
state :forward_classname do
mixin :whitespace
rule /(#{id})(\s*)(,)(\s*)/ do
groups(Name::Class, Text, Punctuation, Text)
push
end
rule /(#{id})(\s*)(;?)/ do
groups(Name::Class, Text, Punctuation)
pop!
end
end
prepend :root do
rule %r(
([-+])(\s*)
([(].*?[)])?(\s*)
(?=#{id}:?)
)ix do |m|
token Keyword, m[1]; token Text, m[2]
recurse m[3]; token Text, m[4]
push :method_definition
end
end
state :method_definition do
rule /,/, Punctuation
rule /[.][.][.]/, Punctuation
rule /([(].*?[)])(#{id})/ do |m|
recurse m[1]; token Name::Variable, m[2]
end
rule /(#{id})(\s*)(:)/m do
groups(Name::Function, Text, Punctuation)
end
rule /;/, Punctuation, :pop!
rule /{/ do
token Punctuation
goto :function
end
mixin :inline_whitespace
rule %r(//.*?\n), Comment::Single
rule /\s+/m, Text
rule(//) { pop! }
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/ruby.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/ruby.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Ruby < RegexLexer
title "Ruby"
desc "The Ruby programming language (ruby-lang.org)"
tag 'ruby'
aliases 'rb'
filenames '*.rb', '*.ruby', '*.rbw', '*.rake', '*.gemspec', '*.podspec',
'Rakefile', 'Guardfile', 'Gemfile', 'Capfile', 'Podfile',
'Vagrantfile', '*.ru', '*.prawn', 'Berksfile', '*.arb',
'Dangerfile'
mimetypes 'text/x-ruby', 'application/x-ruby'
def self.detect?(text)
return true if text.shebang? 'ruby'
end
state :symbols do
# symbols
rule %r(
: # initial :
@{0,2} # optional ivar, for :@foo and :@@foo
[a-z_]\w*[!?]? # the symbol
)xi, Str::Symbol
# special symbols
rule %r(:(?:\*\*|[-+]@|[/\%&\|^`~]|\[\]=?|<<|>>|<=?>|<=?|===?)),
Str::Symbol
rule /:'(\\\\|\\'|[^'])*'/, Str::Symbol
rule /:"/, Str::Symbol, :simple_sym
end
state :sigil_strings do
# %-sigiled strings
# %(abc), %[abc], %<abc>, %.abc., %r.abc., etc
delimiter_map = { '{' => '}', '[' => ']', '(' => ')', '<' => '>' }
rule /%([rqswQWxiI])?([^\w\s])/ do |m|
open = Regexp.escape(m[2])
close = Regexp.escape(delimiter_map[m[2]] || m[2])
interp = /[rQWxI]/ === m[1]
toktype = Str::Other
puts " open: #{open.inspect}" if @debug
puts " close: #{close.inspect}" if @debug
# regexes
if m[1] == 'r'
toktype = Str::Regex
push :regex_flags
end
token toktype
push do
rule /\\[##{open}#{close}\\]/, Str::Escape
# nesting rules only with asymmetric delimiters
if open != close
rule /#{open}/ do
token toktype
push
end
end
rule /#{close}/, toktype, :pop!
if interp
mixin :string_intp_escaped
rule /#/, toktype
else
rule /[\\#]/, toktype
end
rule /[^##{open}#{close}\\]+/m, toktype
end
end
end
state :strings do
mixin :symbols
rule /\b[a-z_]\w*?[?!]?:\s+/, Str::Symbol, :expr_start
rule /'(\\\\|\\'|[^'])*'/, Str::Single
rule /"/, Str::Double, :simple_string
rule /(?<!\.)`/, Str::Backtick, :simple_backtick
end
state :regex_flags do
rule /[mixounse]*/, Str::Regex, :pop!
end
# double-quoted string and symbol
[[:string, Str::Double, '"'],
[:sym, Str::Symbol, '"'],
[:backtick, Str::Backtick, '`']].each do |name, tok, fin|
state :"simple_#{name}" do
mixin :string_intp_escaped
rule /[^\\#{fin}#]+/m, tok
rule /[\\#]/, tok
rule /#{fin}/, tok, :pop!
end
end
keywords = %w(
BEGIN END alias begin break case defined\? do else elsif end
ensure for if in next redo rescue raise retry return super then
undef unless until when while yield
)
keywords_pseudo = %w(
loop include extend raise
alias_method attr catch throw private module_function
public protected true false nil __FILE__ __LINE__
)
builtins_g = %w(
attr_reader attr_writer attr_accessor
__id__ __send__ abort ancestors at_exit autoload binding callcc
caller catch chomp chop class_eval class_variables clone
const_defined\? const_get const_missing const_set constants
display dup eval exec exit extend fail fork format freeze
getc gets global_variables gsub hash id included_modules
inspect instance_eval instance_method instance_methods
instance_variable_get instance_variable_set instance_variables
lambda load local_variables loop method method_missing
methods module_eval name object_id open p print printf
private_class_method private_instance_methods private_methods proc
protected_instance_methods protected_methods public_class_method
public_instance_methods public_methods putc puts raise rand
readline readlines require require_relative scan select self send set_trace_func
singleton_methods sleep split sprintf srand sub syscall system
taint test throw to_a to_s trace_var trap untaint untrace_var warn
)
builtins_q = %w(
autoload block_given const_defined eql equal frozen
include instance_of is_a iterator kind_of method_defined
nil private_method_defined protected_method_defined
public_method_defined respond_to tainted
)
builtins_b = %w(chomp chop exit gsub sub)
start do
push :expr_start
@heredoc_queue = []
end
state :whitespace do
mixin :inline_whitespace
rule /\n\s*/m, Text, :expr_start
rule /#.*$/, Comment::Single
rule %r(=begin\b.*?\n=end\b)m, Comment::Multiline
end
state :inline_whitespace do
rule /[ \t\r]+/, Text
end
state :root do
mixin :whitespace
rule /__END__/, Comment::Preproc, :end_part
rule /0_?[0-7]+(?:_[0-7]+)*/, Num::Oct
rule /0x[0-9A-Fa-f]+(?:_[0-9A-Fa-f]+)*/, Num::Hex
rule /0b[01]+(?:_[01]+)*/, Num::Bin
rule /\d+\.\d+(e[\+\-]?\d+)?/, Num::Float
rule /[\d]+(?:_\d+)*/, Num::Integer
# names
rule /@@[a-z_]\w*/i, Name::Variable::Class
rule /@[a-z_]\w*/i, Name::Variable::Instance
rule /\$\w+/, Name::Variable::Global
rule %r(\$[!@&`'+~=/\\,;.<>_*\$?:"]), Name::Variable::Global
rule /\$-[0adFiIlpvw]/, Name::Variable::Global
rule /::/, Operator
mixin :strings
rule /(?:#{keywords.join('|')})\b/, Keyword, :expr_start
rule /(?:#{keywords_pseudo.join('|')})\b/, Keyword::Pseudo, :expr_start
rule %r(
(module)
(\s+)
([a-zA-Z_][a-zA-Z0-9_]*(::[a-zA-Z_][a-zA-Z0-9_]*)*)
)x do
groups Keyword, Text, Name::Namespace
end
rule /(def\b)(\s*)/ do
groups Keyword, Text
push :funcname
end
rule /(class\b)(\s*)/ do
groups Keyword, Text
push :classname
end
rule /(?:#{builtins_q.join('|')})[?]/, Name::Builtin, :expr_start
rule /(?:#{builtins_b.join('|')})!/, Name::Builtin, :expr_start
rule /(?<!\.)(?:#{builtins_g.join('|')})\b/,
Name::Builtin, :method_call
mixin :has_heredocs
# `..` and `...` for ranges must have higher priority than `.`
# Otherwise, they will be parsed as :method_call
rule /\.{2,3}/, Operator, :expr_start
rule /[A-Z][a-zA-Z0-9_]*/, Name::Constant, :method_call
rule /(\.|::)(\s*)([a-z_]\w*[!?]?|[*%&^`~+-\/\[<>=])/ do
groups Punctuation, Text, Name::Function
push :method_call
end
rule /[a-zA-Z_]\w*[?!]/, Name, :expr_start
rule /[a-zA-Z_]\w*/, Name, :method_call
rule /\*\*|<<?|>>?|>=|<=|<=>|=~|={3}|!~|&&?|\|\||\./,
Operator, :expr_start
rule /[-+\/*%=<>&!^|~]=?/, Operator, :expr_start
rule(/[?]/) { token Punctuation; push :ternary; push :expr_start }
rule %r<[\[({,:\\;/]>, Punctuation, :expr_start
rule %r<[\])}]>, Punctuation
end
state :has_heredocs do
rule /(?<!\w)(<<[-~]?)(["`']?)([a-zA-Z_]\w*)(\2)/ do |m|
token Operator, m[1]
token Name::Constant, "#{m[2]}#{m[3]}#{m[4]}"
@heredoc_queue << [['<<-', '<<~'].include?(m[1]), m[3]]
push :heredoc_queue unless state? :heredoc_queue
end
rule /(<<[-~]?)(["'])(\2)/ do |m|
token Operator, m[1]
token Name::Constant, "#{m[2]}#{m[3]}#{m[4]}"
@heredoc_queue << [['<<-', '<<~'].include?(m[1]), '']
push :heredoc_queue unless state? :heredoc_queue
end
end
state :heredoc_queue do
rule /(?=\n)/ do
goto :resolve_heredocs
end
mixin :root
end
state :resolve_heredocs do
mixin :string_intp_escaped
rule /\n/, Str::Heredoc, :test_heredoc
rule /[#\\\n]/, Str::Heredoc
rule /[^#\\\n]+/, Str::Heredoc
end
state :test_heredoc do
rule /[^#\\\n]*$/ do |m|
tolerant, heredoc_name = @heredoc_queue.first
check = tolerant ? m[0].strip : m[0].rstrip
# check if we found the end of the heredoc
puts " end heredoc check #{check.inspect} = #{heredoc_name.inspect}" if @debug
if check == heredoc_name
@heredoc_queue.shift
# if there's no more, we're done looking.
pop! if @heredoc_queue.empty?
token Name::Constant
else
token Str::Heredoc
end
pop!
end
rule(//) { pop! }
end
state :funcname do
rule /\s+/, Text
rule /\(/, Punctuation, :defexpr
rule %r(
(?:([a-zA-Z_][\w_]*)(\.))?
(
[a-zA-Z_][\w_]*[!?]? |
\*\*? | [-+]@? | [/%&\|^`~] | \[\]=? |
<<? | >>? | <=>? | >= | ===?
)
)x do |m|
puts "matches: #{[m[0], m[1], m[2], m[3]].inspect}" if @debug
groups Name::Class, Operator, Name::Function
pop!
end
rule(//) { pop! }
end
state :classname do
rule /\s+/, Text
rule /\(/ do
token Punctuation
push :defexpr
push :expr_start
end
# class << expr
rule /<</ do
token Operator
goto :expr_start
end
rule /[A-Z_]\w*/, Name::Class, :pop!
rule(//) { pop! }
end
state :ternary do
rule(/:(?!:)/) { token Punctuation; goto :expr_start }
mixin :root
end
state :defexpr do
rule /(\))(\.|::)?/ do
groups Punctuation, Operator
pop!
end
rule /\(/ do
token Punctuation
push :defexpr
push :expr_start
end
mixin :root
end
state :in_interp do
rule /}/, Str::Interpol, :pop!
mixin :root
end
state :string_intp do
rule /[#][{]/, Str::Interpol, :in_interp
rule /#(@@?|\$)[a-z_]\w*/i, Str::Interpol
end
state :string_intp_escaped do
mixin :string_intp
rule /\\([\\abefnrstv#"']|x[a-fA-F0-9]{1,2}|[0-7]{1,3})/,
Str::Escape
rule /\\./, Str::Escape
end
state :method_call do
rule %r(/) do
token Operator
goto :expr_start
end
rule(/(?=\n)/) { pop! }
rule(//) { goto :method_call_spaced }
end
state :method_call_spaced do
mixin :whitespace
rule %r([%/]=) do
token Operator
goto :expr_start
end
rule %r((/)(?=\S|\s*/)) do
token Str::Regex
goto :slash_regex
end
mixin :sigil_strings
rule(%r((?=\s*/))) { pop! }
rule(/\s+/) { token Text; goto :expr_start }
rule(//) { pop! }
end
state :expr_start do
mixin :inline_whitespace
rule %r(/) do
token Str::Regex
goto :slash_regex
end
# char operator. ?x evaulates to "x", unless there's a digit
# beforehand like x>=0?n[x]:""
rule %r(
[?](\\[MC]-)* # modifiers
(\\([\\abefnrstv\#"']|x[a-fA-F0-9]{1,2}|[0-7]{1,3})|\S)
(?!\w)
)x, Str::Char, :pop!
# special case for using a single space. Ruby demands that
# these be in a single line, otherwise it would make no sense.
rule /(\s*)(%[rqswQWxiI]? \S* )/ do
groups Text, Str::Other
pop!
end
mixin :sigil_strings
rule(//) { pop! }
end
state :slash_regex do
mixin :string_intp
rule %r(\\\\), Str::Regex
rule %r(\\/), Str::Regex
rule %r([\\#]), Str::Regex
rule %r([^\\/#]+)m, Str::Regex
rule %r(/) do
token Str::Regex
goto :regex_flags
end
end
state :end_part do
# eat up the rest of the stream as Comment::Preproc
rule /.+/m, Comment::Preproc, :pop!
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/sml.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/sml.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class SML < RegexLexer
title "SML"
desc 'Standard ML'
tag 'sml'
aliases 'ml'
filenames '*.sml', '*.sig', '*.fun'
mimetypes 'text/x-standardml', 'application/x-standardml'
def self.keywords
@keywords ||= Set.new %w(
abstype and andalso as case datatype do else end exception
fn fun handle if in infix infixr let local nonfix of op open
orelse raise rec then type val with withtype while
eqtype functor include sharing sig signature struct structure
where
)
end
def self.symbolic_reserved
@symbolic_reserved ||= Set.new %w(: | = => -> # :>)
end
id = /[\w']+/i
symbol = %r([!%&$#/:<=>?@\\~`^|*+-]+)
state :whitespace do
rule /\s+/m, Text
rule /[(][*]/, Comment, :comment
end
state :delimiters do
rule /[(\[{]/, Punctuation, :main
rule /[)\]}]/, Punctuation, :pop!
rule /\b(let|if|local)\b(?!')/ do
token Keyword::Reserved
push; push
end
rule /\b(struct|sig|while)\b(?!')/ do
token Keyword::Reserved
push
end
rule /\b(do|else|end|in|then)\b(?!')/, Keyword::Reserved, :pop!
end
def token_for_id_with_dot(id)
if self.class.keywords.include? id
Error
else
Name::Namespace
end
end
def token_for_final_id(id)
if self.class.keywords.include? id or self.class.symbolic_reserved.include? id
Error
else
Name
end
end
def token_for_id(id)
if self.class.keywords.include? id
Keyword::Reserved
elsif self.class.symbolic_reserved.include? id
Punctuation
else
Name
end
end
state :core do
rule /[()\[\]{},;_]|[.][.][.]/, Punctuation
rule /#"/, Str::Char, :char
rule /"/, Str::Double, :string
rule /~?0x[0-9a-fA-F]+/, Num::Hex
rule /0wx[0-9a-fA-F]+/, Num::Hex
rule /0w\d+/, Num::Integer
rule /~?\d+([.]\d+)?[eE]~?\d+/, Num::Float
rule /~?\d+[.]\d+/, Num::Float
rule /~?\d+/, Num::Integer
rule /#\s*[1-9][0-9]*/, Name::Label
rule /#\s*#{id}/, Name::Label
rule /#\s+#{symbol}/, Name::Label
rule /\b(datatype|abstype)\b(?!')/, Keyword::Reserved, :dname
rule(/(?=\bexception\b(?!'))/) { push :ename }
rule /\b(functor|include|open|signature|structure)\b(?!')/,
Keyword::Reserved, :sname
rule /\b(type|eqtype)\b(?!')/, Keyword::Reserved, :tname
rule /'#{id}/, Name::Decorator
rule /(#{id})([.])/ do |m|
groups(token_for_id_with_dot(m[1]), Punctuation)
push :dotted
end
rule id do |m|
token token_for_id(m[0])
end
rule symbol do |m|
token token_for_id(m[0])
end
end
state :dotted do
rule /(#{id})([.])/ do |m|
groups(token_for_id_with_dot(m[1]), Punctuation)
end
rule id do |m|
token token_for_id(m[0])
pop!
end
rule symbol do |m|
token token_for_id(m[0])
pop!
end
end
state :root do
rule /#!.*?\n/, Comment::Preproc
rule(//) { push :main }
end
state :main do
mixin :whitespace
rule /\b(val|and)\b(?!')/, Keyword::Reserved, :vname
rule /\b(fun)\b(?!')/ do
token Keyword::Reserved
goto :main_fun
push :fname
end
mixin :delimiters
mixin :core
end
state :main_fun do
mixin :whitespace
rule /\b(fun|and)\b(?!')/, Keyword::Reserved, :fname
rule /\bval\b(?!')/ do
token Keyword::Reserved
goto :main
push :vname
end
rule /[|]/, Punctuation, :fname
rule /\b(case|handle)\b(?!')/ do
token Keyword::Reserved
goto :main
end
mixin :delimiters
mixin :core
end
state :has_escapes do
rule /\\[\\"abtnvfr]/, Str::Escape
rule /\\\^[\x40-\x5e]/, Str::Escape
rule /\\[0-9]{3}/, Str::Escape
rule /\\u\h{4}/, Str::Escape
rule /\\\s+\\/, Str::Interpol
end
state :string do
rule /[^"\\]+/, Str::Double
rule /"/, Str::Double, :pop!
mixin :has_escapes
end
state :char do
rule /[^"\\]+/, Str::Char
rule /"/, Str::Char, :pop!
mixin :has_escapes
end
state :breakout do
rule /(?=\b(#{SML.keywords.to_a.join('|')})\b(?!'))/ do
pop!
end
end
state :sname do
mixin :whitespace
mixin :breakout
rule id, Name::Namespace
rule(//) { pop! }
end
state :has_annotations do
rule /'[\w']*/, Name::Decorator
rule /[(]/, Punctuation, :tyvarseq
end
state :fname do
mixin :whitespace
mixin :has_annotations
rule id, Name::Function, :pop!
rule symbol, Name::Function, :pop!
end
state :vname do
mixin :whitespace
mixin :has_annotations
rule /(#{id})(\s*)(=(?!#{symbol}))/m do
groups Name::Variable, Text, Punctuation
pop!
end
rule /(#{symbol})(\s*)(=(?!#{symbol}))/m do
groups Name::Variable, Text, Punctuation
end
rule id, Name::Variable, :pop!
rule symbol, Name::Variable, :pop!
rule(//) { pop! }
end
state :tname do
mixin :whitespace
mixin :breakout
mixin :has_annotations
rule /'[\w']*/, Name::Decorator
rule /[(]/, Punctuation, :tyvarseq
rule %r(=(?!#{symbol})) do
token Punctuation
goto :typbind
end
rule id, Keyword::Type
rule symbol, Keyword::Type
end
state :typbind do
mixin :whitespace
rule /\b(and)\b(?!')/ do
token Keyword::Reserved
goto :tname
end
mixin :breakout
mixin :core
end
state :dname do
mixin :whitespace
mixin :breakout
mixin :has_annotations
rule /(=)(\s*)(datatype)\b/ do
groups Punctuation, Text, Keyword::Reserved
pop!
end
rule %r(=(?!#{symbol})) do
token Punctuation
goto :datbind
push :datcon
end
rule id, Keyword::Type
rule symbol, Keyword::Type
end
state :datbind do
mixin :whitespace
rule /\b(and)\b(?!')/ do
token Keyword::Reserved; goto :dname
end
rule /\b(withtype)\b(?!')/ do
token Keyword::Reserved; goto :tname
end
rule /\bof\b(?!')/, Keyword::Reserved
rule /([|])(\s*)(#{id})/ do
groups(Punctuation, Text, Name::Class)
end
rule /([|])(\s+)(#{symbol})/ do
groups(Punctuation, Text, Name::Class)
end
mixin :breakout
mixin :core
end
state :ename do
mixin :whitespace
rule /(exception|and)(\s+)(#{id})/ do
groups Keyword::Reserved, Text, Name::Class
end
rule /(exception|and)(\s*)(#{symbol})/ do
groups Keyword::Reserved, Text, Name::Class
end
rule /\b(of)\b(?!')/, Keyword::Reserved
mixin :breakout
mixin :core
end
state :datcon do
mixin :whitespace
rule id, Name::Class, :pop!
rule symbol, Name::Class, :pop!
end
state :tyvarseq do
mixin :whitespace
rule /'[\w']*/, Name::Decorator
rule id, Name
rule /,/, Punctuation
rule /[)]/, Punctuation, :pop!
rule symbol, Name
end
state :comment do
rule /[^(*)]+/, Comment::Multiline
rule /[(][*]/ do
token Comment::Multiline; push
end
rule /[*][)]/, Comment::Multiline, :pop!
rule /[(*)]/, Comment::Multiline
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/apple_script.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/apple_script.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class AppleScript < RegexLexer
title "AppleScript"
desc "The AppleScript scripting language by Apple Inc. (http://developer.apple.com/applescript/)"
tag 'applescript'
aliases 'applescript'
filenames '*.applescript', '*.scpt'
mimetypes 'application/x-applescript'
def self.literals
@literals ||= ['AppleScript', 'current application', 'false', 'linefeed',
'missing value', 'pi','quote', 'result', 'return', 'space',
'tab', 'text item delimiters', 'true', 'version']
end
def self.classes
@classes ||= ['alias ', 'application ', 'boolean ', 'class ', 'constant ',
'date ', 'file ', 'integer ', 'list ', 'number ', 'POSIX file ',
'real ', 'record ', 'reference ', 'RGB color ', 'script ',
'text ', 'unit types', '(?:Unicode )?text', 'string']
end
def self.builtins
@builtins ||= ['attachment', 'attribute run', 'character', 'day', 'month',
'paragraph', 'word', 'year']
end
def self.handler_params
@handler_params ||= ['about', 'above', 'against', 'apart from', 'around',
'aside from', 'at', 'below', 'beneath', 'beside',
'between', 'for', 'given', 'instead of', 'on', 'onto',
'out of', 'over', 'since']
end
def self.commands
@commands ||= ['ASCII (character|number)', 'activate', 'beep', 'choose URL',
'choose application', 'choose color', 'choose file( name)?',
'choose folder', 'choose from list',
'choose remote application', 'clipboard info',
'close( access)?', 'copy', 'count', 'current date', 'delay',
'delete', 'display (alert|dialog)', 'do shell script',
'duplicate', 'exists', 'get eof', 'get volume settings',
'info for', 'launch', 'list (disks|folder)', 'load script',
'log', 'make', 'mount volume', 'new', 'offset',
'open( (for access|location))?', 'path to', 'print', 'quit',
'random number', 'read', 'round', 'run( script)?',
'say', 'scripting components',
'set (eof|the clipboard to|volume)', 'store script',
'summarize', 'system attribute', 'system info',
'the clipboard', 'time to GMT', 'write', 'quoted form']
end
def self.references
@references ||= ['(in )?back of', '(in )?front of', '[0-9]+(st|nd|rd|th)',
'first', 'second', 'third', 'fourth', 'fifth', 'sixth',
'seventh', 'eighth', 'ninth', 'tenth', 'after', 'back',
'before', 'behind', 'every', 'front', 'index', 'last',
'middle', 'some', 'that', 'through', 'thru', 'where', 'whose']
end
def self.operators
@operators ||= ["and", "or", "is equal", "equals", "(is )?equal to", "is not",
"isn't", "isn't equal( to)?", "is not equal( to)?",
"doesn't equal", "does not equal", "(is )?greater than",
"comes after", "is not less than or equal( to)?",
"isn't less than or equal( to)?", "(is )?less than",
"comes before", "is not greater than or equal( to)?",
"isn't greater than or equal( to)?",
"(is )?greater than or equal( to)?", "is not less than",
"isn't less than", "does not come before",
"doesn't come before", "(is )?less than or equal( to)?",
"is not greater than", "isn't greater than",
"does not come after", "doesn't come after", "starts? with",
"begins? with", "ends? with", "contains?", "does not contain",
"doesn't contain", "is in", "is contained by", "is not in",
"is not contained by", "isn't contained by", "div", "mod",
"not", "(a )?(ref( to)?|reference to)", "is", "does"]
end
def self.controls
@controls ||= ['considering', 'else', 'error', 'exit', 'from', 'if',
'ignoring', 'in', 'repeat', 'tell', 'then', 'times', 'to',
'try', 'until', 'using terms from', 'while', 'whith',
'with timeout( of)?', 'with transaction', 'by', 'continue',
'end', 'its?', 'me', 'my', 'return', 'of' , 'as']
end
def self.declarations
@declarations ||= ['global', 'local', 'prop(erty)?', 'set', 'get']
end
def self.reserved
@reserved ||= ['but', 'put', 'returning', 'the']
end
def self.studio_classes
@studio_classes ||= ['action cell', 'alert reply', 'application', 'box',
'browser( cell)?', 'bundle', 'button( cell)?', 'cell',
'clip view', 'color well', 'color-panel',
'combo box( item)?', 'control',
'data( (cell|column|item|row|source))?', 'default entry',
'dialog reply', 'document', 'drag info', 'drawer',
'event', 'font(-panel)?', 'formatter',
'image( (cell|view))?', 'matrix', 'menu( item)?', 'item',
'movie( view)?', 'open-panel', 'outline view', 'panel',
'pasteboard', 'plugin', 'popup button',
'progress indicator', 'responder', 'save-panel',
'scroll view', 'secure text field( cell)?', 'slider',
'sound', 'split view', 'stepper', 'tab view( item)?',
'table( (column|header cell|header view|view))',
'text( (field( cell)?|view))?', 'toolbar( item)?',
'user-defaults', 'view', 'window']
end
def self.studio_events
@studio_events ||= ['accept outline drop', 'accept table drop', 'action',
'activated', 'alert ended', 'awake from nib', 'became key',
'became main', 'begin editing', 'bounds changed',
'cell value', 'cell value changed', 'change cell value',
'change item value', 'changed', 'child of item',
'choose menu item', 'clicked', 'clicked toolbar item',
'closed', 'column clicked', 'column moved',
'column resized', 'conclude drop', 'data representation',
'deminiaturized', 'dialog ended', 'document nib name',
'double clicked', 'drag( (entered|exited|updated))?',
'drop', 'end editing', 'exposed', 'idle', 'item expandable',
'item value', 'item value changed', 'items changed',
'keyboard down', 'keyboard up', 'launched',
'load data representation', 'miniaturized', 'mouse down',
'mouse dragged', 'mouse entered', 'mouse exited',
'mouse moved', 'mouse up', 'moved',
'number of browser rows', 'number of items',
'number of rows', 'open untitled', 'opened', 'panel ended',
'parameters updated', 'plugin loaded', 'prepare drop',
'prepare outline drag', 'prepare outline drop',
'prepare table drag', 'prepare table drop',
'read from file', 'resigned active', 'resigned key',
'resigned main', 'resized( sub views)?',
'right mouse down', 'right mouse dragged',
'right mouse up', 'rows changed', 'scroll wheel',
'selected tab view item', 'selection changed',
'selection changing', 'should begin editing',
'should close', 'should collapse item',
'should end editing', 'should expand item',
'should open( untitled)?',
'should quit( after last window closed)?',
'should select column', 'should select item',
'should select row', 'should select tab view item',
'should selection change', 'should zoom', 'shown',
'update menu item', 'update parameters',
'update toolbar item', 'was hidden', 'was miniaturized',
'will become active', 'will close', 'will dismiss',
'will display browser cell', 'will display cell',
'will display item cell', 'will display outline cell',
'will finish launching', 'will hide', 'will miniaturize',
'will move', 'will open', 'will pop up', 'will quit',
'will resign active', 'will resize( sub views)?',
'will select tab view item', 'will show', 'will zoom',
'write to file', 'zoomed']
end
def self.studio_commands
@studio_commands ||= ['animate', 'append', 'call method', 'center',
'close drawer', 'close panel', 'display',
'display alert', 'display dialog', 'display panel', 'go',
'hide', 'highlight', 'increment', 'item for',
'load image', 'load movie', 'load nib', 'load panel',
'load sound', 'localized string', 'lock focus', 'log',
'open drawer', 'path for', 'pause', 'perform action',
'play', 'register', 'resume', 'scroll', 'select( all)?',
'show', 'size to fit', 'start', 'step back',
'step forward', 'stop', 'synchronize', 'unlock focus',
'update']
end
def self.studio_properties
@studio_properties ||= ['accepts arrow key', 'action method', 'active',
'alignment', 'allowed identifiers',
'allows branch selection', 'allows column reordering',
'allows column resizing', 'allows column selection',
'allows customization', 'allows editing text attributes',
'allows empty selection', 'allows mixed state',
'allows multiple selection', 'allows reordering',
'allows undo', 'alpha( value)?', 'alternate image',
'alternate increment value', 'alternate title',
'animation delay', 'associated file name',
'associated object', 'auto completes', 'auto display',
'auto enables items', 'auto repeat', 'auto resizes( outline column)?',
'auto save expanded items', 'auto save name',
'auto save table columns', 'auto saves configuration',
'auto scroll', 'auto sizes all columns to fit',
'auto sizes cells', 'background color', 'bezel state',
'bezel style', 'bezeled', 'border rect', 'border type',
'bordered', 'bounds( rotation)?', 'box type',
'button returned', 'button type',
'can choose directories', 'can choose files', 'can draw', 'can hide',
'cell( (background color|size|type))?', 'characters',
'class', 'click count', 'clicked( data)? column',
'clicked data item', 'clicked( data)? row',
'closeable', 'collating', 'color( (mode|panel))',
'command key down', 'configuration',
'content(s| (size|view( margins)?))?', 'context',
'continuous', 'control key down', 'control size',
'control tint', 'control view',
'controller visible', 'coordinate system',
'copies( on scroll)?', 'corner view', 'current cell',
'current column', 'current( field)? editor',
'current( menu)? item', 'current row',
'current tab view item', 'data source',
'default identifiers', 'delta (x|y|z)',
'destination window', 'directory', 'display mode',
'displayed cell', 'document( (edited|rect|view))?',
'double value', 'dragged column', 'dragged distance',
'dragged items', 'draws( cell)? background',
'draws grid', 'dynamically scrolls', 'echos bullets',
'edge', 'editable', 'edited( data)? column',
'edited data item', 'edited( data)? row', 'enabled',
'enclosing scroll view', 'ending page',
'error handling', 'event number', 'event type',
'excluded from windows menu', 'executable path',
'expanded', 'fax number', 'field editor', 'file kind',
'file name', 'file type', 'first responder',
'first visible column', 'flipped', 'floating',
'font( panel)?', 'formatter', 'frameworks path',
'frontmost', 'gave up', 'grid color', 'has data items',
'has horizontal ruler', 'has horizontal scroller',
'has parent data item', 'has resize indicator',
'has shadow', 'has sub menu', 'has vertical ruler',
'has vertical scroller', 'header cell', 'header view',
'hidden', 'hides when deactivated', 'highlights by',
'horizontal line scroll', 'horizontal page scroll',
'horizontal ruler view', 'horizontally resizable',
'icon image', 'id', 'identifier',
'ignores multiple clicks',
'image( (alignment|dims when disabled|frame style|scaling))?',
'imports graphics', 'increment value',
'indentation per level', 'indeterminate', 'index',
'integer value', 'intercell spacing', 'item height',
'key( (code|equivalent( modifier)?|window))?',
'knob thickness', 'label', 'last( visible)? column',
'leading offset', 'leaf', 'level', 'line scroll',
'loaded', 'localized sort', 'location', 'loop mode',
'main( (bunde|menu|window))?', 'marker follows cell',
'matrix mode', 'maximum( content)? size',
'maximum visible columns',
'menu( form representation)?', 'miniaturizable',
'miniaturized', 'minimized image', 'minimized title',
'minimum column width', 'minimum( content)? size',
'modal', 'modified', 'mouse down state',
'movie( (controller|file|rect))?', 'muted', 'name',
'needs display', 'next state', 'next text',
'number of tick marks', 'only tick mark values',
'opaque', 'open panel', 'option key down',
'outline table column', 'page scroll', 'pages across',
'pages down', 'palette label', 'pane splitter',
'parent data item', 'parent window', 'pasteboard',
'path( (names|separator))?', 'playing',
'plays every frame', 'plays selection only', 'position',
'preferred edge', 'preferred type', 'pressure',
'previous text', 'prompt', 'properties',
'prototype cell', 'pulls down', 'rate',
'released when closed', 'repeated',
'requested print time', 'required file type',
'resizable', 'resized column', 'resource path',
'returns records', 'reuses columns', 'rich text',
'roll over', 'row height', 'rulers visible',
'save panel', 'scripts path', 'scrollable',
'selectable( identifiers)?', 'selected cell',
'selected( data)? columns?', 'selected data items?',
'selected( data)? rows?', 'selected item identifier',
'selection by rect', 'send action on arrow key',
'sends action when done editing', 'separates columns',
'separator item', 'sequence number', 'services menu',
'shared frameworks path', 'shared support path',
'sheet', 'shift key down', 'shows alpha',
'shows state by', 'size( mode)?',
'smart insert delete enabled', 'sort case sensitivity',
'sort column', 'sort order', 'sort type',
'sorted( data rows)?', 'sound', 'source( mask)?',
'spell checking enabled', 'starting page', 'state',
'string value', 'sub menu', 'super menu', 'super view',
'tab key traverses cells', 'tab state', 'tab type',
'tab view', 'table view', 'tag', 'target( printer)?',
'text color', 'text container insert',
'text container origin', 'text returned',
'tick mark position', 'time stamp',
'title(d| (cell|font|height|position|rect))?',
'tool tip', 'toolbar', 'trailing offset', 'transparent',
'treat packages as directories', 'truncated labels',
'types', 'unmodified characters', 'update views',
'use sort indicator', 'user defaults',
'uses data source', 'uses ruler', 'uses threaded animation',
'uses title from previous column', 'value wraps', 'version',
'vertical( (line scroll|page scroll|ruler view))?', 'vertically resizable', 'view',
'visible( document rect)?', 'volume', 'width', 'window',
'windows menu', 'wraps', 'zoomable', 'zoomed']
end
operators = %r(\b(#{self.operators.to_a.join('|')})\b)
classes = %r(\b(as )(#{self.classes.to_a.join('|')})\b)
literals = %r(\b(#{self.literals.to_a.join('|')})\b)
commands = %r(\b(#{self.commands.to_a.join('|')})\b)
controls = %r(\b(#{self.controls.to_a.join('|')})\b)
declarations = %r(\b(#{self.declarations.to_a.join('|')})\b)
reserved = %r(\b(#{self.reserved.to_a.join('|')})\b)
builtins = %r(\b(#{self.builtins.to_a.join('|')})s?\b)
handler_params = %r(\b(#{self.handler_params.to_a.join('|')})\b)
references = %r(\b(#{self.references.to_a.join('|')})\b)
studio_properties = %r(\b(#{self.studio_properties.to_a.join('|')})\b)
studio_classes = %r(\b(#{self.studio_classes.to_a.join('|')})s?\b)
studio_commands = %r(\b(#{self.studio_commands.to_a.join('|')})\b)
identifiers = %r(\b([a-zA-Z]\w*)\b)
state :root do
rule /\s+/, Text::Whitespace
rule /¬\n/, Literal::String::Escape
rule /'s\s+/, Text
rule /(--|#).*?$/, Comment::Single
rule /\(\*/, Comment::Multiline
rule /[\(\){}!,.:]/, Punctuation
rule /(«)([^»]+)(»)/ do |match|
token Text, match[1]
token Name::Builtin, match[2]
token Text, match[3]
end
rule /\b((?:considering|ignoring)\s*)(application responses|case|diacriticals|hyphens|numeric strings|punctuation|white space)/ do |match|
token Keyword, match[1]
token Name::Builtin, match[2]
end
rule /(-|\*|\+|&|≠|>=?|<=?|=|≥|≤|\/|÷|\^)/, Operator
rule operators, Operator::Word
rule /^(\s*(?:on|end)\s+)'r'(%s)/ do |match|
token Keyword, match[1]
token Name::Function, match[2]
end
rule /^(\s*)(in|on|script|to)(\s+)/ do |match|
token Text, match[1]
token Keyword, match[2]
token Text, match[3]
end
rule classes do |match|
token Keyword, match[1]
token Name::Class, match[2]
end
rule commands, Name::Builtin
rule controls, Keyword
rule declarations, Keyword
rule reserved, Name::Builtin
rule builtins, Name::Builtin
rule handler_params, Name::Builtin
rule studio_properties, Name::Attribute
rule studio_classes, Name::Builtin
rule studio_commands, Name::Builtin
rule references, Name::Builtin
rule /"(\\\\|\\"|[^"])*"/, Literal::String::Double
rule identifiers, Name::Variable
rule /[-+]?(\d+\.\d*|\d*\.\d+)(E[-+][0-9]+)?/, Literal::Number::Float
rule /[-+]?\d+/, Literal::Number::Integer
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/pascal.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/pascal.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Pascal < RegexLexer
tag 'pascal'
title "Pascal"
desc 'a procedural programming language commonly used as a teaching language.'
filenames '*.pas'
mimetypes 'text/x-pascal'
id = /@?[_a-z]\w*/i
keywords = %w(
absolute abstract all and and_then array as asm assembler attribute
begin bindable case class const constructor delay destructor div do
downto else end except exit export exports external far file finalization
finally for forward function goto if implementation import in inc index
inherited initialization inline interface interrupt is label library
message mod module near nil not object of on only operator or or_else
otherwise out overload override packed pascal pow private procedure program
property protected public published qualified raise read record register
repeat resident resourcestring restricted safecall segment set shl shr
stdcall stored string then threadvar to try type unit until uses value var
view virtual while with write writeln xor
)
keywords_type = %w(
ansichar ansistring bool boolean byte bytebool cardinal char comp currency
double dword extended int64 integer iunknown longbool longint longword pansichar
pansistring pbool pboolean pbyte pbytearray pcardinal pchar pcomp pcurrency
pdate pdatetime pdouble pdword pextended phandle pint64 pinteger plongint plongword
pointer ppointer pshortint pshortstring psingle psmallint pstring pvariant pwidechar
pwidestring pword pwordarray pwordbool real real48 shortint shortstring single
smallint string tclass tdate tdatetime textfile thandle tobject ttime variant
widechar widestring word wordbool
)
state :whitespace do
# Spaces
rule /\s+/m, Text
# // Comments
rule %r((//).*$\n?), Comment::Single
# -- Comments
rule %r((--).*$\n?), Comment::Single
# (* Comments *)
rule %r(\(\*.*?\*\))m, Comment::Multiline
# { Comments }
rule %r(\{.*?\})m, Comment::Multiline
end
state :root do
mixin :whitespace
rule %r{((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?}, Num
rule %r{[~!@#\$%\^&\*\(\)\+`\-={}\[\]:;<>\?,\.\/\|\\]}, Punctuation
rule %r{'([^']|'')*'}, Str
rule /(true|false|nil)\b/i, Name::Builtin
rule /\b(#{keywords.join('|')})\b/i, Keyword
rule /\b(#{keywords_type.join('|')})\b/i, Keyword::Type
rule id, Name
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/r.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/r.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class R < RegexLexer
title "R"
desc 'The R statistics language (r-project.org)'
tag 'r'
aliases 'r', 'R', 's', 'S'
filenames '*.R', '*.r', '.Rhistory', '.Rprofile'
mimetypes 'text/x-r-source', 'text/x-r', 'text/x-R'
mimetypes 'text/x-r', 'application/x-r'
KEYWORDS = %w(if else for while repeat in next break function)
KEYWORD_CONSTANTS = %w(
NULL Inf TRUE FALSE NaN NA
NA_integer_ NA_real_ NA_complex_ NA_character_
)
BUILTIN_CONSTANTS = %w(LETTERS letters month.abb month.name pi T F)
# These are all the functions in `base` that are implemented as a
# `.Primitive`, minus those functions that are also keywords.
PRIMITIVE_FUNCTIONS = %w(
abs acos acosh all any anyNA Arg as.call as.character
as.complex as.double as.environment as.integer as.logical
as.null.default as.numeric as.raw asin asinh atan atanh attr
attributes baseenv browser c call ceiling class Conj cos cosh
cospi cummax cummin cumprod cumsum digamma dim dimnames
emptyenv exp expression floor forceAndCall gamma gc.time
globalenv Im interactive invisible is.array is.atomic is.call
is.character is.complex is.double is.environment is.expression
is.finite is.function is.infinite is.integer is.language
is.list is.logical is.matrix is.na is.name is.nan is.null
is.numeric is.object is.pairlist is.raw is.recursive is.single
is.symbol lazyLoadDBfetch length lgamma list log max min
missing Mod names nargs nzchar oldClass on.exit pos.to.env
proc.time prod quote range Re rep retracemem return round
seq_along seq_len seq.int sign signif sin sinh sinpi sqrt
standardGeneric substitute sum switch tan tanh tanpi tracemem
trigamma trunc unclass untracemem UseMethod xtfrm
)
def self.detect?(text)
return true if text.shebang? 'Rscript'
end
state :root do
rule /#'.*?$/, Comment::Doc
rule /#.*?$/, Comment::Single
rule /\s+/m, Text::Whitespace
rule /`[^`]+?`/, Name
rule /'(\\.|.)*?'/m, Str::Single
rule /"(\\.|.)*?"/m, Str::Double
rule /%[^%]*?%/, Operator
rule /0[xX][a-fA-F0-9]+([pP][0-9]+)?[Li]?/, Num::Hex
rule /[+-]?(\d+([.]\d+)?|[.]\d+)([eE][+-]?\d+)?[Li]?/,
Num
# Only recognize built-in functions when they are actually used as a
# function call, i.e. followed by an opening parenthesis.
# `Name::Builtin` would be more logical, but is usually not
# highlighted specifically; thus use `Name::Function`.
rule /\b(?<!.)(#{PRIMITIVE_FUNCTIONS.join('|')})(?=\()/, Name::Function
rule /[a-zA-Z.]([a-zA-Z_][\w.]*)?/ do |m|
if KEYWORDS.include? m[0]
token Keyword
elsif KEYWORD_CONSTANTS.include? m[0]
token Keyword::Constant
elsif BUILTIN_CONSTANTS.include? m[0]
token Name::Builtin
else
token Name
end
end
rule /[\[\]{}();,]/, Punctuation
rule %r([-<>?*+^/!=~$@:%&|]), Operator
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/smarty.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/smarty.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Smarty < TemplateLexer
title "Smarty"
desc 'Smarty Template Engine'
tag 'smarty'
aliases 'smarty'
filenames '*.tpl', '*.smarty'
mimetypes 'application/x-smarty', 'text/x-smarty'
def self.builtins
@builtins ||= %w(
append assign block call capture config_load debug extends
for foreach foreachelse break continue function if elseif
else include include_php insert ldelim rdelim literal nocache
php section sectionelse setfilter strip while
counter cycle eval fetch html_checkboxes html_image html_options
html_radios html_select_date html_select_time html_table
mailto math textformat
capitalize cat count_characters count_paragraphs
count_sentences count_words date_format default escape
from_charset indent lower nl2br regex_replace replace spacify
string_format strip strip_tags to_charset truncate unescape
upper wordwrap
)
end
state :root do
rule(/\{\s+/) { delegate parent }
# block comments
rule /\{\*.*?\*\}/m, Comment
rule /\{\/?(?![\s*])/ do
token Keyword
push :smarty
end
rule(/.*?(?={[\/a-zA-Z0-9$#*"'])|.*/m) { delegate parent }
rule(/.+/m) { delegate parent }
end
state :comment do
rule(/{\*/) { token Comment; push }
rule(/\*}/) { token Comment; pop! }
rule(/[^{}]+/m) { token Comment }
end
state :smarty do
# allow nested tags
rule /\{\/?(?![\s*])/ do
token Keyword
push :smarty
end
rule /}/, Keyword, :pop!
rule /\s+/m, Text
rule %r([~!%^&*()+=|\[\]:;,.<>/@?-]), Operator
rule /#[a-zA-Z_]\w*#/, Name::Variable
rule /\$[a-zA-Z_]\w*(\.\w+)*/, Name::Variable
rule /(true|false|null)\b/, Keyword::Constant
rule /[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?/, Num
rule /"(\\.|.)*?"/, Str::Double
rule /'(\\.|.)*?'/, Str::Single
rule /([a-zA-Z_]\w*)/ do |m|
if self.class.builtins.include? m[0]
token Name::Builtin
else
token Name::Attribute
end
end
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/elm.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/elm.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Elm < RegexLexer
title "Elm"
desc "The Elm programming language (http://elm-lang.org/)"
tag 'elm'
filenames '*.elm'
mimetypes 'text/x-elm'
# Keywords are logically grouped by lines
keywords = %w(
module exposing port
import as
type alias
if then else
case of
let in
)
state :root do
# Whitespaces
rule /\s+/m, Text
# Single line comments
rule /--.*/, Comment::Single
# Multiline comments
rule /{-/, Comment::Multiline, :multiline_comment
# Keywords
rule /\b(#{keywords.join('|')})\b/, Keyword
# Variable or a function
rule /[a-z][\w]*/, Name
# Underscore is a name for a variable, when it won't be used later
rule /_/, Name
# Type
rule /[A-Z][\w]*/, Keyword::Type
# Two symbol operators: -> :: // .. && || ++ |> <| << >> == /= <= >=
rule /(->|::|\/\/|\.\.|&&|\|\||\+\+|\|>|<\||>>|<<|==|\/=|<=|>=)/, Operator
# One symbol operators: + - / * % = < > ^ | !
rule /[+-\/*%=<>^\|!]/, Operator
# Lambda operator
rule /\\/, Operator
# Not standard Elm operators, but these symbols can be used for custom inflix operators. We need to highlight them as operators as well.
rule /[@\#$&~?]/, Operator
# Single, double quotes, and triple double quotes
rule /"""/, Str, :multiline_string
rule /'(\\.|.)'/, Str::Char
rule /"/, Str, :double_quote
# Numbers
rule /0x[\da-f]+/i, Num::Hex
rule /\d+e[+-]?\d+/i, Num::Float
rule /\d+\.\d+(e[+-]?\d+)?/i, Num::Float
rule /\d+/, Num::Integer
# Punctuation: [ ] ( ) , ; ` { } :
rule /[\[\](),;`{}:]/, Punctuation
end
# Multiline and nested commenting
state :multiline_comment do
rule /-}/, Comment::Multiline, :pop!
rule /{-/, Comment::Multiline, :multiline_comment
rule /[^-{}]+/, Comment::Multiline
rule /[-{}]/, Comment::Multiline
end
# Double quotes
state :double_quote do
rule /[^\\"]+/, Str::Double
rule /\\"/, Str::Escape
rule /"/, Str::Double, :pop!
end
# Multiple line string with tripple double quotes, e.g. """ multi """
state :multiline_string do
rule /\s*"""/, Str, :pop!
rule /.*/, Str
rule /\s*/, Str
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/rust.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/rust.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Rust < RegexLexer
title "Rust"
desc 'The Rust programming language (rust-lang.org)'
tag 'rust'
aliases 'rs',
# So that directives from https://github.com/budziq/rust-skeptic
# do not prevent highlighting.
'rust,no_run', 'rs,no_run',
'rust,ignore', 'rs,ignore',
'rust,should_panic', 'rs,should_panic'
filenames '*.rs'
mimetypes 'text/x-rust'
def self.detect?(text)
return true if text.shebang? 'rustc'
end
def self.keywords
@keywords ||= %w(
as assert break const copy do drop else enum extern fail false
fn for if impl let log loop match mod move mut priv pub pure
ref return self static struct true trait type unsafe use where
while box
)
end
def self.builtins
@builtins ||= Set.new %w(
Add BitAnd BitOr BitXor bool c_char c_double c_float char
c_int clock_t c_long c_longlong Cons Const Copy c_schar c_short
c_uchar c_uint c_ulong c_ulonglong c_ushort c_void dev_t DIR
dirent Div Either Eq Err f32 f64 Failure FILE float fpos_t
i16 i32 i64 i8 isize Index ino_t int intptr_t Left mode_t Modulo Mul
Neg Nil None Num off_t Ok Option Ord Owned pid_t Ptr ptrdiff_t
Right Send Shl Shr size_t Some ssize_t str Sub Success time_t
u16 u32 u64 u8 usize uint uintptr_t
Box Vec String Gc Rc Arc
)
end
def macro_closed?
@macro_delims.values.all?(&:zero?)
end
start {
@macro_delims = { ']' => 0, ')' => 0, '}' => 0 }
}
delim_map = { '[' => ']', '(' => ')', '{' => '}' }
id = /[a-z_]\w*/i
hex = /[0-9a-f]/i
escapes = %r(
\\ ([nrt'\\] | x#{hex}{2} | u#{hex}{4} | U#{hex}{8})
)x
size = /8|16|32|64/
state :start_line do
mixin :whitespace
rule /\s+/, Text
rule /#\[/ do
token Name::Decorator; push :attribute
end
rule(//) { pop! }
rule /#\s[^\n]*/, Comment::Preproc
end
state :attribute do
mixin :whitespace
mixin :has_literals
rule /[(,)=]/, Name::Decorator
rule /\]/, Name::Decorator, :pop!
rule id, Name::Decorator
end
state :whitespace do
rule /\s+/, Text
rule %r(//[^\n]*), Comment
rule %r(/[*].*?[*]/)m, Comment::Multiline
end
state :root do
rule /\n/, Text, :start_line
mixin :whitespace
rule /\b(?:#{Rust.keywords.join('|')})\b/, Keyword
mixin :has_literals
rule %r([=-]>), Keyword
rule %r(<->), Keyword
rule /[()\[\]{}|,:;]/, Punctuation
rule /[*!@~&+%^<>=-\?]|\.{2,3}/, Operator
rule /([.]\s*)?#{id}(?=\s*[(])/m, Name::Function
rule /[.]\s*#{id}/, Name::Property
rule /(#{id})(::)/m do
groups Name::Namespace, Punctuation
end
# macros
rule /\bmacro_rules!/, Name::Decorator, :macro_rules
rule /#{id}!/, Name::Decorator, :macro
rule /'#{id}/, Name::Variable
rule /#{id}/ do |m|
name = m[0]
if self.class.builtins.include? name
token Name::Builtin
else
token Name
end
end
end
state :macro do
mixin :has_literals
rule /[\[{(]/ do |m|
@macro_delims[delim_map[m[0]]] += 1
puts " macro_delims: #{@macro_delims.inspect}" if @debug
token Punctuation
end
rule /[\]})]/ do |m|
@macro_delims[m[0]] -= 1
puts " macro_delims: #{@macro_delims.inspect}" if @debug
pop! if macro_closed?
token Punctuation
end
# same as the rule in root, but don't push another macro state
rule /#{id}!/, Name::Decorator
mixin :root
# No syntax errors in macros
rule /./, Text
end
state :macro_rules do
rule /[$]#{id}(:#{id})?/, Name::Variable
rule /[$]/, Name::Variable
mixin :macro
end
state :has_literals do
# constants
rule /\b(?:true|false|nil)\b/, Keyword::Constant
# characters
rule %r(
' (?: #{escapes} | [^\\] ) '
)x, Str::Char
rule /"/, Str, :string
# numbers
dot = /[.][0-9_]+/
exp = /e[-+]?[0-9_]+/
flt = /f32|f64/
rule %r(
[0-9]+
(#{dot} #{exp}? #{flt}?
|#{dot}? #{exp} #{flt}?
|#{dot}? #{exp}? #{flt}
)
)x, Num::Float
rule %r(
( 0b[10_]+
| 0x[0-9a-fA-F-]+
| [0-9]+
) (u#{size}?|i#{size})?
)x, Num::Integer
end
state :string do
rule /"/, Str, :pop!
rule escapes, Str::Escape
rule /%%/, Str::Interpol
rule %r(
%
( [0-9]+ [$] )? # Parameter
[0#+-]* # Flag
( [0-9]+ [$]? )? # Width
( [.] [0-9]+ )? # Precision
[bcdfiostuxX?] # Type
)x, Str::Interpol
rule /[^%"\\]+/m, Str
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/smalltalk.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/smalltalk.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Smalltalk < RegexLexer
title "Smalltalk"
desc 'The Smalltalk programming language'
tag 'smalltalk'
aliases 'st', 'squeak'
filenames '*.st'
mimetypes 'text/x-smalltalk'
ops = %r([-+*/\\~<>=|&!?,@%])
state :root do
rule /(<)(\w+:)(.*?)(>)/ do
groups Punctuation, Keyword, Text, Punctuation
end
# mixin :squeak_fileout
mixin :whitespaces
mixin :method_definition
rule /([|])([\w\s]*)([|])/ do
groups Punctuation, Name::Variable, Punctuation
end
mixin :objects
rule /\^|:=|_/, Operator
rule /[)}\]]/, Punctuation, :after_object
rule /[({\[!]/, Punctuation
end
state :method_definition do
rule /([a-z]\w*:)(\s*)(\w+)/i do
groups Name::Function, Text, Name::Variable
end
rule /^(\s*)(\b[a-z]\w*\b)(\s*)$/i do
groups Text, Name::Function, Text
end
rule %r(^(\s*)(#{ops}+)(\s*)(\w+)(\s*)$) do
groups Text, Name::Function, Text, Name::Variable, Text
end
end
state :block_variables do
mixin :whitespaces
rule /(:)(\s*)(\w+)/ do
groups Operator, Text, Name::Variable
end
rule /[|]/, Punctuation, :pop!
rule(//) { pop! }
end
state :literals do
rule /'(''|.)*?'/m, Str, :after_object
rule /[$]./, Str::Char, :after_object
rule /#[(]/, Str::Symbol, :parenth
rule /(\d+r)?-?\d+(\.\d+)?(e-?\d+)?/,
Num, :after_object
rule /#("[^"]*"|#{ops}+|[\w:]+)/,
Str::Symbol, :after_object
end
state :parenth do
rule /[)]/ do
token Str::Symbol
goto :after_object
end
mixin :inner_parenth
end
state :inner_parenth do
rule /#[(]/, Str::Symbol, :inner_parenth
rule /[)]/, Str::Symbol, :pop!
mixin :whitespaces
mixin :literals
rule /(#{ops}|[\w:])+/, Str::Symbol
end
state :whitespaces do
rule /! !$/, Keyword # squeak chunk delimiter
rule /\s+/m, Text
rule /".*?"/m, Comment
end
state :objects do
rule /\[/, Punctuation, :block_variables
rule /(self|super|true|false|nil|thisContext)\b/,
Name::Builtin::Pseudo, :after_object
rule /[A-Z]\w*(?!:)\b/, Name::Class, :after_object
rule /[a-z]\w*(?!:)\b/, Name::Variable, :after_object
mixin :literals
end
state :after_object do
mixin :whitespaces
rule /(ifTrue|ifFalse|whileTrue|whileFalse|timesRepeat):/,
Name::Builtin, :pop!
rule /new(?!:)\b/, Name::Builtin
rule /:=|_/, Operator, :pop!
rule /[a-z]+\w*:/i, Name::Function, :pop!
rule /[a-z]+\w*/i, Name::Function
rule /#{ops}+/, Name::Function, :pop!
rule /[.]/, Punctuation, :pop!
rule /;/, Punctuation
rule(//) { pop! }
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/haskell.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/haskell.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Haskell < RegexLexer
title "Haskell"
desc "The Haskell programming language (haskell.org)"
tag 'haskell'
aliases 'hs'
filenames '*.hs'
mimetypes 'text/x-haskell'
def self.detect?(text)
return true if text.shebang?('runhaskell')
end
reserved = %w(
_ case class data default deriving do else if in
infix[lr]? instance let newtype of then type where
)
ascii = %w(
NUL SOH [SE]TX EOT ENQ ACK BEL BS HT LF VT FF CR S[OI] DLE
DC[1-4] NAK SYN ETB CAN EM SUB ESC [FGRU]S SP DEL
)
state :basic do
rule /\s+/m, Text
rule /{-#/, Comment::Preproc, :comment_preproc
rule /{-/, Comment::Multiline, :comment
rule /^--\s+\|.*?$/, Comment::Doc
# this is complicated in order to support custom symbols
# like -->
rule /--(?![!#\$\%&*+.\/<=>?@\^\|_~]).*?$/, Comment::Single
end
# nested commenting
state :comment do
rule /-}/, Comment::Multiline, :pop!
rule /{-/, Comment::Multiline, :comment
rule /[^-{}]+/, Comment::Multiline
rule /[-{}]/, Comment::Multiline
end
state :comment_preproc do
rule /-}/, Comment::Preproc, :pop!
rule /{-/, Comment::Preproc, :comment
rule /[^-{}]+/, Comment::Preproc
rule /[-{}]/, Comment::Preproc
end
state :root do
mixin :basic
rule /\bimport\b/, Keyword::Reserved, :import
rule /\bmodule\b/, Keyword::Reserved, :module
rule /\b(?:#{reserved.join('|')})\b/, Keyword::Reserved
# not sure why, but ^ doesn't work here
# rule /^[_a-z][\w']*/, Name::Function
rule /[_a-z][\w']*/, Name
rule /[A-Z][\w']*/, Keyword::Type
# lambda operator
rule %r(\\(?![:!#\$\%&*+.\\/<=>?@^\|~-]+)), Name::Function
# special operators
rule %r((<-|::|->|=>|=)(?![:!#\$\%&*+.\\/<=>?@^\|~-]+)), Operator
# constructor/type operators
rule %r(:[:!#\$\%&*+.\\/<=>?@^\|~-]*), Operator
# other operators
rule %r([:!#\$\%&*+.\\/<=>?@^\|~-]+), Operator
rule /\d+e[+-]?\d+/i, Num::Float
rule /\d+\.\d+(e[+-]?\d+)?/i, Num::Float
rule /0o[0-7]+/i, Num::Oct
rule /0x[\da-f]+/i, Num::Hex
rule /\d+/, Num::Integer
rule /'/, Str::Char, :character
rule /"/, Str, :string
rule /\[\s*\]/, Keyword::Type
rule /\(\s*\)/, Name::Builtin
# Quasiquotations
rule /(\[)([_a-z][\w']*)(\|)/ do |m|
token Operator, m[1]
token Name, m[2]
token Operator, m[3]
push :quasiquotation
end
rule /[\[\](),;`{}]/, Punctuation
end
state :import do
rule /\s+/, Text
rule /"/, Str, :string
rule /\bqualified\b/, Keyword
# import X as Y
rule /([A-Z][\w.]*)(\s+)(as)(\s+)([A-Z][a-zA-Z0-9_.]*)/ do
groups(
Name::Namespace, # X
Text, Keyword, # as
Text, Name # Y
)
pop!
end
# import X hiding (functions)
rule /([A-Z][\w.]*)(\s+)(hiding)(\s+)(\()/ do
groups(
Name::Namespace, # X
Text, Keyword, # hiding
Text, Punctuation # (
)
goto :funclist
end
# import X (functions)
rule /([A-Z][\w.]*)(\s+)(\()/ do
groups(
Name::Namespace, # X
Text,
Punctuation # (
)
goto :funclist
end
rule /[\w.]+/, Name::Namespace, :pop!
end
state :module do
rule /\s+/, Text
# module Foo (functions)
rule /([A-Z][\w.]*)(\s+)(\()/ do
groups Name::Namespace, Text, Punctuation
push :funclist
end
rule /\bwhere\b/, Keyword::Reserved, :pop!
rule /[A-Z][a-zA-Z0-9_.]*/, Name::Namespace, :pop!
end
state :funclist do
mixin :basic
rule /[A-Z]\w*/, Keyword::Type
rule /(_[\w\']+|[a-z][\w\']*)/, Name::Function
rule /,/, Punctuation
rule /[:!#\$\%&*+.\\\/<=>?@^\|~-]+/, Operator
rule /\(/, Punctuation, :funclist
rule /\)/, Punctuation, :pop!
end
state :character do
rule /\\/ do
token Str::Escape
goto :character_end
push :escape
end
rule /./ do
token Str::Char
goto :character_end
end
end
state :character_end do
rule /'/, Str::Char, :pop!
rule /./, Error, :pop!
end
state :quasiquotation do
rule /\|\]/, Operator, :pop!
rule /[^\|]+/m, Text
rule /\|/, Text
end
state :string do
rule /"/, Str, :pop!
rule /\\/, Str::Escape, :escape
rule /[^\\"]+/, Str
end
state :escape do
rule /[abfnrtv"'&\\]/, Str::Escape, :pop!
rule /\^[\]\[A-Z@\^_]/, Str::Escape, :pop!
rule /#{ascii.join('|')}/, Str::Escape, :pop!
rule /o[0-7]+/i, Str::Escape, :pop!
rule /x[\da-f]+/i, Str::Escape, :pop!
rule /\d+/, Str::Escape, :pop!
rule /\s+\\/, Str::Escape, :pop!
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/slim.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/slim.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
# A lexer for the Slim tempalte language
# @see http://slim-lang.org
class Slim < RegexLexer
include Indentation
title "Slim"
desc 'The Slim template language'
tag 'slim'
filenames '*.slim'
# Ruby identifier characters
ruby_chars = /[\w\!\?\@\$]/
# Since you are allowed to wrap lines with a backslash, include \\\n in characters
dot = /(\\\n|.)/
def ruby
@ruby ||= Ruby.new(options)
end
def html
@html ||= HTML.new(options)
end
def filters
@filters ||= {
'ruby' => ruby,
'erb' => ERB.new(options),
'javascript' => Javascript.new(options),
'css' => CSS.new(options),
'coffee' => Coffeescript.new(options),
'markdown' => Markdown.new(options),
'scss' => Scss.new(options),
'sass' => Sass.new(options)
}
end
start { ruby.reset!; html.reset! }
state :root do
rule /\s*\n/, Text
rule(/\s*/) { |m| token Text; indentation(m[0]) }
end
state :content do
mixin :css
rule /\/#{dot}*/, Comment, :indented_block
rule /(doctype)(\s+)(.*)/ do
groups Name::Namespace, Text::Whitespace, Text
pop!
end
# filters, shamelessly ripped from HAML
rule /(\w*):\s*\n/ do |m|
token Name::Decorator
pop!
starts_block :filter_block
filter_name = m[1].strip
@filter_lexer = self.filters[filter_name]
@filter_lexer.reset! unless @filter_lexer.nil?
puts " slim: filter #{filter_name.inspect} #{@filter_lexer.inspect}" if @debug
end
# Text
rule %r([\|'](?=\s)) do
token Punctuation
pop!
starts_block :plain_block
goto :plain_block
end
rule /-|==|=/, Punctuation, :ruby_line
# Dynamic tags
rule /(\*)(#{ruby_chars}+\(.*?\))/ do |m|
token Punctuation, m[1]
delegate ruby, m[2]
push :tag
end
rule /(\*)(#{ruby_chars}+)/ do |m|
token Punctuation, m[1]
delegate ruby, m[2]
push :tag
end
#rule /<\w+(?=.*>)/, Keyword::Constant, :tag # Maybe do this, look ahead and stuff
rule %r((</?[\w\s\=\'\"]+?/?>)) do |m| # Dirty html
delegate html, m[1]
pop!
end
# Ordinary slim tags
rule /\w+/, Name::Tag, :tag
end
state :tag do
mixin :css
mixin :indented_block
mixin :interpolation
# Whitespace control
rule /[<>]/, Punctuation
# Trim whitespace
rule /\s+?/, Text::Whitespace
# Splats, these two might be mergable?
rule /(\*)(#{ruby_chars}+)/ do |m|
token Punctuation, m[1]
delegate ruby, m[2]
end
rule /(\*)(\{#{dot}+?\})/ do |m|
token Punctuation, m[1]
delegate ruby, m[2]
end
# Attributes
rule /([\w\-]+)(\s*)(\=)/ do |m|
token Name::Attribute, m[1]
token Text::Whitespace, m[2]
token Punctuation, m[3]
push :html_attr
end
# Ruby value
rule /(\=)(#{dot}+)/ do |m|
token Punctuation, m[1]
#token Keyword::Constant, m[2]
delegate ruby, m[2]
end
# HTML Entities
rule(/&\S*?;/, Name::Entity)
rule /#{dot}+?/, Text
rule /\s*\n/, Text::Whitespace, :pop!
end
state :css do
rule(/\.[\w-]*/) { token Name::Class; goto :tag }
rule(/#[a-zA-Z][\w:-]*/) { token Name::Function; goto :tag }
end
state :html_attr do
# Strings, double/single quoted
rule(/\s*(['"])#{dot}*?\1/, Literal::String, :pop!)
# Ruby stuff
rule(/(#{ruby_chars}+\(.*?\))/) { |m| delegate ruby, m[1]; pop! }
rule(/(#{ruby_chars}+)/) { |m| delegate ruby, m[1]; pop! }
rule /\s+/, Text::Whitespace
end
state :ruby_line do
# Need at top
mixin :indented_block
rule(/,\s*\n/) { delegate ruby }
rule /[ ]\|[ \t]*\n/, Str::Escape
rule(/.*?(?=(,$| \|)?[ \t]*$)/) { delegate ruby }
end
state :filter_block do
rule /([^#\n]|#[^{\n]|(\\\\)*\\#\{)+/ do
if @filter_lexer
delegate @filter_lexer
else
token Name::Decorator
end
end
mixin :interpolation
mixin :indented_block
end
state :plain_block do
mixin :interpolation
rule %r((</?[\w\s\=\'\"]+?/?>)) do |m| # Dirty html
delegate html, m[1]
end
# HTML Entities
rule(/&\S*?;/, Name::Entity)
#rule /([^#\n]|#[^{\n]|(\\\\)*\\#\{)+/ do
rule /#{dot}+?/, Text
mixin :indented_block
end
state :interpolation do
rule /#[{]/, Str::Interpol, :ruby_interp
end
state :ruby_interp do
rule /[}]/, Str::Interpol, :pop!
mixin :ruby_interp_inner
end
state :ruby_interp_inner do
rule(/[{]/) { delegate ruby; push :ruby_interp_inner }
rule(/[}]/) { delegate ruby; pop! }
rule(/[^{}]+/) { delegate ruby }
end
state :indented_block do
rule(/(?<!\\)\n/) { token Text; reset_stack }
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/llvm.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/llvm.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class LLVM < RegexLexer
title "LLVM"
desc 'The LLVM Compiler Infrastructure (http://llvm.org/)'
tag 'llvm'
filenames '*.ll'
mimetypes 'text/x-llvm'
string = /"[^"]*?"/
identifier = /([-a-zA-Z$._][-a-zA-Z$._0-9]*|#{string})/
state :basic do
rule /;.*?$/, Comment::Single
rule /\s+/, Text
rule /#{identifier}\s*:/, Name::Label
rule /@(#{identifier}|\d+)/, Name::Variable::Global
rule /(%|!)#{identifier}/, Name::Variable
rule /(%|!)\d+/, Name::Variable
rule /c?#{string}/, Str
rule /0[xX][a-fA-F0-9]+/, Num
rule /-?\d+(?:[.]\d+)?(?:[eE][-+]?\d+(?:[.]\d+)?)?/, Num
rule /[=<>{}\[\]()*.,!]|x/, Punctuation
end
builtin_types = %w(
void float double half x86_fp80 x86mmx fp128 ppc_fp128 label metadata
)
state :types do
rule /i[1-9]\d*/, Keyword::Type
rule /#{builtin_types.join('|')}/, Keyword::Type
end
builtin_keywords = %w(
begin end true false declare define global constant personality private
landingpad linker_private internal available_externally linkonce_odr
linkonce weak weak_odr appending dllimport dllexport common default
hidden protected extern_weak external thread_local zeroinitializer
undef null to tail target triple datalayout volatile nuw nsw nnan ninf
nsz arcp fast exact inbounds align addrspace section alias module asm
sideeffect gc dbg ccc fastcc coldcc x86_stdcallcc x86_fastcallcc
arm_apcscc arm_aapcscc arm_aapcs_vfpcc ptx_device ptx_kernel cc
c signext zeroext inreg sret nounwind noreturn noalias nocapture byval
nest readnone readonly inlinehint noinline alwaysinline optsize ssp
sspreq noredzone noimplicitfloat naked type opaque eq ne slt sgt sle
sge ult ugt ule uge oeq one olt ogt ole oge ord uno unnamed_addr ueq
une uwtable x
)
builtin_instructions = %w(
add fadd sub fsub mul fmul udiv sdiv fdiv urem srem frem shl lshr ashr
and or xor icmp fcmp phi call catch trunc zext sext fptrunc fpext
uitofp sitofp fptoui fptosi inttoptr ptrtoint bitcast select va_arg ret
br switch invoke unwind unreachable malloc alloca free load store
getelementptr extractelement insertelement shufflevector getresult
extractvalue insertvalue cleanup resume
)
state :keywords do
rule /#{builtin_instructions.join('|')}/, Keyword
rule /#{builtin_keywords.join('|')}/, Keyword
end
state :root do
mixin :basic
mixin :keywords
mixin :types
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/kotlin.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/kotlin.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Kotlin < RegexLexer
# https://kotlinlang.org/docs/reference/grammar.html
title "Kotlin"
desc "Kotlin Programming Language (http://kotlinlang.org)"
tag 'kotlin'
filenames '*.kt', '*.kts'
mimetypes 'text/x-kotlin'
keywords = %w(
abstract annotation as break by catch class companion const
constructor continue crossinline do dynamic else enum
external false final finally for fun get if import in infix
inline inner interface internal is lateinit noinline null
object open operator out override package private protected
public reified return sealed set super tailrec this throw
true try typealias typeof val var vararg when where while
yield
)
name = %r'@?[_\p{Lu}\p{Ll}\p{Lt}\p{Lm}\p{Nl}][\p{Lu}\p{Ll}\p{Lt}\p{Lm}\p{Nl}\p{Nd}\p{Pc}\p{Cf}\p{Mn}\p{Mc}]*'
name_backtick = %r'#{name}|`#{name}`'
id = %r'(#{name_backtick})'
state :root do
rule %r'(\))(\s*)(:)(\s+)(#{name_backtick})(<)' do
groups Punctuation, Text, Punctuation, Text, Name::Class, Punctuation
push :generic_parameters
end
rule %r'(\))(\s*)(:)(\s+)(#{name_backtick})' do
groups Punctuation, Text, Punctuation, Text, Name::Class
end
rule %r'\b(companion)(\s+)(object)\b' do
groups Keyword, Text, Keyword
end
rule %r'\b(class|data\s+class|interface|object)(\s+)' do
groups Keyword::Declaration, Text
push :class
end
rule %r'\b(fun)(\s+)' do
groups Keyword, Text
push :function
end
rule %r'(#{name_backtick})(:)(\s+)(#{name_backtick})(<)' do
groups Name::Variable, Punctuation, Text, Name::Class, Punctuation
push :generic_parameters
end
rule %r'(#{name_backtick})(:)(\s+)(#{name_backtick})' do
groups Name::Variable, Punctuation, Text, Name::Class
end
rule %r'\b(package|import)(\s+)' do
groups Keyword, Text
push :package
end
rule %r'\b(val|var)(\s+)(\()' do
groups Keyword::Declaration, Text, Punctuation
push :destructure
end
rule %r'\b(val|var)(\s+)' do
groups Keyword::Declaration, Text
push :property
end
rule %r/\bfun\b/, Keyword
rule /\b(?:#{keywords.join('|')})\b/, Keyword
rule %r'^\s*\[.*?\]', Name::Attribute
rule %r'[^\S\n]+', Text
rule %r'\\\n', Text # line continuation
rule %r'//.*?$', Comment::Single
rule %r'/[*].*?[*]/'m, Comment::Multiline
rule %r'\n', Text
rule %r'::|!!|\?[:.]', Operator
rule %r"(\.\.)", Operator
rule %r'[~!%^&*()+=|\[\]:;,.<>/?-]', Punctuation
rule %r'[{}]', Punctuation
rule %r'@"(""|[^"])*"'m, Str
rule %r'""".*?"""'m, Str
rule %r'"(\\\\|\\"|[^"\n])*["\n]'m, Str
rule %r"'\\.'|'[^\\]'", Str::Char
rule %r"[0-9](\.[0-9]+)?([eE][+-][0-9]+)?[flFL]?|0[xX][0-9a-fA-F]+[Ll]?", Num
rule /@#{id}/, Name::Decorator
rule id, Name
end
state :package do
rule /\S+/, Name::Namespace, :pop!
end
state :class do
rule id, Name::Class, :pop!
end
state :function do
rule %r'(<)', Punctuation, :generic_parameters
rule %r'(\s+)', Text
rule %r'(#{name_backtick})(\.)' do
groups Name::Class, Punctuation
end
rule id, Name::Function, :pop!
end
state :generic_parameters do
rule id, Name::Class
rule %r'(,)', Punctuation
rule %r'(\s+)', Text
rule %r'(>)', Punctuation, :pop!
end
state :property do
rule id, Name::Property, :pop!
end
state :destructure do
rule %r'(,)', Punctuation
rule %r'(\))', Punctuation, :pop!
rule %r'(\s+)', Text
rule id, Name::Property
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/lua.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/lua.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Lua < RegexLexer
title "Lua"
desc "Lua (http://www.lua.org)"
tag 'lua'
filenames '*.lua', '*.wlua'
mimetypes 'text/x-lua', 'application/x-lua'
option :function_highlighting, 'Whether to highlight builtin functions (default: true)'
option :disabled_modules, 'builtin modules to disable'
def initialize(opts={})
@function_highlighting = opts.delete(:function_highlighting) { true }
@disabled_modules = opts.delete(:disabled_modules) { [] }
super(opts)
end
def self.detect?(text)
return true if text.shebang? 'lua'
end
def self.builtins
load Pathname.new(__FILE__).dirname.join('lua/builtins.rb')
self.builtins
end
def builtins
return [] unless @function_highlighting
@builtins ||= Set.new.tap do |builtins|
self.class.builtins.each do |mod, fns|
next if @disabled_modules.include? mod
builtins.merge(fns)
end
end
end
state :root do
# lua allows a file to start with a shebang
rule %r(#!(.*?)$), Comment::Preproc
rule //, Text, :base
end
state :base do
rule %r(--\[(=*)\[.*?\]\1\])m, Comment::Multiline
rule %r(--.*$), Comment::Single
rule %r((?i)(\d*\.\d+|\d+\.\d*)(e[+-]?\d+)?'), Num::Float
rule %r((?i)\d+e[+-]?\d+), Num::Float
rule %r((?i)0x[0-9a-f]*), Num::Hex
rule %r(\d+), Num::Integer
rule %r(\n), Text
rule %r([^\S\n]), Text
# multiline strings
rule %r(\[(=*)\[.*?\]\1\])m, Str
rule %r((==|~=|<=|>=|\.\.\.|\.\.|[=+\-*/%^<>#])), Operator
rule %r([\[\]\{\}\(\)\.,:;]), Punctuation
rule %r((and|or|not)\b), Operator::Word
rule %r((break|do|else|elseif|end|for|if|in|repeat|return|then|until|while)\b), Keyword
rule %r((local)\b), Keyword::Declaration
rule %r((true|false|nil)\b), Keyword::Constant
rule %r((function)\b), Keyword, :function_name
rule %r([A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)?) do |m|
name = m[0]
if self.builtins.include?(name)
token Name::Builtin
elsif name =~ /\./
a, b = name.split('.', 2)
token Name, a
token Punctuation, '.'
token Name, b
else
token Name
end
end
rule %r('), Str::Single, :escape_sqs
rule %r("), Str::Double, :escape_dqs
end
state :function_name do
rule /\s+/, Text
rule %r((?:([A-Za-z_][A-Za-z0-9_]*)(\.))?([A-Za-z_][A-Za-z0-9_]*)) do
groups Name::Class, Punctuation, Name::Function
pop!
end
# inline function
rule %r(\(), Punctuation, :pop!
end
state :escape_sqs do
mixin :string_escape
mixin :sqs
end
state :escape_dqs do
mixin :string_escape
mixin :dqs
end
state :string_escape do
rule %r(\\([abfnrtv\\"']|\d{1,3})), Str::Escape
end
state :sqs do
rule %r('), Str::Single, :pop!
rule %r([^']+), Str::Single
end
state :dqs do
rule %r("), Str::Double, :pop!
rule %r([^"]+), Str::Double
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/mathematica.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/mathematica.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Mathematica < RegexLexer
title "Mathematica"
desc "Wolfram Mathematica, the world's definitive system for modern technical computing."
tag 'mathematica'
aliases 'wl'
filenames '*.m', '*.wl'
mimetypes 'application/vnd.wolfram.mathematica.package', 'application/vnd.wolfram.wl'
# Mathematica has various input forms for numbers. We need to handle numbers in bases, precision, accuracy,
# and *^ scientific notation. All this works for integers and real numbers. Some examples
# 1 1234567 1.1 .3 0.2 1*^10 2*^+10 3*^-10
# 1`1 1``1 1.2` 1.2``1.234*^-10 1.2``1.234*^+10 1.2``1.234*^10
# 2^^01001 10^^1.2``20.1234*^-10
base = /(?:\d+)/
number = /(?:\.\d+|\d+\.\d*|\d+)/
number_base = /(?:\.\w+|\w+\.\w*|\w+)/
precision = /`(`?#{number})?/
operators = /[+\-*\/|,;.:@~=><&`'^?!_%]/
braces = /[\[\](){}]/
string = /"(\\\\|\\"|[^"])*"/
# symbols and namespaced symbols. Note the special form \[Gamma] for named characters. These are also symbols.
# Module With Block Integrate Table Plot
# x32 $x x$ $Context` Context123`$x `Private`Context
# \[Gamma] \[Alpha]x32 Context`\[Xi]
identifier = /[a-zA-Z$][$a-zA-Z0-9]*/
named_character = /\\\[#{identifier}\]/
symbol = /(#{identifier}|#{named_character})+/
context_symbol = /`?#{symbol}(`#{symbol})*`?/
# Slots for pure functions.
# Examples: # ## #1 ##3 #Test #"Test" #[Test] #["Test"]
association_slot = /#(#{identifier}|\"#{identifier}\")/
slot = /#{association_slot}|#[0-9]*/
# Handling of message like symbol::usage or symbol::"argx"
message = /::(#{identifier}|#{string})/
# Highlighting of the special in and out markers that are prepended when you copy a cell
in_out = /(In|Out)\[[0-9]+\]:?=/
# Although Module, With and Block are normal built-in symbols, we give them a special treatment as they are
# the most important expressions for defining local variables
def self.keywords
@keywords = Set.new %w(
Module With Block
)
end
# The list of built-in symbols comes from a wolfram server and is created automatically by rake
def self.builtins
load Pathname.new(__FILE__).dirname.join('mathematica/builtins.rb')
self.builtins
end
state :root do
rule /\s+/, Text::Whitespace
rule /\(\*/, Comment, :comment
rule /#{base}\^\^#{number_base}#{precision}?(\*\^[+-]?\d+)?/, Num # a number with a base
rule /(?:#{number}#{precision}?(?:\*\^[+-]?\d+)?)/, Num # all other numbers
rule message, Name::Tag
rule in_out, Generic::Prompt
rule /#{context_symbol}/m do |m|
match = m[0]
if self.class.keywords.include? match
token Name::Builtin::Pseudo
elsif self.class.builtins.include? match
token Name::Builtin
else
token Name::Variable
end
end
rule slot, Name::Function
rule operators, Operator
rule braces, Punctuation
rule string, Str
end
# Allow for nested comments and special treatment of ::Section:: or :Author: markup
state :comment do
rule /\(\*/, Comment, :comment
rule /\*\)/, Comment, :pop!
rule /::#{identifier}::/, Comment::Preproc
rule /[ ]:(#{identifier}|[^\S])+:[ ]/, Comment::Preproc
rule /./, Comment
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/q.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/q.rb | # frozen_string_literal: true
module Rouge
module Lexers
class Q < RegexLexer
title 'Q'
desc 'The Q programming language (kx.com)'
tag 'q'
aliases 'kdb+'
filenames '*.q'
mimetypes 'text/x-q', 'application/x-q'
identifier = /\.?[a-z][a-z0-9_.]*/i
def self.keywords
@keywords ||= %w[do if while select update delete exec from by]
end
def self.word_operators
@word_operators ||= %w[
and or except inter like each cross vs sv within where in asof bin binr cor cov cut ej fby
div ij insert lj ljf mavg mcount mdev mmax mmin mmu mod msum over prior peach pj scan scov setenv ss
sublist uj union upsert wavg wsum xasc xbar xcol xcols xdesc xexp xgroup xkey xlog xprev xrank
]
end
def self.builtins
@builtins ||= %w[
first enlist value type get set count string key max min sum prd last flip distinct raze neg
desc differ dsave dev eval exit exp fills fkeys floor getenv group gtime hclose hcount hdel hopen hsym
iasc idesc inv keys load log lsq ltime ltrim maxs md5 med meta mins next parse plist prds prev rand rank ratios
read0 read1 reciprocal reverse rload rotate rsave rtrim save sdev show signum sin sqrt ssr sums svar system
tables tan til trim txf ungroup var view views wj wj1 ww
]
end
state :root do
# q allows a file to start with a shebang
rule /#!(.*?)$/, Comment::Preproc, :top
rule //, Text, :top
end
state :top do
# indented lines at the top of the file are ignored by q
rule /^[ \t\r]+.*$/, Comment::Special
rule /\n+/, Text
rule //, Text, :base
end
state :base do
rule /\n+/m, Text
rule(/^.\)/, Keyword::Declaration)
# Identifiers, word operators, etc.
rule /#{identifier}/ do |m|
if self.class.keywords.include? m[0]
token Keyword
elsif self.class.word_operators.include? m[0]
token Operator::Word
elsif self.class.builtins.include? m[0]
token Name::Builtin
elsif /^\.[zQqho]\./ =~ m[0]
token Name::Constant
else
token Name
end
end
# White space and comments
rule(%r{[ \t\r]\/.*$}, Comment::Single)
rule(/[ \t\r]+/, Text::Whitespace)
rule(%r{^/$.*?^\\$}m, Comment::Multiline)
rule(%r{^\/[^\n]*$(\n[^\S\n]+.*$)*}, Comment::Multiline)
# til EOF comment
rule(/^\\$/, Comment, :bottom)
rule(/^\\\\\s+/, Keyword, :bottom)
# Literals
## strings
rule(/"/, Str, :string)
## timespan/stamp constants
rule(/(?:\d+D|\d{4}\.[01]\d\.[0123]\d[DT])(?:[012]\d:[0-5]\d(?::[0-5]\d(?:\.\d+)?)?|([012]\d)?)[zpn]?\b/,
Literal::Date)
## time/minute/second constants
rule(/[012]\d:[0-5]\d(?::[0-5]\d(\.\d+)?)?[uvtpn]?\b/, Literal::Date)
## date constants
rule(/\d{4}\.[01]\d\.[0-3]\d[dpnzm]?\b/, Literal::Date)
## special values
rule(/0[nNwW][hijefcpmdznuvt]?/, Keyword::Constant)
# operators to match before numbers
rule(%r{'|\/:|\\:|':|\\|\/|0:|1:|2:}, Operator)
## numbers
rule(/(\d+[.]\d*|[.]\d+)(e[+-]?\d+)?[ef]?/, Num::Float)
rule(/\d+e[+-]?\d+[ef]?/, Num::Float)
rule(/\d+[ef]/, Num::Float)
rule(/0x[0-9a-f]+/i, Num::Hex)
rule(/[01]+b/, Num::Bin)
rule(/[0-9]+[hij]?/, Num::Integer)
## symbols and paths
rule(%r{(`:[:a-z0-9._\/]*|`(?:[a-z0-9.][:a-z0-9._]*)?)}i, Str::Symbol)
rule(/(?:<=|>=|<>|::)|[?:$%&|@._#*^\-+~,!><=]:?/, Operator)
rule /[{}\[\]();]/, Punctuation
# commands
rule(/\\.*\n/, Text)
end
state :string do
rule(/"/, Str, :pop!)
rule /\\([\\nr]|[01][0-7]{2})/, Str::Escape
rule /[^\\"\n]+/, Str
rule /\\/, Str # stray backslash
end
state :bottom do
rule /.*\z/m, Comment::Multiline
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/scala.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/scala.rb | # -*- coding: utf-8 #
# frozen_string_literal: true
module Rouge
module Lexers
class Scala < RegexLexer
title "Scala"
desc "The Scala programming language (scala-lang.org)"
tag 'scala'
aliases 'scala'
filenames '*.scala', '*.sbt'
mimetypes 'text/x-scala', 'application/x-scala'
# As documented in the ENBF section of the scala specification
# http://www.scala-lang.org/docu/files/ScalaReference.pdf
whitespace = /\p{Space}/
letter = /[\p{L}$_]/
upper = /[\p{Lu}$_]/
digits = /[0-9]/
parens = /[(){}\[\]]/
delims = %r([‘’".;,])
# negative lookahead to filter out other classes
op = %r(
(?!#{whitespace}|#{letter}|#{digits}|#{parens}|#{delims})
[\u0020-\u007F\p{Sm}\p{So}]
)x
idrest = %r(#{letter}(?:#{letter}|#{digits})*(?:(?<=_)#{op}+)?)x
keywords = %w(
abstract case catch def do else extends final finally for forSome
if implicit lazy match new override private protected requires return
sealed super this throw try val var while with yield
)
state :root do
rule /(class|trait|object)(\s+)/ do
groups Keyword, Text
push :class
end
rule /'#{idrest}[^']/, Str::Symbol
rule /[^\S\n]+/, Text
rule %r(//.*?\n), Comment::Single
rule %r(/\*), Comment::Multiline, :comment
rule /@#{idrest}/, Name::Decorator
rule %r(
(#{keywords.join("|")})\b|
(<[%:-]|=>|>:|[#=@_\u21D2\u2190])(\b|(?=\s)|$)
)x, Keyword
rule /:(?!#{op})/, Keyword, :type
rule /#{upper}#{idrest}\b/, Name::Class
rule /(true|false|null)\b/, Keyword::Constant
rule /(import|package)(\s+)/ do
groups Keyword, Text
push :import
end
rule /(type)(\s+)/ do
groups Keyword, Text
push :type
end
rule /""".*?"""(?!")/m, Str
rule /"(\\\\|\\"|[^"])*"/, Str
rule /'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'/, Str::Char
rule idrest, Name
rule /`[^`]+`/, Name
rule /\[/, Operator, :typeparam
rule /[\(\)\{\};,.#]/, Operator
rule /#{op}+/, Operator
rule /([0-9][0-9]*\.[0-9]*|\.[0-9]+)([eE][+-]?[0-9]+)?[fFdD]?/, Num::Float
rule /([0-9][0-9]*[fFdD])/, Num::Float
rule /0x[0-9a-fA-F]+/, Num::Hex
rule /[0-9]+L?/, Num::Integer
rule /\n/, Text
end
state :class do
rule /(#{idrest}|#{op}+|`[^`]+`)(\s*)(\[)/ do
groups Name::Class, Text, Operator
push :typeparam
end
rule /\s+/, Text
rule /{/, Operator, :pop!
rule /\(/, Operator, :pop!
rule %r(//.*?\n), Comment::Single, :pop!
rule %r(#{idrest}|#{op}+|`[^`]+`), Name::Class, :pop!
end
state :type do
rule /\s+/, Text
rule /<[%:]|>:|[#_\u21D2]|forSome|type/, Keyword
rule /([,\);}]|=>|=)(\s*)/ do
groups Operator, Text
pop!
end
rule /[\(\{]/, Operator, :type
typechunk = /(?:#{idrest}|#{op}+\`[^`]+`)/
rule /(#{typechunk}(?:\.#{typechunk})*)(\s*)(\[)/ do
groups Keyword::Type, Text, Operator
pop!
push :typeparam
end
rule /(#{typechunk}(?:\.#{typechunk})*)(\s*)$/ do
groups Keyword::Type, Text
pop!
end
rule %r(//.*?\n), Comment::Single, :pop!
rule /\.|#{idrest}|#{op}+|`[^`]+`/, Keyword::Type
end
state :typeparam do
rule /[\s,]+/, Text
rule /<[%:]|=>|>:|[#_\u21D2]|forSome|type/, Keyword
rule /([\]\)\}])/, Operator, :pop!
rule /[\(\[\{]/, Operator, :typeparam
rule /\.|#{idrest}|#{op}+|`[^`]+`/, Keyword::Type
end
state :comment do
rule %r([^/\*]+), Comment::Multiline
rule %r(/\*), Comment::Multiline, :comment
rule %r(\*/), Comment::Multiline, :pop!
rule %r([*/]), Comment::Multiline
end
state :import do
rule %r((#{idrest}|\.)+), Name::Namespace, :pop!
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/pony.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/pony.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Pony < RegexLexer
tag 'pony'
filenames '*.pony'
keywords = Set.new %w(
actor addressof and as
be break
class compiler_intrinsic consume continue
do
else elseif embed end error
for fun
if ifdef in interface is isnt
lambda let
match
new not
object
primitive
recover repeat return
struct
then this trait try type
until use
var
where while with
)
capabilities = Set.new %w(
box iso ref tag trn val
)
types = Set.new %w(
Number Signed Unsigned Float
I8 I16 I32 I64 I128 U8 U32 U64 U128 F32 F64
EventID Align IntFormat NumberPrefix FloatFormat
Type
)
state :whitespace do
rule /[\s\t\r\n]+/m, Text
end
state :root do
mixin :whitespace
rule /"""/, Str::Doc, :docstring
rule %r{//(.*?)\n}, Comment::Single
rule %r{/(\\\n)?[*](.|\n)*?[*](\\\n)?/}, Comment::Multiline
rule /"/, Str, :string
rule %r([~!%^&*+=\|?:<>/-]), Operator
rule /(true|false|NULL)\b/, Name::Constant
rule %r{(?:[A-Z_][a-zA-Z0-9_]*)}, Name::Class
rule /[()\[\],.';]/, Punctuation
# Numbers
rule /0[xX]([0-9a-fA-F_]*\.[0-9a-fA-F_]+|[0-9a-fA-F_]+)[pP][+\-]?[0-9_]+[fFL]?[i]?/, Num::Float
rule /[0-9_]+(\.[0-9_]+[eE][+\-]?[0-9_]+|\.[0-9_]*|[eE][+\-]?[0-9_]+)[fFL]?[i]?/, Num::Float
rule /\.(0|[1-9][0-9_]*)([eE][+\-]?[0-9_]+)?[fFL]?[i]?/, Num::Float
rule /0[xX][0-9a-fA-F_]+/, Num::Hex
rule /(0|[1-9][0-9_]*)([LUu]|Lu|LU|uL|UL)?/, Num::Integer
rule /[a-z_][a-z0-9_]*/io do |m|
match = m[0]
if capabilities.include?(match)
token Keyword::Declaration
elsif keywords.include?(match)
token Keyword::Reserved
elsif types.include?(match)
token Keyword::Type
else
token Name
end
end
end
state :string do
rule /"/, Str, :pop!
rule /\\([\\abfnrtv"']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})/, Str::Escape
rule /[^\\"\n]+/, Str
rule /\\\n/, Str
rule /\\/, Str # stray backslash
end
state :docstring do
rule /"""/, Str::Doc, :pop!
rule /\n/, Str::Doc
rule /./, Str::Doc
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/cpp.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/cpp.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
load_lexer 'c.rb'
class Cpp < C
title "C++"
desc "The C++ programming language"
tag 'cpp'
aliases 'c++'
# the many varied filenames of c++ source files...
filenames '*.cpp', '*.hpp',
'*.c++', '*.h++',
'*.cc', '*.hh',
'*.cxx', '*.hxx',
'*.pde', '*.ino',
'*.tpp'
mimetypes 'text/x-c++hdr', 'text/x-c++src'
def self.keywords
@keywords ||= super + Set.new(%w(
asm auto catch const_cast delete dynamic_cast explicit export
friend mutable namespace new operator private protected public
reinterpret_cast restrict size_of static_cast template this throw
throws typeid typename using virtual final override
alignas alignof constexpr decltype noexcept static_assert
thread_local try
))
end
def self.keywords_type
@keywords_type ||= super + Set.new(%w(
bool
))
end
def self.reserved
@reserved ||= super + Set.new(%w(
__virtual_inheritance __uuidof __super __single_inheritance
__multiple_inheritance __interface __event
))
end
id = /[a-zA-Z_][a-zA-Z0-9_]*/
prepend :root do
# Offload C++ extensions, http://offload.codeplay.com/
rule /(?:__offload|__blockingoffload|__outer)\b/, Keyword::Pseudo
end
# digits with optional inner quotes
# see www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3781.pdf
dq = /\d('?\d)*/
prepend :statements do
rule /class\b/, Keyword, :classname
rule %r((#{dq}[.]#{dq}?|[.]#{dq})(e[+-]?#{dq}[lu]*)?)i, Num::Float
rule %r(#{dq}e[+-]?#{dq}[lu]*)i, Num::Float
rule /0x\h('?\h)*[lu]*/i, Num::Hex
rule /0[0-7]('?[0-7])*[lu]*/i, Num::Oct
rule /#{dq}[lu]*/i, Num::Integer
rule /\bnullptr\b/, Name::Builtin
rule /(?:u8|u|U|L)?R"([a-zA-Z0-9_{}\[\]#<>%:;.?*\+\-\/\^&|~!=,"']{,16})\(.*?\)\1"/m, Str
end
state :classname do
rule id, Name::Class, :pop!
# template specification
rule /\s*(?=>)/m, Text, :pop!
mixin :whitespace
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/nginx.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/nginx.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Nginx < RegexLexer
title "nginx"
desc 'configuration files for the nginx web server (nginx.org)'
tag 'nginx'
mimetypes 'text/x-nginx-conf'
filenames 'nginx.conf'
id = /[^\s$;{}()#]+/
state :root do
rule /(include)(\s+)([^\s;]+)/ do
groups Keyword, Text, Name
end
rule id, Keyword, :statement
mixin :base
end
state :block do
rule /}/, Punctuation, :pop!
rule id, Keyword::Namespace, :statement
mixin :base
end
state :statement do
rule /{/ do
token Punctuation; pop!; push :block
end
rule /;/, Punctuation, :pop!
mixin :base
end
state :base do
rule /\s+/, Text
rule /#.*?\n/, Comment::Single
rule /(?:on|off)\b/, Name::Constant
rule /[$][\w-]+/, Name::Variable
# host/port
rule /([a-z0-9.-]+)(:)([0-9]+)/i do
groups Name::Function, Punctuation, Num::Integer
end
# mimetype
rule %r([a-z-]+/[a-z-]+)i, Name::Class
rule /[0-9]+[kmg]?\b/i, Num::Integer
rule /(~)(\s*)([^\s{]+)/ do
groups Punctuation, Text, Str::Regex
end
rule /[:=~]/, Punctuation
# pathname
rule %r(/#{id}?), Name
rule /[^#\s;{}$\\]+/, Str # catchall
rule /[$;]/, Text
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/abap.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/abap.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
# ABAP elements taken from http://help.sap.com/abapdocu_750/en/index.htm?file=abapdo.htm
module Rouge
module Lexers
class ABAP < RegexLexer
title "ABAP"
desc "SAP - Advanced Business Application Programming"
tag 'abap'
filenames '*.abap'
mimetypes 'text/x-abap'
def self.keywords
@keywords = Set.new %w(
*-INPUT ?TO ABAP-SOURCE ABBREVIATED ABS ABSTRACT ACCEPT ACCEPTING
ACCORDING ACCP ACTIVATION ACTUAL ADD ADD-CORRESPONDING ADJACENT
AFTER ALIAS ALIASES ALIGN ALL ALLOCATE ALPHA ANALYSIS ANALYZER AND
ANY APPEND APPENDAGE APPENDING APPLICATION ARCHIVE AREA ARITHMETIC
AS ASCENDING ASPECT ASSERT ASSIGN ASSIGNED ASSIGNING ASSOCIATION
ASYNCHRONOUS AT ATTRIBUTES AUTHORITY AUTHORITY-CHECK AVG BACK
BACKGROUND BACKUP BACKWARD BADI BASE BEFORE BEGIN BETWEEN BIG BINARY
BINTOHEX BIT BIT-AND BIT-NOT BIT-OR BIT-XOR BLACK BLANK BLANKS BLOB
BLOCK BLOCKS BLUE BOUND BOUNDARIES BOUNDS BOXED BREAK-POINT BT
BUFFER BY BYPASSING BYTE BYTE-CA BYTE-CN BYTE-CO BYTE-CS BYTE-NA
BYTE-NS BYTE-ORDER CA CALL CALLING CASE CAST CASTING CATCH CEIL
CENTER CENTERED CHAIN CHAIN-INPUT CHAIN-REQUEST CHANGE CHANGING
CHANNELS CHAR CHAR-TO-HEX CHARACTER CHECK CHECKBOX CIRCULAR CLASS
CLASS-CODING CLASS-DATA CLASS-EVENTS CLASS-METHODS CLASS-POOL
CLEANUP CLEAR CLIENT CLNT CLOB CLOCK CLOSE CN CO COALESCE CODE
CODING COLLECT COLOR COLUMN COLUMNS COL_BACKGROUND COL_GROUP
COL_HEADING COL_KEY COL_NEGATIVE COL_NORMAL COL_POSITIVE COL_TOTAL
COMMENT COMMENTS COMMIT COMMON COMMUNICATION COMPARING COMPONENT
COMPONENTS COMPRESSION COMPUTE CONCAT CONCATENATE CONCAT_WITH_SPACE
COND CONDENSE CONDITION CONNECT CONNECTION CONSTANTS CONTEXT
CONTEXTS CONTINUE CONTROL CONTROLS CONV CONVERSION CONVERT COPIES
COPY CORRESPONDING COUNT COUNTRY COVER CP CPI CREATE CREATING
CRITICAL CS CUKY CURR CURRENCY CURRENCY_CONVERSION CURRENT CURSOR
CURSOR-SELECTION CUSTOMER CUSTOMER-FUNCTION CX_DYNAMIC_CHECK
CX_NO_CHECK CX_ROOT CX_SQL_EXCEPTION CX_STATIC_CHECK DANGEROUS DATA
DATABASE DATAINFO DATASET DATE DATS DATS_ADD_DAYS DATS_ADD_MONTHS
DATS_DAYS_BETWEEN DATS_IS_VALID DAYLIGHT DD/MM/YY DD/MM/YYYY DDMMYY
DEALLOCATE DEC DECIMALS DECIMAL_SHIFT DECLARATIONS DEEP DEFAULT
DEFERRED DEFINE DEFINING DEFINITION DELETE DELETING DEMAND
DEPARTMENT DESCENDING DESCRIBE DESTINATION DETAIL DF16_DEC DF16_RAW
DF16_SCL DF34_DEC DF34_RAW DF34_SCL DIALOG DIRECTORY DISCONNECT
DISPLAY DISPLAY-MODE DISTANCE DISTINCT DIV DIVIDE
DIVIDE-CORRESPONDING DIVISION DO DUMMY DUPLICATE DUPLICATES DURATION
DURING DYNAMIC DYNPRO E EDIT EDITOR-CALL ELSE ELSEIF EMPTY ENABLED
ENABLING ENCODING END END-ENHANCEMENT-SECTION END-LINES
END-OF-DEFINITION END-OF-FILE END-OF-PAGE END-OF-SELECTION
END-TEST-INJECTION END-TEST-SEAM ENDAT ENDCASE ENDCATCH ENDCHAIN
ENDCLASS ENDDO ENDENHANCEMENT ENDEXEC ENDFORM ENDFUNCTION ENDIAN
ENDIF ENDING ENDINTERFACE ENDLOOP ENDMETHOD ENDMODULE ENDON
ENDPROVIDE ENDSELECT ENDTRY ENDWHILE ENDWITH ENGINEERING ENHANCEMENT
ENHANCEMENT-POINT ENHANCEMENT-SECTION ENHANCEMENTS ENTRIES ENTRY
ENVIRONMENT EQ EQUIV ERRORMESSAGE ERRORS ESCAPE ESCAPING EVENT
EVENTS EXACT EXCEPT EXCEPTION EXCEPTION-TABLE EXCEPTIONS EXCLUDE
EXCLUDING EXEC EXECUTE EXISTS EXIT EXIT-COMMAND EXPAND EXPANDING
EXPIRATION EXPLICIT EXPONENT EXPORT EXPORTING EXTEND EXTENDED
EXTENSION EXTRACT FAIL FETCH FIELD FIELD-GROUPS FIELD-SYMBOL
FIELD-SYMBOLS FIELDS FILE FILTER FILTER-TABLE FILTERS FINAL FIND
FIRST FIRST-LINE FIXED-POINT FKEQ FKGE FLOOR FLTP FLUSH FONT FOR
FORM FORMAT FORWARD FOUND FRAME FRAMES FREE FRIENDS FROM FUNCTION
FUNCTION-POOL FUNCTIONALITY FURTHER GAPS GE GENERATE GET
GET_PRINT_PARAMETERS GIVING GKEQ GKGE GLOBAL GRANT GREEN GROUP
GROUPS GT HANDLE HANDLER HARMLESS HASHED HAVING HDB HEAD-LINES
HEADER HEADERS HEADING HELP-ID HELP-REQUEST HEXTOBIN HIDE HIGH HINT
HOLD HOTSPOT I ICON ID IDENTIFICATION IDENTIFIER IDS IF
IF_ABAP_CLOSE_RESOURCE IF_ABAP_CODEPAGE IF_ABAP_DB_BLOB_HANDLE
IF_ABAP_DB_CLOB_HANDLE IF_ABAP_DB_LOB_HANDLE IF_ABAP_DB_READER
IF_ABAP_DB_WRITER IF_ABAP_READER IF_ABAP_WRITER IF_MESSAGE
IF_OS_CA_INSTANCE IF_OS_CA_PERSISTENCY IF_OS_FACTORY IF_OS_QUERY
IF_OS_QUERY_MANAGER IF_OS_QUERY_OPTIONS IF_OS_STATE
IF_OS_TRANSACTION IF_OS_TRANSACTION_MANAGER IF_SERIALIZABLE_OBJECT
IF_SHM_BUILD_INSTANCE IF_SYSTEM_UUID IF_T100_DYN_MSG IF_T100_MESSAGE
IGNORE IGNORING IMMEDIATELY IMPLEMENTATION IMPLEMENTATIONS
IMPLEMENTED IMPLICIT IMPORT IMPORTING IN INACTIVE INCL INCLUDE
INCLUDES INCLUDING INCREMENT INDEX INDEX-LINE INFOTYPES INHERITING
INIT INITIAL INITIALIZATION INNER INOUT INPUT INSERT INSTANCE
INSTANCES INSTR INT1 INT2 INT4 INT8 INTENSIFIED INTERFACE
INTERFACE-POOL INTERFACES INTERNAL INTERVALS INTO INVERSE
INVERTED-DATE IS ISO ITNO JOB JOIN KEEP KEEPING KERNEL KEY KEYS
KEYWORDS KIND LANG LANGUAGE LAST LATE LAYOUT LCHR LDB_PROCESS LE
LEADING LEAVE LEFT LEFT-JUSTIFIED LEFTPLUS LEFTSPACE LEGACY LENGTH
LET LEVEL LEVELS LIKE LINE LINE-COUNT LINE-SELECTION LINE-SIZE
LINEFEED LINES LIST LIST-PROCESSING LISTBOX LITTLE LLANG LOAD
LOAD-OF-PROGRAM LOB LOCAL LOCALE LOCATOR LOG-POINT LOGFILE LOGICAL
LONG LOOP LOW LOWER LPAD LPI LRAW LT LTRIM M MAIL MAIN MAJOR-ID
MAPPING MARGIN MARK MASK MATCH MATCHCODE MAX MAXIMUM MEDIUM MEMBERS
MEMORY MESH MESSAGE MESSAGE-ID MESSAGES MESSAGING METHOD METHODS MIN
MINIMUM MINOR-ID MM/DD/YY MM/DD/YYYY MMDDYY MOD MODE MODIF MODIFIER
MODIFY MODULE MOVE MOVE-CORRESPONDING MULTIPLY
MULTIPLY-CORRESPONDING NA NAME NAMETAB NATIVE NB NE NESTED NESTING
NEW NEW-LINE NEW-PAGE NEW-SECTION NEXT NO NO-DISPLAY NO-EXTENSION
NO-GAP NO-GAPS NO-GROUPING NO-HEADING NO-SCROLLING NO-SIGN NO-TITLE
NO-TOPOFPAGE NO-ZERO NODE NODES NON-UNICODE NON-UNIQUE NOT NP NS
NULL NUMBER NUMC O OBJECT OBJECTS OBLIGATORY OCCURRENCE OCCURRENCES
OCCURS OF OFF OFFSET ON ONLY OPEN OPTION OPTIONAL OPTIONS OR ORDER
OTHER OTHERS OUT OUTER OUTPUT OUTPUT-LENGTH OVERFLOW OVERLAY PACK
PACKAGE PAD PADDING PAGE PAGES PARAMETER PARAMETER-TABLE PARAMETERS
PART PARTIALLY PATTERN PERCENTAGE PERFORM PERFORMING PERSON PF
PF-STATUS PINK PLACES POOL POSITION POS_HIGH POS_LOW PRAGMAS PREC
PRECOMPILED PREFERRED PRESERVING PRIMARY PRINT PRINT-CONTROL
PRIORITY PRIVATE PROCEDURE PROCESS PROGRAM PROPERTY PROTECTED
PROVIDE PUBLIC PUSH PUSHBUTTON PUT QUAN QUEUE-ONLY QUICKINFO
RADIOBUTTON RAISE RAISING RANGE RANGES RAW RAWSTRING READ READ-ONLY
READER RECEIVE RECEIVED RECEIVER RECEIVING RED REDEFINITION REDUCE
REDUCED REF REFERENCE REFRESH REGEX REJECT REMOTE RENAMING REPLACE
REPLACEMENT REPLACING REPORT REQUEST REQUESTED RESERVE RESET
RESOLUTION RESPECTING RESPONSIBLE RESULT RESULTS RESUMABLE RESUME
RETRY RETURN RETURNCODE RETURNING RETURNS RIGHT RIGHT-JUSTIFIED
RIGHTPLUS RIGHTSPACE RISK RMC_COMMUNICATION_FAILURE
RMC_INVALID_STATUS RMC_SYSTEM_FAILURE ROLE ROLLBACK ROUND ROWS RPAD
RTRIM RUN SAP SAP-SPOOL SAVING SCALE_PRESERVING
SCALE_PRESERVING_SCIENTIFIC SCAN SCIENTIFIC
SCIENTIFIC_WITH_LEADING_ZERO SCREEN SCROLL SCROLL-BOUNDARY SCROLLING
SEARCH SECONDARY SECONDS SECTION SELECT SELECT-OPTIONS SELECTION
SELECTION-SCREEN SELECTION-SET SELECTION-SETS SELECTION-TABLE
SELECTIONS SEND SEPARATE SEPARATED SET SHARED SHIFT SHORT
SHORTDUMP-ID SIGN SIGN_AS_POSTFIX SIMPLE SINGLE SIZE SKIP SKIPPING
SMART SOME SORT SORTABLE SORTED SOURCE SPACE SPECIFIED SPLIT SPOOL
SPOTS SQL SQLSCRIPT SSTRING STABLE STAMP STANDARD START-OF-SELECTION
STARTING STATE STATEMENT STATEMENTS STATIC STATICS STATUSINFO
STEP-LOOP STOP STRING STRUCTURE STRUCTURES STYLE SUBKEY SUBMATCHES
SUBMIT SUBROUTINE SUBSCREEN SUBSTRING SUBTRACT
SUBTRACT-CORRESPONDING SUFFIX SUM SUMMARY SUMMING SUPPLIED SUPPLY
SUPPRESS SWITCH SWITCHSTATES SYMBOL SYNCPOINTS SYNTAX SYNTAX-CHECK
SYNTAX-TRACE SYST SYSTEM-CALL SYSTEM-EXCEPTIONS SYSTEM-EXIT TAB
TABBED TABLE TABLES TABLEVIEW TABSTRIP TARGET TASK TASKS TEST
TEST-INJECTION TEST-SEAM TESTING TEXT TEXTPOOL THEN THROW TIME TIMES
TIMESTAMP TIMEZONE TIMS TIMS_IS_VALID TITLE TITLE-LINES TITLEBAR TO
TOKENIZATION TOKENS TOP-LINES TOP-OF-PAGE TRACE-FILE TRACE-TABLE
TRAILING TRANSACTION TRANSFER TRANSFORMATION TRANSLATE TRANSPORTING
TRMAC TRUNCATE TRUNCATION TRY TSTMP_ADD_SECONDS
TSTMP_CURRENT_UTCTIMESTAMP TSTMP_IS_VALID TSTMP_SECONDS_BETWEEN TYPE
TYPE-POOL TYPE-POOLS TYPES ULINE UNASSIGN UNDER UNICODE UNION UNIQUE
UNIT UNIT_CONVERSION UNIX UNPACK UNTIL UNWIND UP UPDATE UPPER USER
USER-COMMAND USING UTF-8 VALID VALUE VALUE-REQUEST VALUES VARC VARY
VARYING VERIFICATION-MESSAGE VERSION VIA VIEW VISIBLE WAIT WARNING
WHEN WHENEVER WHERE WHILE WIDTH WINDOW WINDOWS WITH WITH-HEADING
WITH-TITLE WITHOUT WORD WORK WRITE WRITER XML XSD YELLOW YES YYMMDD
Z ZERO ZONE
)
end
def self.builtins
@keywords = Set.new %w(
acos apply asin assign atan attribute bit-set boolc boolx call
call-method cast ceil cfunc charlen char_off class_constructor clear
cluster cmax cmin cnt communication_failure concat_lines_of cond
cond-var condense constructor contains contains_any_not_of
contains_any_of copy cos cosh count count_any_not_of count_any_of
create cursor data dbmaxlen dbtab deserialize destructor distance
empty error_message escape exp extensible find find_any_not_of
find_any_of find_end floor frac from_mixed group hashed header idx
include index insert ipow itab key lax lines line_exists line_index
log log10 loop loop_key match matches me mesh_path namespace nmax
nmin node numeric numofchar object parameter primary_key read ref
repeat replace rescale resource_failure reverse root round segment
sender serialize shift_left shift_right sign simple sin sinh skip
sorted space sqrt standard strlen substring substring_after
substring_before substring_from substring_to sum switch switch-var
system_failure table table_line tan tanh template text to_lower
to_mixed to_upper transform translate trunc type value variable write
xsdbool xsequence xstrlen
)
end
def self.types
@types = Set.new %w(
b c d decfloat16 decfloat34 f i int8 n p s t x
clike csequence decfloat string xstring
)
end
def self.new_keywords
@types = Set.new %w(
DATA FIELD-SYMBOL
)
end
state :root do
rule /\s+/m, Text
rule /".*/, Comment::Single
rule %r(^\*.*), Comment::Multiline
rule /\d+/, Num::Integer
rule /('|`)/, Str::Single, :single_string
rule /[\[\]\(\)\{\}\[\]\.,:\|]/, Punctuation
# builtins / new ABAP 7.40 keywords (@DATA(), ...)
rule /(->|=>)?([A-Za-z][A-Za-z0-9_\-]*)(\()/ do |m|
if m[1] != ''
token Operator, m[1]
end
if (self.class.new_keywords.include? m[2].upcase) && m[1].nil?
token Keyword, m[2]
elsif (self.class.builtins.include? m[2].downcase) && m[1].nil?
token Name::Builtin, m[2]
else
token Name, m[2]
end
token Punctuation, m[3]
end
# keywords, types and normal text
rule /\w[\w\d]*/ do |m|
if self.class.keywords.include? m[0].upcase
token Keyword
elsif self.class.types.include? m[0].downcase
token Keyword::Type
else
token Name
end
end
# operators
rule %r((->|->>|=>)), Operator
rule %r([-\*\+%/~=&\?<>!#\@\^]+), Operator
end
state :operators do
rule %r((->|->>|=>)), Operator
rule %r([-\*\+%/~=&\?<>!#\@\^]+), Operator
end
state :single_string do
rule /\\./, Str::Escape
rule /(''|``)/, Str::Escape
rule /['`]/, Str::Single, :pop!
rule /[^\\'`]+/, Str::Single
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/puppet.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/puppet.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Puppet < RegexLexer
title "Puppet"
desc 'The Puppet configuration management language (puppetlabs.org)'
tag 'puppet'
aliases 'pp'
filenames '*.pp'
def self.detect?(text)
return true if text.shebang? 'puppet-apply'
return true if text.shebang? 'puppet'
end
def self.keywords
@keywords ||= Set.new %w(
and case class default define else elsif if in import inherits
node unless
)
end
def self.constants
@constants ||= Set.new %w(
false true undef
)
end
def self.metaparameters
@metaparameters ||= Set.new %w(
before require notify subscribe
)
end
id = /[a-z]\w*/
cap_id = /[A-Z]\w*/
qualname = /(::)?(#{id}::)*\w+/
state :whitespace do
rule /\s+/m, Text
rule /#.*?\n/, Comment
end
state :root do
mixin :whitespace
rule /[$]#{qualname}/, Name::Variable
rule /(#{id})(?=\s*[=+]>)/m do |m|
if self.class.metaparameters.include? m[0]
token Keyword::Pseudo
else
token Name::Property
end
end
rule /(#{qualname})(?=\s*[(])/m, Name::Function
rule cap_id, Name::Class
rule /[+=|~-]>|<[|~-]/, Punctuation
rule /[:}();\[\]]/, Punctuation
# HACK for case statements and selectors
rule /{/, Punctuation, :regex_allowed
rule /,/, Punctuation, :regex_allowed
rule /(in|and|or)\b/, Operator::Word
rule /[=!<>]=/, Operator
rule /[=!]~/, Operator, :regex_allowed
rule %r([=<>!+*/-]), Operator
rule /(class|include)(\s*)(#{qualname})/ do
groups Keyword, Text, Name::Class
end
rule /node\b/, Keyword, :regex_allowed
rule /'(\\[\\']|[^'])*'/m, Str::Single
rule /"/, Str::Double, :dquotes
rule /\d+([.]\d+)?(e[+-]\d+)?/, Num
# a valid regex. TODO: regexes are only allowed
# in certain places in puppet.
rule qualname do |m|
if self.class.keywords.include? m[0]
token Keyword
elsif self.class.constants.include? m[0]
token Keyword::Constant
else
token Name
end
end
end
state :regex_allowed do
mixin :whitespace
rule %r(/), Str::Regex, :regex
rule(//) { pop! }
end
state :regex do
rule %r(/), Str::Regex, :pop!
rule /\\./, Str::Escape
rule /[(){}]/, Str::Interpol
rule /\[/, Str::Interpol, :regex_class
rule /./, Str::Regex
end
state :regex_class do
rule /\]/, Str::Interpol, :pop!
rule /(?<!\[)-(?=\])/, Str::Regex
rule /-/, Str::Interpol
rule /\\./, Str::Escape
rule /[^\\\]-]+/, Str::Regex
end
state :dquotes do
rule /"/, Str::Double, :pop!
rule /[^$\\"]+/m, Str::Double
rule /\\./m, Str::Escape
rule /[$]#{qualname}/, Name::Variable
rule /[$][{]#{qualname}[}]/, Name::Variable
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/vala.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/vala.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Vala < RegexLexer
tag 'vala'
filenames '*.vala'
mimetypes 'text/x-vala'
title "Vala"
desc 'A programming language similar to csharp.'
id = /@?[_a-z]\w*/i
keywords = %w(
abstract as async base break case catch const construct continue
default delegate delete do dynamic else ensures enum errordomain
extern false finally for foreach get global if in inline interface
internal is lock new null out override owned private protected
public ref requires return set signal sizeof static switch this
throw throws true try typeof unowned var value virtual void weak
while yield
)
keywords_type = %w(
bool char double float int int8 int16 int32 int64 long short size_t
ssize_t string unichar uint uint8 uint16 uint32 uint64 ulong ushort
)
state :whitespace do
rule /\s+/m, Text
rule %r(//.*?$), Comment::Single
rule %r(/[*].*?[*]/)m, Comment::Multiline
end
state :root do
mixin :whitespace
rule /^\s*\[.*?\]/, Name::Attribute
rule /(<\[)\s*(#{id}:)?/, Keyword
rule /\]>/, Keyword
rule /[~!%^&*()+=|\[\]{}:;,.<>\/?-]/, Punctuation
rule /@"(\\.|.)*?"/, Str
rule /"(\\.|.)*?["\n]/, Str
rule /'(\\.|.)'/, Str::Char
rule /0x[0-9a-f]+[lu]?/i, Num
rule %r(
[0-9]
([.][0-9]*)? # decimal
(e[+-][0-9]+)? # exponent
[fldu]? # type
)ix, Num
rule /\b(#{keywords.join('|')})\b/, Keyword
rule /\b(#{keywords_type.join('|')})\b/, Keyword::Type
rule /class|struct/, Keyword, :class
rule /namespace|using/, Keyword, :namespace
rule /#{id}(?=\s*[(])/, Name::Function
rule id, Name
rule /#.*/, Comment::Preproc
end
state :class do
mixin :whitespace
rule id, Name::Class, :pop!
end
state :namespace do
mixin :whitespace
rule /(?=[(])/, Text, :pop!
rule /(#{id}|[.])+/, Name::Namespace, :pop!
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/vhdl.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/vhdl.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class VHDL < RegexLexer
title "VHDL 2008"
desc "Very High Speed Integrated Circuit Hardware Description Language"
tag 'vhdl'
filenames '*.vhd', '*.vhdl', '*.vho'
mimetypes 'text/x-vhdl'
def self.keywords
@keywords ||= Set.new %w(
access after alias all architecture array assert assume assume_guarantee attribute
begin block body buffer bus case component configuration constant context cover
default disconnect downto else elsif end entity exit fairness file for force function
generate generic group guarded if impure in inertial inout is label library linkage
literal loop map new next null of on open others out package parameter port postponed
procedure process property protected pure range record register reject release report
return select sequence severity shared signal strong subtype then to transport type
unaffected units until use variable vmode vprop vunit wait when while with
)
end
def self.keywords_type
@keywords_type ||= Set.new %w(
bit bit_vector boolean boolean_vector character integer integer_vector natural positive
real real_vector severity_level signed std_logic std_logic_vector std_ulogic
std_ulogic_vector string unsigned time time_vector
)
end
def self.operator_words
@operator_words ||= Set.new %w(
abs and mod nand nor not or rem rol ror sla sll sra srl xnor xor
)
end
id = /[a-zA-Z][a-zA-Z0-9_]*/
state :whitespace do
rule /\s+/, Text
rule /\n/, Text
# Find Comments (VHDL doesn't support multiline comments)
rule /--.*$/, Comment::Single
end
state :statements do
# Find Numbers
rule /-?\d+/i, Num::Integer
rule /-?\d+[.]\d+/i, Num::Float
# Find Strings
rule /[box]?"[^"]*"/i, Str::Single
rule /'[^']?'/i, Str::Char
# Find Attributes
rule /'#{id}/i, Name::Attribute
# Punctuations
rule /[(),:;]/, Punctuation
# Boolean and NULL
rule /(?:true|false|null)\b/i, Name::Builtin
rule id do |m|
match = m[0].downcase #convert to lower case
if self.class.keywords.include? match
token Keyword
elsif self.class.keywords_type.include? match
token Keyword::Type
elsif self.class.operator_words.include? match
token Operator::Word
else
token Name
end
end
rule(
%r(=>|[*][*]|:=|\/=|>=|<=|<>|\?\?|\?=|\?\/=|\?>|\?<|\?>=|\?<=|<<|>>|[#&'*+-.\/:<=>\?@^]),
Operator
)
end
state :root do
mixin :whitespace
mixin :statements
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/json_doc.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/json_doc.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
load_lexer 'json.rb'
class JSONDOC < JSON
desc "JavaScript Object Notation with extenstions for documentation"
tag 'json-doc'
prepend :root do
rule /([$\w]+)(\s*)(:)/ do
groups Name::Attribute, Text, Punctuation
end
rule %r(/[*].*?[*]/), Comment
rule %r(//.*?$), Comment::Single
rule /(\.\.\.)/, Comment::Single
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/actionscript.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/actionscript.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Actionscript < RegexLexer
title "ActionScript"
desc "ActionScript"
tag 'actionscript'
aliases 'as', 'as3'
filenames '*.as'
mimetypes 'application/x-actionscript'
state :comments_and_whitespace do
rule /\s+/, Text
rule %r(//.*?$), Comment::Single
rule %r(/\*.*?\*/)m, Comment::Multiline
end
state :expr_start do
mixin :comments_and_whitespace
rule %r(/) do
token Str::Regex
goto :regex
end
rule /[{]/, Punctuation, :object
rule //, Text, :pop!
end
state :regex do
rule %r(/) do
token Str::Regex
goto :regex_end
end
rule %r([^/]\n), Error, :pop!
rule /\n/, Error, :pop!
rule /\[\^/, Str::Escape, :regex_group
rule /\[/, Str::Escape, :regex_group
rule /\\./, Str::Escape
rule %r{[(][?][:=<!]}, Str::Escape
rule /[{][\d,]+[}]/, Str::Escape
rule /[()?]/, Str::Escape
rule /./, Str::Regex
end
state :regex_end do
rule /[gim]+/, Str::Regex, :pop!
rule(//) { pop! }
end
state :regex_group do
# specially highlight / in a group to indicate that it doesn't
# close the regex
rule /\//, Str::Escape
rule %r([^/]\n) do
token Error
pop! 2
end
rule /\]/, Str::Escape, :pop!
rule /\\./, Str::Escape
rule /./, Str::Regex
end
state :bad_regex do
rule /[^\n]+/, Error, :pop!
end
def self.keywords
@keywords ||= Set.new %w(
for in while do break return continue switch case default
if else throw try catch finally new delete typeof is
this with
)
end
def self.declarations
@declarations ||= Set.new %w(var with function)
end
def self.reserved
@reserved ||= Set.new %w(
dynamic final internal native public protected private class const
override static package interface extends implements namespace
set get import include super flash_proxy object_proxy trace
)
end
def self.constants
@constants ||= Set.new %w(true false null NaN Infinity undefined)
end
def self.builtins
@builtins ||= %w(
void Function Math Class
Object RegExp decodeURI
decodeURIComponent encodeURI encodeURIComponent
eval isFinite isNaN parseFloat parseInt this
)
end
id = /[$a-zA-Z_][a-zA-Z0-9_]*/
state :root do
rule /\A\s*#!.*?\n/m, Comment::Preproc, :statement
rule /\n/, Text, :statement
rule %r((?<=\n)(?=\s|/|<!--)), Text, :expr_start
mixin :comments_and_whitespace
rule %r(\+\+ | -- | ~ | && | \|\| | \\(?=\n) | << | >>>? | ===
| !== )x,
Operator, :expr_start
rule %r([:-<>+*%&|\^/!=]=?), Operator, :expr_start
rule /[(\[,]/, Punctuation, :expr_start
rule /;/, Punctuation, :statement
rule /[)\].]/, Punctuation
rule /[?]/ do
token Punctuation
push :ternary
push :expr_start
end
rule /[{}]/, Punctuation, :statement
rule id do |m|
if self.class.keywords.include? m[0]
token Keyword
push :expr_start
elsif self.class.declarations.include? m[0]
token Keyword::Declaration
push :expr_start
elsif self.class.reserved.include? m[0]
token Keyword::Reserved
elsif self.class.constants.include? m[0]
token Keyword::Constant
elsif self.class.builtins.include? m[0]
token Name::Builtin
else
token Name::Other
end
end
rule /\-?[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?/, Num::Float
rule /0x[0-9a-fA-F]+/, Num::Hex
rule /\-?[0-9]+/, Num::Integer
rule /"(\\\\|\\"|[^"])*"/, Str::Double
rule /'(\\\\|\\'|[^'])*'/, Str::Single
end
# braced parts that aren't object literals
state :statement do
rule /(#{id})(\s*)(:)/ do
groups Name::Label, Text, Punctuation
end
rule /[{}]/, Punctuation
mixin :expr_start
end
# object literals
state :object do
mixin :comments_and_whitespace
rule /[}]/ do
token Punctuation
goto :statement
end
rule /(#{id})(\s*)(:)/ do
groups Name::Attribute, Text, Punctuation
push :expr_start
end
rule /:/, Punctuation
mixin :root
end
# ternary expressions, where <id>: is not a label!
state :ternary do
rule /:/ do
token Punctuation
goto :expr_start
end
mixin :root
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/html.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/html.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class HTML < RegexLexer
title "HTML"
desc "HTML, the markup language of the web"
tag 'html'
filenames '*.htm', '*.html', '*.xhtml'
mimetypes 'text/html', 'application/xhtml+xml'
def self.detect?(text)
return true if text.doctype?(/\bhtml\b/i)
return true if text =~ /<\s*html\b/
end
start do
@javascript = Javascript.new(options)
@css = CSS.new(options)
end
state :root do
rule /[^<&]+/m, Text
rule /&\S*?;/, Name::Entity
rule /<!DOCTYPE .*?>/im, Comment::Preproc
rule /<!\[CDATA\[.*?\]\]>/m, Comment::Preproc
rule /<!--/, Comment, :comment
rule /<\?.*?\?>/m, Comment::Preproc # php? really?
rule /<\s*script\s*/m do
token Name::Tag
@javascript.reset!
push :script_content
push :tag
end
rule /<\s*style\s*/m do
token Name::Tag
@css.reset!
@lang = @css
push :style_content
push :tag
end
rule /<\//, Name::Tag, :tag_end
rule /</, Name::Tag, :tag_start
rule %r(<\s*[a-zA-Z0-9:-]+), Name::Tag, :tag # opening tags
rule %r(<\s*/\s*[a-zA-Z0-9:-]+\s*>), Name::Tag # closing tags
end
state :tag_end do
mixin :tag_end_end
rule /[a-zA-Z0-9:-]+/ do
token Name::Tag
goto :tag_end_end
end
end
state :tag_end_end do
rule /\s+/, Text
rule />/, Name::Tag, :pop!
end
state :tag_start do
rule /\s+/, Text
rule /[a-zA-Z0-9:-]+/ do
token Name::Tag
goto :tag
end
rule(//) { goto :tag }
end
state :comment do
rule /[^-]+/, Comment
rule /-->/, Comment, :pop!
rule /-/, Comment
end
state :tag do
rule /\s+/m, Text
rule /[a-zA-Z0-9_:-]+\s*=\s*/m, Name::Attribute, :attr
rule /[a-zA-Z0-9_:-]+/, Name::Attribute
rule %r(/?\s*>)m, Name::Tag, :pop!
end
state :attr do
# TODO: are backslash escapes valid here?
rule /"/ do
token Str
goto :dq
end
rule /'/ do
token Str
goto :sq
end
rule /[^\s>]+/, Str, :pop!
end
state :dq do
rule /"/, Str, :pop!
rule /[^"]+/, Str
end
state :sq do
rule /'/, Str, :pop!
rule /[^']+/, Str
end
state :script_content do
rule %r([^<]+) do
delegate @javascript
end
rule %r(<\s*/\s*script\s*>)m, Name::Tag, :pop!
rule %r(<) do
delegate @javascript
end
end
state :style_content do
rule /[^<]+/ do
delegate @lang
end
rule %r(<\s*/\s*style\s*>)m, Name::Tag, :pop!
rule /</ do
delegate @lang
end
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/verilog.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/verilog.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Verilog < RegexLexer
title "Verilog and System Verilog"
desc "The System Verilog hardware description language"
tag 'verilog'
filenames '*.v', '*.sv', '*.svh'
mimetypes 'text/x-verilog', 'text/x-systemverilog'
# optional comment or whitespace
ws = %r((?:\s|//.*?\n|/[*].*?[*]/)+)
id = /[a-zA-Z_][a-zA-Z0-9_]*/
def self.keywords
@keywords ||= Set.new %w(
alias always always_comb always_ff always_latch assert assert_strobe
assign assume automatic attribute before begin bind bins binsof break
case casex casez clocking config constraint context continue cover
covergroup coverpoint cross deassign defparam default design dist do
else end endattribute endcase endclass endclocking endconfig
endfunction endgenerate endgroup endinterface endmodule endpackage
endprimitive endprogram endproperty endspecify endsequence endtable
endtask expect export extends extern final first_match for force
foreach fork forkjoin forever function generate genvar if iff ifnone
ignore_bins illegal_bins import incdir include initial inside instance
interface intersect join join_any join_none liblist library local
localparam matches module modport new noshowcancelled null package
parameter primitive priority program property protected
pulsestyle_onevent pulsestyle_ondetect pure rand randc randcase
randsequence release return sequence showcancelled solve specify super
table task this throughout timeprecision timeunit type typedef unique
use wait wait_order while wildcard with within
)
end
def self.keywords_type
@keywords_type ||= Set.new %w(
and bit buf bufif0 bufif1 byte cell chandle class cmos const disable
edge enum event highz0 highz1 initial inout input int integer join
logic longint macromodule medium nand negedge nmos nor not
notif0 notif1 or output packed parameter pmos posedge pull0 pull1
pulldown pullup rcmos real realtime ref reg repeat rnmos rpmos rtran
rtranif0 rtranif1 scalared shortint shortreal signed specparam
static string strength strong0 strong1 struct supply0 supply1 tagged
time tran tranif0 tranif1 tri tri0 tri1 triand trior trireg union
unsigned uwire var vectored virtual void wait wand weak[01] wire wor
xnor xor
)
end
def self.keywords_system_task
@keyword_system_task ||= Set.new %w(
acos acosh asin asinh assertfailoff assertfailon assertkill
assertnonvacuouson assertoff asserton assertpassoff assertpasson
assertvacuousoff atan atan2 atanh bits bitstoreal bitstoshortreal
cast ceil changed changed_gclk changing_gclk clog2 cos cosh countones
coverage_control coverage_get coverage_get_max coverage_merge
coverage_save dimensions display displayb displayh displayo
dist_chi_square dist_erlang dist_exponential dist_normal dist_poisson
dist_t dist_uniform dumpall dumpfile dumpflush dumplimit dumpoff
dumpon dumpports dumpportsall dumpportsflush dumpportslimit
dumpportsoff dumpportson dumpvars error exit exp falling_gclk fclose
fdisplay fdisplayb fdisplayh fdisplayo fell fell_gclk feof ferror
fflush fgetc fgets finish floor fmonitor fmonitorb fmonitorh fmonitoro
fopen fread fscanf fseek fstrobe fstrobeb fstrobeh fstrobeo ftell
future_gclk fwrite fwriteb fwriteh fwriteo get_coverage high hypot
increment info isunbounded isunknown itor left ln load_coverage_db
log10 low monitor monitorb monitorh monitoro monitoroff monitoron
onehot onehot0 past past_gclk pow printtimescale q_add q_exam q_full
q_initialize q_remove random readmemb readmemh realtime realtobits
rewind right rising_gclk rose rose_gclk rtoi sampled
set_coverage_db_name sformat sformatf shortrealtobits signed sin sinh
size sqrt sscanf stable stable_gclk steady_gclk stime stop strobe
strobeb strobeh strobeo swrite swriteb swriteh swriteo system tan tanh
time timeformat typename ungetc unpacked_dimensions unsigned warning
write writeb writeh writememb writememh writeo
)
end
state :expr_bol do
mixin :inline_whitespace
rule /`define/, Comment::Preproc, :macro
rule(//) { pop! }
end
# :expr_bol is the same as :bol but without labels, since
# labels can only appear at the beginning of a statement.
state :bol do
rule /#{id}:(?!:)/, Name::Label
mixin :expr_bol
end
state :inline_whitespace do
rule /[ \t\r]+/, Text
rule /\\\n/, Text # line continuation
rule %r(/(\\\n)?[*].*?[*](\\\n)?/)m, Comment::Multiline
end
state :whitespace do
rule /\n+/m, Text, :bol
rule %r(//(\\.|.)*?\n), Comment::Single, :bol
mixin :inline_whitespace
end
state :expr_whitespace do
rule /\n+/m, Text, :expr_bol
mixin :whitespace
end
state :string do
rule /"/, Str, :pop!
rule /\\([\\abfnrtv"']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})/, Str::Escape
rule /[^\\"\n]+/, Str
rule /\\\n/, Str
rule /\\/, Str # stray backslash
end
state :statement do
mixin :whitespace
rule /L?"/, Str, :string
rule /([0-9_]+\.[0-9_]*|[0-9_]*\.[0-9_]+)(e[+-]?[0-9_]+)?/i, Num::Float
rule /[0-9_]+e[+-]?[0-9_]+/i, Num::Float
rule /[0-9]*'h[0-9a-fA-F_?]+/, Num::Hex
rule /[0-9]*'b?[01xz_?]+/, Num::Bin
rule /[0-9]*'d[0-9_?]+/, Num::Integer
rule /[0-9_]+[lu]*/i, Num::Integer
rule %r([~!%^&*+-=\|?:<>/@{}]), Operator
rule /[()\[\],.$\#]/, Punctuation
rule /`(\w+)/, Comment::Preproc
rule id do |m|
name = m[0]
if self.class.keywords.include? name
token Keyword
elsif self.class.keywords_type.include? name
token Keyword::Type
elsif self.class.keywords_system_task.include? name
token Name::Builtin
else
token Name
end
end
end
state :root do
mixin :expr_whitespace
rule(//) { push :statement }
end
state :macro do
rule /\n/, Comment::Preproc, :pop!
mixin :inline_whitespace
rule /;/, Punctuation
rule /\=/, Operator
rule /(\w+)/, Text
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/ceylon.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/ceylon.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
class Ceylon < RegexLexer
tag 'ceylon'
filenames '*.ceylon'
mimetypes 'text/x-ceylon'
title "Ceylon"
desc 'Say more, more clearly.'
keywords = %w(
break case catch continue else finally for in
if return switch this throw try while is exists dynamic
nonempty then outer assert let
)
keywords_declaration = %w(
abstracts extends satisfies super given of out assign
)
keywords_type = %w(
function value void new
)
keywords_namespace = %w(
assembly module package
)
keywords_constant = %w(
true false null
)
annotations = %w(
shared abstract formal default actual variable deprecated small
late literal doc by see throws optional license tagged final native
annotation sealed
)
state :whitespace do
rule %r([^\S\n]+), Text
rule %r(//.*?\n), Comment::Single
rule %r(/\*), Comment::Multiline
end
state :root do
mixin :whitespace
rule %r((shared|abstract|formal|default|actual|variable|deprecated|small|
late|literal|doc|by|see|throws|optional|license|tagged|final|native|
annotation|sealed)\b), Name::Decorator
rule %r((break|case|catch|continue|else|finally|for|in|
if|return|switch|this|throw|try|while|is|exists|dynamic|
nonempty|then|outer|assert|let)\b), Keyword
rule %r((abstracts|extends|satisfies|super|given|of|out|assign)\b), Keyword::Declaration
rule %r((function|value|void|new)\b), Keyword::Type
rule %r((assembly|module|package)(\s+)) do
groups Keyword::Namespace, Text
push :import
end
rule %r((true|false|null)\b), Keyword::Constant
rule %r((class|interface|object|alias)(\s+)) do
groups Keyword::Declaration, Text
push :class
end
rule %r((import)(\s+)) do
groups Keyword::Namespace, Text
push :import
end
rule %r("(\\\\|\\"|[^"])*"), Literal::String
rule %r('\\.'|'[^\\]'|'\\\{#[0-9a-fA-F]{4}\}'), Literal::String::Char
rule %r(".*``.*``.*"', String::Interpol
rule %r(\.)([a-z_]\w*)) do
groups Operator, Name::Attribute
end
rule %r([a-zA-Z_]\w*:), Name::Label
rule %r((\\I[a-z]|[A-Z])\w*), Name::Decorator
rule %r([a-zA-Z_]\w*), Name
rule %r([~^*!%&\[\](){}<>|+=:;,./?-`]), Operator
rule %r(\d{1,3}(_\d{3})+\.\d{1,3}(_\d{3})+[kMGTPmunpf]?), Literal::Number::Float
rule %r(\d{1,3}(_\d{3})+\.[0-9]+([eE][+-]?[0-9]+)?[kMGTPmunpf]?),
Literal::Number::Float
rule %r([0-9][0-9]*\.\d{1,3}(_\d{3})+[kMGTPmunpf]?), Literal::Number::Float
rule %r([0-9][0-9]*\.[0-9]+([eE][+-]?[0-9]+)?[kMGTPmunpf]?),
Literal::Number::Float
rule %r(#([0-9a-fA-F]{4})(_[0-9a-fA-F]{4})+), Literal::Number::Hex
rule %r(#[0-9a-fA-F]+), Literal::Number::Hex
rule %r(\$([01]{4})(_[01]{4})+), Literal::Number::Bin
rule %r(\$[01]+), Literal::Number::Bin
rule %r(\d{1,3}(_\d{3})+[kMGTP]?), Literal::Number::Integer
rule %r([0-9]+[kMGTP]?), Literal::Number::Integer
rule %r(\n), Text
end
state :class do
mixin :whitespace
rule %r([A-Za-z_]\w*), Name::Class, :pop!
end
state :import do
rule %r([a-z][\w.]*), Name::Namespace, :pop!
rule %r("(\\\\|\\"|[^"])*"), Literal::String, :pop!
end
state :comment do
rule %r([^*/]), Comment.Multiline
rule %r(/\*), Comment::Multiline, :push!
rule %r(\*/), Comment::Multiline, :pop!
rule %r([*/]), Comment::Multiline
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/sqf/commands.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/sqf/commands.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
# automatically generated by `rake builtins:sqf`
module Rouge
module Lexers
class SQF < RegexLexer
def self.commands
@commands = Set.new %w(
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | true |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/gherkin/keywords.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/gherkin/keywords.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
# automatically generated by `rake builtins:gherkin`
module Rouge
module Lexers
def Gherkin.keywords
@keywords ||= {}.tap do |k|
k[:feature] = Set.new ["Ability", "Ahoy matey!", "Arwedd", "Aspekt", "Besigheid Behoefte", "Biznis potreba", "Business Need", "Caracteristica", "Característica", "Carauterística", "Egenskab", "Egenskap", "Eiginleiki", "Feature", "Fitur", "Fonctionnalité", "Fonksyonalite", "Funcionalidade", "Funcionalitat", "Functionalitate", "Functionaliteit", "Funcţionalitate", "Funcționalitate", "Fungsi", "Funkcia", "Funkcija", "Funkcionalitāte", "Funkcionalnost", "Funkcja", "Funksie", "Funktionalität", "Funktionalitéit", "Funzionalità", "Fīča", "Gné", "Hwaet", "Hwæt", "Jellemző", "Karakteristik", "Karakteristika", "Lastnost", "Mak", "Mogucnost", "Mogućnost", "Mozhnost", "Moznosti", "Možnosti", "OH HAI", "Omadus", "Ominaisuus", "Osobina", "Potrzeba biznesowa", "Požadavek", "Požiadavka", "Pretty much", "Qap", "Qu'meH 'ut", "Savybė", "Trajto", "Tính năng", "Vermoë", "Vlastnosť", "Właściwość", "Značilnost", "laH", "perbogh", "poQbogh malja'", "Özellik", "Özəllik", "Δυνατότητα", "Λειτουργία", "Бизнис потреба", "Могућност", "Можност", "Мөмкинлек", "Особина", "Свойство", "Функц", "Функционал", "Функционалност", "Функциональность", "Функция", "Функціонал", "Үзенчәлеклелек", "Հատկություն", "Ֆունկցիոնալություն", "תכונה", "خاصية", "خصوصیت", "صلاحیت", "وِیژگی", "کاروبار کی ضرورت", "रूप लेख", "ਖਾਸੀਅਤ", "ਨਕਸ਼ ਨੁਹਾਰ", "ਮੁਹਾਂਦਰਾ", "ક્ષમતા", "લક્ષણ", "વ્યાપાર જરૂર", "அம்சம்", "திறன்", "வணிக தேவை", "గుణము", "ಹೆಚ್ಚಳ", "ความต้องการทางธุรกิจ", "ความสามารถ", "โครงหลัก", "თვისება", "フィーチャ", "功能", "機能", "기능", "📚"]
k[:element] = Set.new ["Abstract Scenario", "Abstrakt Scenario", "Achtergrond", "Aer", "Agtergrond", "Antecedentes", "Antecedents", "Atburðarás", "Awww, look mate", "B4", "Background", "Baggrund", "Bakgrund", "Bakgrunn", "Bakgrunnur", "Bối cảnh", "Casu", "Cefndir", "Cenario", "Cenario de Fundo", "Cenário", "Cenário de Fundo", "Contesto", "Context", "Contexte", "Contexto", "Cás", "Cás Achomair", "Cúlra", "Dasar", "Delineacao do Cenario", "Delineação do Cenário", "Dis is what went down", "Dyagram Senaryo", "Dyagram senaryo", "Esbozo do escenario", "Esbozu del casu", "Escenari", "Escenario", "Esquema de l'escenari", "Esquema del escenario", "Esquema do Cenario", "Esquema do Cenário", "First off", "Fono", "Forgatókönyv", "Forgatókönyv vázlat", "Fundo", "Garis Panduan Senario", "Geçmiş", "Grundlage", "Hannergrond", "Heave to", "Háttér", "Istorik", "Kazo", "Kazo-skizo", "Keadaan", "Kerangka Keadaan", "Kerangka Senario", "Kerangka Situasi", "Keçmiş", "Khung kịch bản", "Khung tình huống", "Koncept", "Konsep skenario", "Kontekst", "Kontekstas", "Konteksts", "Kontext", "Konturo de la scenaro", "Kontèks", "Kịch bản", "Latar Belakang", "Lýsing Atburðarásar", "Lýsing Dæma", "MISHUN", "MISHUN SRSLY", "Na primer", "Náčrt Scenára", "Náčrt Scenáru", "Náčrt Scénáře", "Oris scenarija", "Osnova", "Osnova Scenára", "Osnova scénáře", "Osnutek", "Ozadje", "Plan Senaryo", "Plan du Scénario", "Plan du scénario", "Plan senaryo", "Plang vum Szenario", "Pozadie", "Pozadina", "Pozadí", "Pregled na scenarija", "Primer", "Raamstsenaarium", "Reckon it's like", "Rerefons", "Scenarie", "Scenarij", "Scenarijaus šablonas", "Scenariju", "Scenariju-obris", "Scenarijus", "Scenario", "Scenario Amlinellol", "Scenario Outline", "Scenario Template", "Scenario-outline", "Scenariomal", "Scenariomall", "Scenariu", "Scenariusz", "Scenaro", "Scenár", "Scenārijs", "Scenārijs pēc parauga", "Schema dello scenario", "Scénario", "Scénář", "Senario", "Senaryo", "Senaryo Deskripsyon", "Senaryo deskripsyon", "Senaryo taslağı", "Shiver me timbers", "Situasi", "Situasie", "Situasie Uiteensetting", "Situācija", "Skenario", "Skenario konsep", "Skica", "Skizo", "Sodrzhina", "Ssenari", "Ssenarinin strukturu", "Structura scenariu", "Structură scenariu", "Struktura scenarija", "Stsenaarium", "Swa", "Swa hwaer swa", "Swa hwær swa", "Szablon scenariusza", "Szenario", "Szenariogrundriss", "Tapaus", "Tapausaihio", "Taust", "Tausta", "The thing of it is", "Tình huống", "Wharrimean is", "Yo-ho-ho", "Założenia", "lut", "lut chovnatlh", "mo'", "Ær", "Περιγραφή Σεναρίου", "Σενάριο", "Υπόβαθρο", "Агуулга", "Кереш", "Контекст", "Концепт", "На пример", "Основа", "Передумова", "Позадина", "Преглед на сценарија", "Предистория", "Предыстория", "Пример", "Рамка на сценарий", "Скица", "Содржина", "Структура сценария", "Структура сценарија", "Структура сценарію", "Сценар", "Сценарий", "Сценарий структураси", "Сценарийның төзелеше", "Сценарио", "Сценарын төлөвлөгөө", "Сценарій", "Тарих", "Կոնտեքստ", "Սցենար", "Սցենարի կառուցվացքը", "רקע", "תבנית תרחיש", "תרחיש", "الخلفية", "الگوی سناریو", "زمینه", "سناریو", "سيناريو", "سيناريو مخطط", "منظر نامے کا خاکہ", "منظرنامہ", "پس منظر", "परिदृश्य", "परिदृश्य रूपरेखा", "पृष्ठभूमि", "ਪਟਕਥਾ", "ਪਟਕਥਾ ਢਾਂਚਾ", "ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ", "ਪਿਛੋਕੜ", "પરિદ્દશ્ય ઢાંચો", "પરિદ્દશ્ય રૂપરેખા", "બેકગ્રાઉન્ડ", "સ્થિતિ", "காட்சி", "காட்சி சுருக்கம்", "காட்சி வார்ப்புரு", "பின்னணி", "కథనం", "నేపథ్యం", "సన్నివేశం", "ಕಥಾಸಾರಾಂಶ", "ವಿವರಣೆ", "ಹಿನ್ನೆಲೆ", "สรุปเหตุการณ์", "เหตุการณ์", "แนวคิด", "โครงสร้างของเหตุการณ์", "კონტექსტი", "სცენარის", "სცენარის ნიმუში", "シナリオ", "シナリオアウトライン", "シナリオテンプレ", "シナリオテンプレート", "テンプレ", "剧本", "剧本大纲", "劇本", "劇本大綱", "场景", "场景大纲", "場景", "場景大綱", "背景", "배경", "시나리오", "시나리오 개요", "💤", "📕", "📖"]
k[:examples] = Set.new [" நிலைமைகளில்", "Atburðarásir", "Beispiele", "Beispiller", "Cenarios", "Cenários", "Conto", "Contoh", "Contone", "Dead men tell no tales", "Dæmi", "Dữ liệu", "EXAMPLZ", "Egzanp", "Ejemplos", "Eksempler", "Ekzemploj", "Enghreifftiau", "Esempi", "Examples", "Exempel", "Exemple", "Exemples", "Exemplos", "Juhtumid", "Nümunələr", "Paraugs", "Pavyzdžiai", "Piemēri", "Primeri", "Primjeri", "Przykłady", "Príklady", "Példák", "Příklady", "Samplaí", "Scenaria", "Scenarijai", "Scenariji", "Scenarios", "Se the", "Se ðe", "Se þe", "Tapaukset", "Variantai", "Voorbeelde", "Voorbeelden", "You'll wanna", "ghantoH", "lutmey", "Örnekler", "Παραδείγματα", "Σενάρια", "Мисаллар", "Мисоллар", "Приклади", "Примери", "Примеры", "Сценарија", "Сценарији", "Тухайлбал", "Үрнәкләр", "Օրինակներ", "דוגמאות", "امثلة", "مثالیں", "نمونه ها", "उदाहरण", "ਉਦਾਹਰਨਾਂ", "ઉદાહરણો", "எடுத்துக்காட்டுகள்", "காட்சிகள்", "ఉదాహరణలు", "ಉದಾಹರಣೆಗಳು", "ชุดของตัวอย่าง", "ชุดของเหตุการณ์", "მაგალითები", "サンプル", "例", "例子", "예", "📓"]
k[:step] = Set.new ["'a ", "'ach ", "'ej ", "* ", "7 ", "A ", "A taktiež ", "A také ", "A tiež ", "A zároveň ", "AN ", "Aber ", "Ac ", "Ach", "Adott ", "Agus", "Ak ", "Akkor ", "Ale ", "Aleshores ", "Ali ", "Allora ", "Alors ", "Als ", "Ama ", "Amennyiben ", "Amikor ", "Amma ", "Ampak ", "An ", "Ananging ", "Ancaq ", "And ", "Angenommen ", "Anrhegedig a ", "Ansin", "Apabila ", "Atesa ", "Atunci ", "Atès ", "Avast! ", "Aye ", "BUT ", "Bagi ", "Banjur ", "Bet ", "Biết ", "Blimey! ", "Buh ", "But ", "But at the end of the day I reckon ", "Cal ", "Cand ", "Cando ", "Ce ", "Cho ", "Cuando ", "Cuir i gcás go", "Cuir i gcás gur", "Cuir i gcás nach", "Cuir i gcás nár", "Când ", "DEN ", "DaH ghu' bejlu' ", "Dada ", "Dadas ", "Dadena ", "Dadeno ", "Dado ", "Dados ", "Daes ", "Dan ", "Dann ", "Dano ", "Daos ", "Dar ", "Dat fiind ", "Data ", "Date ", "Date fiind ", "Dati ", "Dati fiind ", "Dato ", "Daţi fiind ", "Dați fiind ", "De ", "Den youse gotta ", "Dengan ", "Diberi ", "Diyelim ki ", "Do ", "Donada ", "Donat ", "Donitaĵo ", "Dun ", "Duota ", "Dáu ", "E ", "Eeldades ", "Ef ", "En ", "Entao ", "Entonces ", "Então ", "Entón ", "Entós ", "Epi ", "Et ", "Et qu'", "Et que ", "Etant donné ", "Etant donné qu'", "Etant donné que ", "Etant donnée ", "Etant données ", "Etant donnés ", "Eğer ki ", "Fakat ", "Gangway! ", "Gdy ", "Gegeben sei ", "Gegeben seien ", "Gegeven ", "Gegewe ", "Gitt ", "Given ", "Givet ", "Givun ", "Ha ", "Həm ", "I ", "I CAN HAZ ", "In ", "Ir ", "It's just unbelievable ", "Ja ", "Jeśli ", "Jeżeli ", "Kad ", "Kada ", "Kadar ", "Kai ", "Kaj ", "Když ", "Kemudian ", "Ketika ", "Keď ", "Khi ", "Kiedy ", "Ko ", "Koga ", "Komence ", "Kui ", "Kuid ", "Kun ", "Lan ", "Le ", "Le sa a ", "Let go and haul ", "Logo ", "Lorsqu'", "Lorsque ", "Lè ", "Lè sa a ", "Ma ", "Maar ", "Mais ", "Mais qu'", "Mais que ", "Majd ", "Mając ", "Maka ", "Manawa ", "Mas ", "Men ", "Menawa ", "Mutta ", "Nalika ", "Nalikaning ", "Nanging ", "Nato ", "Nhưng ", "Niin ", "Njuk ", "No ", "Nuair a", "Nuair ba", "Nuair nach", "Nuair nár", "När ", "Når ", "Nə vaxt ki ", "O halda ", "O zaman ", "Och ", "Og ", "Oletetaan ", "Ond ", "Onda ", "Oraz ", "Pak ", "Pero ", "Peru ", "Però ", "Podano ", "Pokiaľ ", "Pokud ", "Potem ", "Potom ", "Privzeto ", "Pryd ", "Quan ", "Quand ", "Quando ", "Se ", "Sed ", "Si ", "Siis ", "Sipoze ", "Sipoze Ke ", "Sipoze ke ", "Soit ", "Stel ", "Så ", "Tad ", "Tada ", "Tak ", "Takrat ", "Tapi ", "Ter ", "Tetapi ", "Tha ", "Tha the ", "Then ", "Thurh ", "Thì ", "Toda ", "Togash ", "Too right ", "Tutaq ki ", "Un ", "Und ", "Ve ", "Vendar ", "Verilir ", "Và ", "Və ", "WEN ", "Wanneer ", "Wenn ", "When ", "Wtedy ", "Wun ", "Y ", "Y'know ", "Ya ", "Yeah nah ", "Yna ", "Youse know like when ", "Youse know when youse got ", "Za date ", "Za dati ", "Za dato ", "Za predpokladu ", "Za předpokladu ", "Zadan ", "Zadani ", "Zadano ", "Zakładając ", "Zakładając, że ", "Zaradi ", "Zatim ", "a ", "an ", "awer ", "dann ", "ghu' noblu' ", "latlh ", "mä ", "qaSDI' ", "ugeholl ", "vaj ", "wann ", "És ", "Étant donné ", "Étant donné qu'", "Étant donné que ", "Étant donnée ", "Étant données ", "Étant donnés ", "Ða ", "Ða ðe ", "Ðurh ", "Þa ", "Þa þe ", "Þegar ", "Þurh ", "Þá ", "Če ", "Şi ", "Əgər ", "Și ", "Όταν ", "Αλλά ", "Δεδομένου ", "Και ", "Τότε ", "І ", "А ", "А також ", "Агар ", "Але ", "Али ", "Аммо ", "Анх ", "Бирок ", "Ва ", "Вә ", "Гэхдээ ", "Дадена ", "Дадено ", "Дано ", "Допустим ", "Если ", "За дате ", "За дати ", "За дато ", "Затем ", "И ", "К тому же ", "Кад ", "Када ", "Кога ", "Когато ", "Когда ", "Коли ", "Лекин ", "Ләкин ", "Мөн ", "Нехай ", "Но ", "Нәтиҗәдә ", "Онда ", "Припустимо ", "Припустимо, що ", "Пусть ", "Та ", "Также ", "То ", "Тогаш ", "Тогда ", "Тоді ", "Тэгэхэд ", "Тэгээд ", "Унда ", "Харин ", "Хэрэв ", "Якщо ", "Үүний дараа ", "Һәм ", "Әгәр ", "Әйтик ", "Әмма ", "Өгөгдсөн нь ", "Ապա ", "Բայց ", "Դիցուք ", "Եթե ", "Եվ ", "Երբ ", "אבל ", "אז ", "אזי ", "בהינתן ", "וגם ", "כאשר ", "آنگاه ", "اذاً ", "اما ", "اور ", "اگر ", "با فرض ", "بالفرض ", "بفرض ", "تب ", "ثم ", "جب ", "عندما ", "فرض کیا ", "لكن ", "لیکن ", "متى ", "هنگامی ", "و ", "پھر ", "अगर ", "और ", "कदा ", "किन्तु ", "चूंकि ", "जब ", "तथा ", "तदा ", "तब ", "पर ", "परन्तु ", "यदि ", "ਅਤੇ ", "ਜਦੋਂ ", "ਜਿਵੇਂ ਕਿ ", "ਜੇਕਰ ", "ਤਦ ", "ਪਰ ", "અને ", "આપેલ છે ", "ક્યારે ", "પછી ", "પણ ", "அப்பொழுது ", "ஆனால் ", "எப்போது ", "கொடுக்கப்பட்ட ", "மற்றும் ", "மேலும் ", "అప్పుడు ", "ఈ పరిస్థితిలో ", "కాని ", "చెప్పబడినది ", "మరియు ", "ಆದರೆ ", "ನಂತರ ", "ನೀಡಿದ ", "ಮತ್ತು ", "ಸ್ಥಿತಿಯನ್ನು ", "กำหนดให้ ", "ดังนั้น ", "เมื่อ ", "แต่ ", "และ ", "და", "მაგრამ", "მაშინ", "მოცემული", "როდესაც", "かつ", "しかし", "ただし", "ならば", "もし", "並且", "但し", "但是", "假如", "假定", "假設", "假设", "前提", "同时", "同時", "并且", "当", "當", "而且", "那么", "那麼", "그러면", "그리고", "단", "만약", "만일", "먼저", "조건", "하지만", "🎬", "😂", "😐", "😔", "🙏"]
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/lua/builtins.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/lua/builtins.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
# automatically generated by `rake builtins:lua`
module Rouge
module Lexers
class Lua
def self.builtins
@builtins ||= {}.tap do |b|
b["basic"] = Set.new %w(_G _VERSION assert collectgarbage dofile error getmetatable ipairs load loadfile next pairs pcall print rawequal rawget rawlen rawset select setmetatable tonumber tostring type xpcall file:close file:flush file:lines file:read file:seek file:setvbuf file:write LUA_CPATH LUA_CPATH_5_2 LUA_INIT LUA_INIT_5_2 LUA_PATH LUA_PATH_5_2 luaopen_base luaopen_bit32 luaopen_coroutine luaopen_debug luaopen_io luaopen_math luaopen_os luaopen_package luaopen_string luaopen_table LUA_ERRERR LUA_ERRFILE LUA_ERRGCMM LUA_ERRMEM LUA_ERRRUN LUA_ERRSYNTAX LUA_HOOKCALL LUA_HOOKCOUNT LUA_HOOKLINE LUA_HOOKRET LUA_HOOKTAILCALL LUA_MASKCALL LUA_MASKCOUNT LUA_MASKLINE LUA_MASKRET LUA_MINSTACK LUA_MULTRET LUA_NOREF LUA_OK LUA_OPADD LUA_OPDIV LUA_OPEQ LUA_OPLE LUA_OPLT LUA_OPMOD LUA_OPMUL LUA_OPPOW LUA_OPSUB LUA_OPUNM LUA_REFNIL LUA_REGISTRYINDEX LUA_RIDX_GLOBALS LUA_RIDX_MAINTHREAD LUA_TBOOLEAN LUA_TFUNCTION LUA_TLIGHTUSERDATA LUA_TNIL LUA_TNONE LUA_TNUMBER LUA_TSTRING LUA_TTABLE LUA_TTHREAD LUA_TUSERDATA LUA_USE_APICHECK LUA_YIELD LUAL_BUFFERSIZE)
b["modules"] = Set.new %w(require package.config package.cpath package.loaded package.loadlib package.path package.preload package.searchers package.searchpath)
b["bit32"] = Set.new %w(bit32.arshift bit32.band bit32.bnot bit32.bor bit32.btest bit32.bxor bit32.extract bit32.lrotate bit32.lshift bit32.replace bit32.rrotate bit32.rshift)
b["coroutine"] = Set.new %w(coroutine.create coroutine.resume coroutine.running coroutine.status coroutine.wrap coroutine.yield)
b["debug"] = Set.new %w(debug.debug debug.getuservalue debug.gethook debug.getinfo debug.getlocal debug.getmetatable debug.getregistry debug.getupvalue debug.setuservalue debug.sethook debug.setlocal debug.setmetatable debug.setupvalue debug.traceback debug.upvalueid debug.upvaluejoin)
b["io"] = Set.new %w(io.close io.flush io.input io.lines io.open io.output io.popen io.read io.stderr io.stdin io.stdout io.tmpfile io.type io.write)
b["math"] = Set.new %w(math.abs math.acos math.asin math.atan math.atan2 math.ceil math.cos math.cosh math.deg math.exp math.floor math.fmod math.frexp math.huge math.ldexp math.log math.max math.min math.modf math.pi math.pow math.rad math.random math.randomseed math.sin math.sinh math.sqrt math.tan math.tanh)
b["os"] = Set.new %w(os.clock os.date os.difftime os.execute os.exit os.getenv os.remove os.rename os.setlocale os.time os.tmpname)
b["string"] = Set.new %w(string.byte string.char string.dump string.find string.format string.gmatch string.gsub string.len string.lower string.match string.rep string.reverse string.sub string.upper)
b["table"] = Set.new %w(table.concat table.insert table.pack table.remove table.sort table.unpack)
end
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/mathematica/builtins.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/mathematica/builtins.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
# automatically generated by `rake builtins:mathematica`
module Rouge
module Lexers
class Mathematica
def self.builtins
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | true |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/sass/common.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/sass/common.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
# shared states with SCSS
class SassCommon < RegexLexer
id = /[\w-]+/
state :content_common do
rule /@for\b/, Keyword, :for
rule /@(debug|warn|if|each|while|else|return|media)/, Keyword, :value
rule /(@mixin)(\s+)(#{id})/ do
groups Keyword, Text, Name::Function
push :value
end
rule /(@function)(\s+)(#{id})/ do
groups Keyword, Text, Name::Function
push :value
end
rule /@extend\b/, Keyword, :selector
rule /(@include)(\s+)(#{id})/ do
groups Keyword, Text, Name::Decorator
push :value
end
rule /@#{id}/, Keyword, :selector
# $variable: assignment
rule /([$]#{id})([ \t]*)(:)/ do
groups Name::Variable, Text, Punctuation
push :value
end
end
state :value do
mixin :end_section
rule /[ \t]+/, Text
rule /[$]#{id}/, Name::Variable
rule /url[(]/, Str::Other, :string_url
rule /#{id}(?=\s*[(])/, Name::Function
rule /%#{id}/, Name::Decorator
# named literals
rule /(true|false)\b/, Name::Builtin::Pseudo
rule /(and|or|not)\b/, Operator::Word
# colors and numbers
rule /#[a-z0-9]{1,6}/i, Num::Hex
rule /-?\d+(%|[a-z]+)?/, Num
rule /-?\d*\.\d+(%|[a-z]+)?/, Num::Integer
mixin :has_strings
mixin :has_interp
rule /[~^*!&%<>\|+=@:,.\/?-]+/, Operator
rule /[\[\]()]+/, Punctuation
rule %r(/[*]), Comment::Multiline, :inline_comment
rule %r(//[^\n]*), Comment::Single
# identifiers
rule(id) do |m|
if CSS.builtins.include? m[0]
token Name::Builtin
elsif CSS.constants.include? m[0]
token Name::Constant
else
token Name
end
end
end
state :has_interp do
rule /[#][{]/, Str::Interpol, :interpolation
end
state :has_strings do
rule /"/, Str::Double, :dq
rule /'/, Str::Single, :sq
end
state :interpolation do
rule /}/, Str::Interpol, :pop!
mixin :value
end
state :selector do
mixin :end_section
mixin :has_strings
mixin :has_interp
rule /[ \t]+/, Text
rule /:/, Name::Decorator, :pseudo_class
rule /[.]/, Name::Class, :class
rule /#/, Name::Namespace, :id
rule /%/, Name::Variable, :placeholder
rule id, Name::Tag
rule /&/, Keyword
rule /[~^*!&\[\]()<>\|+=@:;,.\/?-]/, Operator
end
state :dq do
rule /"/, Str::Double, :pop!
mixin :has_interp
rule /(\\.|#(?![{])|[^\n"#])+/, Str::Double
end
state :sq do
rule /'/, Str::Single, :pop!
mixin :has_interp
rule /(\\.|#(?![{])|[^\n'#])+/, Str::Single
end
state :string_url do
rule /[)]/, Str::Other, :pop!
rule /(\\.|#(?![{])|[^\n)#])+/, Str::Other
mixin :has_interp
end
state :selector_piece do
mixin :has_interp
rule(//) { pop! }
end
state :pseudo_class do
rule id, Name::Decorator
mixin :selector_piece
end
state :class do
rule id, Name::Class
mixin :selector_piece
end
state :id do
rule id, Name::Namespace
mixin :selector_piece
end
state :placeholder do
rule id, Name::Variable
mixin :selector_piece
end
state :for do
rule /(from|to|through)/, Operator::Word
mixin :value
end
state :attr_common do
mixin :has_interp
rule id do |m|
if CSS.attributes.include? m[0]
token Name::Label
else
token Name::Attribute
end
end
end
state :attribute do
mixin :attr_common
rule /([ \t]*)(:)/ do
groups Text, Punctuation
push :value
end
end
state :inline_comment do
rule /(\\#|#(?=[^\n{])|\*(?=[^\n\/])|[^\n#*])+/, Comment::Multiline
mixin :has_interp
rule %r([*]/), Comment::Multiline, :pop!
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/viml/keywords.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/viml/keywords.rb | # encoding: utf-8
# frozen_string_literal: true
# DO NOT EDIT: automatically generated by `rake builtins:vim`.
# see tasks/vim.rake for more info.
module Rouge
module Lexers
class VimL
def self.keywords
@keywords ||= {:command=>[["a", "a"], ["abc", "abclear"], ["abo", "aboveleft"], ["al", "all"], ["ar", "args"], ["arga", "argadd"], ["argd", "argdelete"], ["argdo", "argdo"], ["arge", "argedit"], ["argg", "argglobal"], ["argl", "arglocal"], ["argu", "argument"], ["as", "ascii"], ["au", "au"], ["b", "buffer"], ["bN", "bNext"], ["ba", "ball"], ["bad", "badd"], ["bd", "bdelete"], ["bel", "belowright"], ["bf", "bfirst"], ["bl", "blast"], ["bm", "bmodified"], ["bn", "bnext"], ["bo", "botright"], ["bp", "bprevious"], ["br", "brewind"], ["brea", "break"], ["breaka", "breakadd"], ["breakd", "breakdel"], ["breakl", "breaklist"], ["bro", "browse"], ["bufdo", "bufdo"], ["buffers", "buffers"], ["bun", "bunload"], ["bw", "bwipeout"], ["c", "change"], ["cN", "cNext"], ["cNf", "cNfile"], ["cabc", "cabclear"], ["cad", "caddbuffer"], ["cadde", "caddexpr"], ["caddf", "caddfile"], ["cal", "call"], ["cat", "catch"], ["cb", "cbuffer"], ["cbo", "cbottom"], ["cc", "cc"], ["ccl", "cclose"], ["cd", "cd"], ["cdo", "cdo"], ["ce", "center"], ["cex", "cexpr"], ["cf", "cfile"], ["cfdo", "cfdo"], ["cfir", "cfirst"], ["cg", "cgetfile"], ["cgetb", "cgetbuffer"], ["cgete", "cgetexpr"], ["changes", "changes"], ["chd", "chdir"], ["che", "checkpath"], ["checkt", "checktime"], ["chi", "chistory"], ["cl", "clist"], ["cla", "clast"], ["cle", "clearjumps"], ["clo", "close"], ["cmapc", "cmapclear"], ["cn", "cnext"], ["cnew", "cnewer"], ["cnf", "cnfile"], ["co", "copy"], ["col", "colder"], ["colo", "colorscheme"], ["com", "com"], ["comc", "comclear"], ["comp", "compiler"], ["con", "continue"], ["conf", "confirm"], ["cope", "copen"], ["cp", "cprevious"], ["cpf", "cpfile"], ["cq", "cquit"], ["cr", "crewind"], ["cs", "cs"], ["cscope", "cscope"], ["cstag", "cstag"], ["cuna", "cunabbrev"], ["cw", "cwindow"], ["d", "delete"], ["debug", "debug"], ["debugg", "debuggreedy"], ["delc", "delcommand"], ["delel", "delel"], ["delep", "delep"], ["deletel", "deletel"], ["deletep", "deletep"], ["deletl", "deletl"], ["deletp", "deletp"], ["delf", "delfunction"], ["dell", "dell"], ["delm", "delmarks"], ["delp", "delp"], ["dep", "dep"], ["di", "display"], ["dif", "diffupdate"], ["diffg", "diffget"], ["diffo", "diffoff"], ["diffp", "diffpatch"], ["diffpu", "diffput"], ["diffs", "diffsplit"], ["difft", "diffthis"], ["dig", "digraphs"], ["dir", "dir"], ["dj", "djump"], ["dl", "dl"], ["dli", "dlist"], ["do", "do"], ["doau", "doau"], ["dp", "dp"], ["dr", "drop"], ["ds", "dsearch"], ["dsp", "dsplit"], ["e", "edit"], ["ea", "ea"], ["earlier", "earlier"], ["echoe", "echoerr"], ["echom", "echomsg"], ["echon", "echon"], ["el", "else"], ["elsei", "elseif"], ["em", "emenu"], ["en", "endif"], ["endf", "endfunction"], ["endfo", "endfor"], ["endt", "endtry"], ["endw", "endwhile"], ["ene", "enew"], ["ex", "ex"], ["exi", "exit"], ["exu", "exusage"], ["f", "file"], ["files", "files"], ["filet", "filet"], ["filetype", "filetype"], ["filt", "filter"], ["fin", "find"], ["fina", "finally"], ["fini", "finish"], ["fir", "first"], ["fix", "fixdel"], ["fo", "fold"], ["foldc", "foldclose"], ["foldd", "folddoopen"], ["folddoc", "folddoclosed"], ["foldo", "foldopen"], ["for", "for"], ["fu", "function"], ["g", "g"], ["go", "goto"], ["gr", "grep"], ["grepa", "grepadd"], ["gui", "gui"], ["gvim", "gvim"], ["h", "help"], ["ha", "hardcopy"], ["helpc", "helpclose"], ["helpf", "helpfind"], ["helpg", "helpgrep"], ["helpt", "helptags"], ["hi", "hi"], ["hid", "hide"], ["his", "history"], ["i", "i"], ["iabc", "iabclear"], ["if", "if"], ["ij", "ijump"], ["il", "ilist"], ["imapc", "imapclear"], ["in", "in"], ["intro", "intro"], ["is", "isearch"], ["isp", "isplit"], ["iuna", "iunabbrev"], ["j", "join"], ["ju", "jumps"], ["k", "k"], ["kee", "keepmarks"], ["keepa", "keepa"], ["keepalt", "keepalt"], ["keepj", "keepjumps"], ["keepp", "keeppatterns"], ["l", "list"], ["lN", "lNext"], ["lNf", "lNfile"], ["la", "last"], ["lad", "laddexpr"], ["laddb", "laddbuffer"], ["laddf", "laddfile"], ["lan", "language"], ["lat", "lat"], ["later", "later"], ["lb", "lbuffer"], ["lbo", "lbottom"], ["lc", "lcd"], ["lch", "lchdir"], ["lcl", "lclose"], ["lcs", "lcs"], ["lcscope", "lcscope"], ["ld", "ldo"], ["le", "left"], ["lefta", "leftabove"], ["lex", "lexpr"], ["lf", "lfile"], ["lfdo", "lfdo"], ["lfir", "lfirst"], ["lg", "lgetfile"], ["lgetb", "lgetbuffer"], ["lgete", "lgetexpr"], ["lgr", "lgrep"], ["lgrepa", "lgrepadd"], ["lh", "lhelpgrep"], ["lhi", "lhistory"], ["ll", "ll"], ["lla", "llast"], ["lli", "llist"], ["lmak", "lmake"], ["lmapc", "lmapclear"], ["lne", "lnext"], ["lnew", "lnewer"], ["lnf", "lnfile"], ["lo", "loadview"], ["loadk", "loadk"], ["loadkeymap", "loadkeymap"], ["loc", "lockmarks"], ["lockv", "lockvar"], ["lol", "lolder"], ["lop", "lopen"], ["lp", "lprevious"], ["lpf", "lpfile"], ["lr", "lrewind"], ["ls", "ls"], ["lt", "ltag"], ["lua", "lua"], ["luado", "luado"], ["luafile", "luafile"], ["lv", "lvimgrep"], ["lvimgrepa", "lvimgrepadd"], ["lw", "lwindow"], ["m", "move"], ["ma", "mark"], ["mak", "make"], ["marks", "marks"], ["mat", "match"], ["menut", "menutranslate"], ["mes", "mes"], ["messages", "messages"], ["mk", "mkexrc"], ["mks", "mksession"], ["mksp", "mkspell"], ["mkv", "mkvimrc"], ["mkvie", "mkview"], ["mod", "mode"], ["mz", "mzscheme"], ["mzf", "mzfile"], ["n", "next"], ["nb", "nbkey"], ["nbc", "nbclose"], ["nbs", "nbstart"], ["new", "new"], ["nmapc", "nmapclear"], ["noa", "noa"], ["noautocmd", "noautocmd"], ["noh", "nohlsearch"], ["nor", "nor"], ["nore", "nore"], ["nos", "noswapfile"], ["nu", "number"], ["o", "open"], ["ol", "oldfiles"], ["omapc", "omapclear"], ["on", "only"], ["opt", "options"], ["ownsyntax", "ownsyntax"], ["p", "print"], ["pa", "packadd"], ["packl", "packloadall"], ["pc", "pclose"], ["pe", "perl"], ["ped", "pedit"], ["perld", "perldo"], ["po", "pop"], ["popu", "popup"], ["pp", "ppop"], ["pre", "preserve"], ["prev", "previous"], ["pro", "pro"], ["prof", "profile"], ["profd", "profdel"], ["promptf", "promptfind"], ["promptr", "promptrepl"], ["ps", "psearch"], ["ptN", "ptNext"], ["pta", "ptag"], ["ptf", "ptfirst"], ["ptj", "ptjump"], ["ptl", "ptlast"], ["ptn", "ptnext"], ["ptp", "ptprevious"], ["ptr", "ptrewind"], ["pts", "ptselect"], ["pu", "put"], ["pw", "pwd"], ["py", "python"], ["py3", "py3"], ["py3", "py3"], ["py3do", "py3do"], ["pydo", "pydo"], ["pyf", "pyfile"], ["python3", "python3"], ["q", "quit"], ["qa", "qall"], ["quita", "quitall"], ["r", "read"], ["rec", "recover"], ["red", "redo"], ["redi", "redir"], ["redr", "redraw"], ["redraws", "redrawstatus"], ["reg", "registers"], ["res", "resize"], ["ret", "retab"], ["retu", "return"], ["rew", "rewind"], ["ri", "right"], ["rightb", "rightbelow"], ["ru", "runtime"], ["rub", "ruby"], ["rubyd", "rubydo"], ["rubyf", "rubyfile"], ["rundo", "rundo"], ["rv", "rviminfo"], ["sI", "sI"], ["sIc", "sIc"], ["sIe", "sIe"], ["sIg", "sIg"], ["sIl", "sIl"], ["sIn", "sIn"], ["sIp", "sIp"], ["sIr", "sIr"], ["sN", "sNext"], ["sa", "sargument"], ["sal", "sall"], ["san", "sandbox"], ["sav", "saveas"], ["sb", "sbuffer"], ["sbN", "sbNext"], ["sba", "sball"], ["sbf", "sbfirst"], ["sbl", "sblast"], ["sbm", "sbmodified"], ["sbn", "sbnext"], ["sbp", "sbprevious"], ["sbr", "sbrewind"], ["sc", "sc"], ["scI", "scI"], ["sce", "sce"], ["scg", "scg"], ["sci", "sci"], ["scl", "scl"], ["scp", "scp"], ["scr", "scriptnames"], ["scripte", "scriptencoding"], ["scs", "scs"], ["scscope", "scscope"], ["se", "set"], ["setf", "setfiletype"], ["setg", "setglobal"], ["setl", "setlocal"], ["sf", "sfind"], ["sfir", "sfirst"], ["sg", "sg"], ["sgI", "sgI"], ["sgc", "sgc"], ["sge", "sge"], ["sgi", "sgi"], ["sgl", "sgl"], ["sgn", "sgn"], ["sgp", "sgp"], ["sgr", "sgr"], ["sh", "shell"], ["si", "si"], ["sic", "sic"], ["sie", "sie"], ["sig", "sig"], ["sign", "sign"], ["sil", "silent"], ["sim", "simalt"], ["sin", "sin"], ["sip", "sip"], ["sir", "sir"], ["sl", "sleep"], ["sla", "slast"], ["sm", "smagic"], ["sm", "smap"], ["sme", "sme"], ["smenu", "smenu"], ["smile", "smile"], ["sn", "snext"], ["sno", "snomagic"], ["snoreme", "snoreme"], ["snoremenu", "snoremenu"], ["so", "source"], ["sor", "sort"], ["sp", "split"], ["spe", "spellgood"], ["spelld", "spelldump"], ["spelli", "spellinfo"], ["spellr", "spellrepall"], ["spellu", "spellundo"], ["spellw", "spellwrong"], ["spr", "sprevious"], ["sr", "sr"], ["srI", "srI"], ["src", "src"], ["sre", "srewind"], ["srg", "srg"], ["sri", "sri"], ["srl", "srl"], ["srn", "srn"], ["srp", "srp"], ["st", "stop"], ["sta", "stag"], ["star", "startinsert"], ["startg", "startgreplace"], ["startr", "startreplace"], ["stj", "stjump"], ["stopi", "stopinsert"], ["sts", "stselect"], ["sun", "sunhide"], ["sunme", "sunme"], ["sunmenu", "sunmenu"], ["sus", "suspend"], ["sv", "sview"], ["sw", "swapname"], ["sy", "sy"], ["syn", "syn"], ["sync", "sync"], ["syncbind", "syncbind"], ["syntime", "syntime"], ["t", "t"], ["tN", "tNext"], ["ta", "tag"], ["tab", "tab"], ["tabN", "tabNext"], ["tabc", "tabclose"], ["tabd", "tabdo"], ["tabe", "tabedit"], ["tabf", "tabfind"], ["tabfir", "tabfirst"], ["tabl", "tablast"], ["tabm", "tabmove"], ["tabn", "tabnext"], ["tabnew", "tabnew"], ["tabo", "tabonly"], ["tabp", "tabprevious"], ["tabr", "tabrewind"], ["tabs", "tabs"], ["tags", "tags"], ["tc", "tcl"], ["tcld", "tcldo"], ["tclf", "tclfile"], ["te", "tearoff"], ["tf", "tfirst"], ["th", "throw"], ["tj", "tjump"], ["tl", "tlast"], ["tm", "tmenu"], ["tn", "tnext"], ["to", "topleft"], ["tp", "tprevious"], ["tr", "trewind"], ["try", "try"], ["ts", "tselect"], ["tu", "tunmenu"], ["u", "undo"], ["una", "unabbreviate"], ["undoj", "undojoin"], ["undol", "undolist"], ["unh", "unhide"], ["unlo", "unlockvar"], ["uns", "unsilent"], ["up", "update"], ["v", "v"], ["ve", "version"], ["verb", "verbose"], ["vert", "vertical"], ["vi", "visual"], ["vie", "view"], ["vim", "vimgrep"], ["vimgrepa", "vimgrepadd"], ["viu", "viusage"], ["vmapc", "vmapclear"], ["vne", "vnew"], ["vs", "vsplit"], ["w", "write"], ["wN", "wNext"], ["wa", "wall"], ["wh", "while"], ["win", "winsize"], ["winc", "wincmd"], ["windo", "windo"], ["winp", "winpos"], ["wn", "wnext"], ["wp", "wprevious"], ["wq", "wq"], ["wqa", "wqall"], ["ws", "wsverb"], ["wundo", "wundo"], ["wv", "wviminfo"], ["x", "xit"], ["xa", "xall"], ["xmapc", "xmapclear"], ["xme", "xme"], ["xmenu", "xmenu"], ["xnoreme", "xnoreme"], ["xnoremenu", "xnoremenu"], ["xprop", "xprop"], ["xunme", "xunme"], ["xunmenu", "xunmenu"], ["xwininfo", "xwininfo"], ["y", "yank"]], :option=>[], :auto=>[["BufAdd", "BufAdd"], ["BufCreate", "BufCreate"], ["BufDelete", "BufDelete"], ["BufEnter", "BufEnter"], ["BufFilePost", "BufFilePost"], ["BufFilePre", "BufFilePre"], ["BufHidden", "BufHidden"], ["BufLeave", "BufLeave"], ["BufNew", "BufNew"], ["BufNewFile", "BufNewFile"], ["BufRead", "BufRead"], ["BufReadCmd", "BufReadCmd"], ["BufReadPost", "BufReadPost"], ["BufReadPre", "BufReadPre"], ["BufUnload", "BufUnload"], ["BufWinEnter", "BufWinEnter"], ["BufWinLeave", "BufWinLeave"], ["BufWipeout", "BufWipeout"], ["BufWrite", "BufWrite"], ["BufWriteCmd", "BufWriteCmd"], ["BufWritePost", "BufWritePost"], ["BufWritePre", "BufWritePre"], ["CmdUndefined", "CmdUndefined"], ["CmdwinEnter", "CmdwinEnter"], ["CmdwinLeave", "CmdwinLeave"], ["ColorScheme", "ColorScheme"], ["CompleteDone", "CompleteDone"], ["CursorHold", "CursorHold"], ["CursorHoldI", "CursorHoldI"], ["CursorMoved", "CursorMoved"], ["CursorMovedI", "CursorMovedI"], ["EncodingChanged", "EncodingChanged"], ["FileAppendCmd", "FileAppendCmd"], ["FileAppendPost", "FileAppendPost"], ["FileAppendPre", "FileAppendPre"], ["FileChangedRO", "FileChangedRO"], ["FileChangedShell", "FileChangedShell"], ["FileChangedShellPost", "FileChangedShellPost"], ["FileEncoding", "FileEncoding"], ["FileReadCmd", "FileReadCmd"], ["FileReadPost", "FileReadPost"], ["FileReadPre", "FileReadPre"], ["FileType", "FileType"], ["FileWriteCmd", "FileWriteCmd"], ["FileWritePost", "FileWritePost"], ["FileWritePre", "FileWritePre"], ["FilterReadPost", "FilterReadPost"], ["FilterReadPre", "FilterReadPre"], ["FilterWritePost", "FilterWritePost"], ["FilterWritePre", "FilterWritePre"], ["FocusGained", "FocusGained"], ["FocusLost", "FocusLost"], ["FuncUndefined", "FuncUndefined"], ["GUIEnter", "GUIEnter"], ["GUIFailed", "GUIFailed"], ["InsertChange", "InsertChange"], ["InsertCharPre", "InsertCharPre"], ["InsertEnter", "InsertEnter"], ["InsertLeave", "InsertLeave"], ["MenuPopup", "MenuPopup"], ["OptionSet", "OptionSet"], ["QuickFixCmdPost", "QuickFixCmdPost"], ["QuickFixCmdPre", "QuickFixCmdPre"], ["QuitPre", "QuitPre"], ["RemoteReply", "RemoteReply"], ["SessionLoadPost", "SessionLoadPost"], ["ShellCmdPost", "ShellCmdPost"], ["ShellFilterPost", "ShellFilterPost"], ["SourceCmd", "SourceCmd"], ["SourcePre", "SourcePre"], ["SpellFileMissing", "SpellFileMissing"], ["StdinReadPost", "StdinReadPost"], ["StdinReadPre", "StdinReadPre"], ["SwapExists", "SwapExists"], ["Syntax", "Syntax"], ["TabClosed", "TabClosed"], ["TabEnter", "TabEnter"], ["TabLeave", "TabLeave"], ["TabNew", "TabNew"], ["TermChanged", "TermChanged"], ["TermResponse", "TermResponse"], ["TextChanged", "TextChanged"], ["TextChangedI", "TextChangedI"], ["User", "User"], ["VimEnter", "VimEnter"], ["VimLeave", "VimLeave"], ["VimLeavePre", "VimLeavePre"], ["VimResized", "VimResized"], ["WinEnter", "WinEnter"], ["WinLeave", "WinLeave"], ["WinNew", "WinNew"]]}
end
end
end
end | ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/matlab/builtins.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/matlab/builtins.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
# automatically generated by `rake builtins:matlab`
module Rouge
module Lexers
class Matlab
def self.builtins
@builtins ||= Set.new %w(ans clc diary format home iskeyword more zeros ones rand true false eye diag blkdiag cat horzcat vertcat repelem repmat linspace logspace freqspace meshgrid ndgrid length size ndims numel isscalar isvector ismatrix isrow iscolumn isempty sort sortrows issorted issortedrows flip fliplr flipud rot90 transpose ctranspose permute ipermute circshift shiftdim reshape squeeze colon end ind2sub sub2ind plus uplus minus uminus times rdivide ldivide power mtimes mrdivide mldivide mpower cumprod cumsum diff movsum prod sum ceil fix floor idivide mod rem round bsxfun eq ge gt le lt ne isequal isequaln logicaloperatorsshortcircuit and not or xor all any false find islogical logical true intersect ismember ismembertol issorted setdiff setxor union unique uniquetol join innerjoin outerjoin bitand bitcmp bitget bitor bitset bitshift bitxor swapbytes double single int8 int16 int32 int64 uint8 uint16 uint32 uint64 cast typecast isinteger isfloat isnumeric isreal isfinite isinf isnan eps flintmax inf intmax intmin nan realmax realmin string strings join char cellstr blanks newline compose sprintf strcat ischar iscellstr isstring strlength isstrprop isletter isspace contains count endswith startswith strfind sscanf replace replacebetween strrep join split splitlines strjoin strsplit strtok erase erasebetween extractafter extractbefore extractbetween insertafter insertbefore pad strip lower upper reverse deblank strtrim strjust strcmp strcmpi strncmp strncmpi regexp regexpi regexprep regexptranslate datetime timezones years days hours minutes seconds milliseconds duration calyears calquarters calmonths calweeks caldays calendarduration exceltime juliandate posixtime yyyymmdd year quarter month week day hour minute second ymd hms split time timeofday isdst isweekend tzoffset between caldiff dateshift isbetween isdatetime isduration iscalendarduration isnat nat datenum datevec datestr char cellstr string now clock date calendar eomday weekday addtodate etime categorical iscategorical discretize categories iscategory isordinal isprotected addcats mergecats removecats renamecats reordercats setcats summary countcats isundefined table array2table cell2table struct2table table2array table2cell table2struct readtable writetable detectimportoptions istable head tail height width summary intersect ismember setdiff setxor unique union join innerjoin outerjoin sortrows stack unstack vartype ismissing standardizemissing rmmissing fillmissing varfun rowfun findgroups splitapply timetable retime synchronize lag table2timetable array2timetable timetable2table istimetable isregular timerange withtol vartype rmmissing issorted sortrows unique struct fieldnames getfield isfield isstruct orderfields rmfield setfield arrayfun structfun table2struct struct2table cell2struct struct2cell cell cell2mat cell2struct cell2table celldisp cellfun cellplot cellstr iscell iscellstr mat2cell num2cell strjoin strsplit struct2cell table2cell feval func2str str2func localfunctions functions addevent delevent gettsafteratevent gettsafterevent gettsatevent gettsbeforeatevent gettsbeforeevent gettsbetweenevents gettscollection isemptytscollection lengthtscollection settscollection sizetscollection tscollection addsampletocollection addts delsamplefromcollection getabstimetscollection getsampleusingtimetscollection gettimeseriesnames horzcattscollection removets resampletscollection setabstimetscollection settimeseriesnames vertcattscollection isa iscalendarduration iscategorical iscell iscellstr ischar isdatetime isduration isfield isfloat isgraphics isinteger isjava islogical isnumeric isobject isreal isenum isstruct istable is class validateattributes whos char cellstr int2str mat2str num2str str2double str2num native2unicode unicode2native base2dec bin2dec dec2base dec2bin dec2hex hex2dec hex2num num2hex table2array table2cell table2struct array2table cell2table struct2table cell2mat cell2struct mat2cell num2cell struct2cell plus uplus minus uminus times rdivide ldivide power mtimes mrdivide mldivide mpower cumprod cumsum diff movsum prod sum ceil fix floor idivide mod rem round bsxfun sin sind asin asind sinh asinh cos cosd acos acosd cosh acosh tan tand atan atand atan2 atan2d tanh atanh csc cscd acsc acscd csch acsch sec secd asec asecd sech asech cot cotd acot acotd coth acoth hypot deg2rad rad2deg exp expm1 log log10 log1p log2 nextpow2 nthroot pow2 reallog realpow realsqrt sqrt abs angle complex conj cplxpair i imag isreal j real sign unwrap factor factorial gcd isprime lcm nchoosek perms primes rat rats poly polyeig polyfit residue roots polyval polyvalm conv deconv polyint polyder airy besselh besseli besselj besselk bessely beta betainc betaincinv betaln ellipj ellipke erf erfc erfcinv erfcx erfinv expint gamma gammainc gammaincinv gammaln legendre psi cart2pol cart2sph pol2cart sph2cart eps flintmax i j inf pi nan isfinite isinf isnan compan gallery hadamard hankel hilb invhilb magic pascal rosser toeplitz vander wilkinson mldivide mrdivide linsolve inv pinv lscov lsqnonneg sylvester eig eigs balance svd svds gsvd ordeig ordqz ordschur polyeig qz hess schur rsf2csf cdf2rdf lu ldl chol cholupdate qr qrdelete qrinsert qrupdate planerot transpose ctranspose mtimes mpower sqrtm expm logm funm kron cross dot bandwidth tril triu isbanded isdiag ishermitian issymmetric istril istriu norm normest cond condest rcond condeig det null orth rank rref trace subspace rand randn randi randperm rng interp1 interp2 interp3 interpn pchip spline ppval mkpp unmkpp padecoef interpft ndgrid meshgrid griddata griddatan fminbnd fminsearch lsqnonneg fzero optimget optimset ode45 ode23 ode113 ode15s ode23s ode23t ode23tb ode15i decic odeget odeset deval odextend bvp4c bvp5c bvpinit bvpxtend bvpget bvpset deval dde23 ddesd ddensd ddeget ddeset deval pdepe pdeval integral integral2 integral3 quadgk quad2d cumtrapz trapz polyint del2 diff gradient polyder fft fft2 fftn fftshift fftw ifft ifft2 ifftn ifftshift nextpow2 interpft conv conv2 convn deconv filter filter2 ss2tf padecoef spalloc spdiags speye sprand sprandn sprandsym sparse spconvert issparse nnz nonzeros nzmax spfun spones spparms spy find full amd colamd colperm dmperm randperm symamd symrcm pcg minres symmlq gmres bicg bicgstab bicgstabl cgs qmr tfqmr lsqr ichol ilu eigs svds normest condest sprank etree symbfact spaugment dmperm etreeplot treelayout treeplot gplot unmesh graph digraph tetramesh trimesh triplot trisurf delaunay delaunayn tetramesh trimesh triplot trisurf dsearchn tsearchn delaunay delaunayn boundary alphashape convhull convhulln patch voronoi voronoin polyarea inpolygon rectint plot plot3 loglog semilogx semilogy errorbar fplot fplot3 fimplicit linespec colorspec bar bar3 barh bar3h histogram histcounts histogram2 histcounts2 rose pareto area pie pie3 stem stairs stem3 scatter scatter3 spy plotmatrix heatmap polarplot polarscatter polarhistogram compass ezpolar rlim thetalim rticks thetaticks rticklabels thetaticklabels rtickformat thetatickformat rtickangle polaraxes contour contourf contourc contour3 contourslice clabel fcontour feather quiver compass quiver3 streamslice streamline surf surfc surface surfl surfnorm mesh meshc meshz hidden fsurf fmesh fimplicit3 waterfall ribbon contour3 peaks cylinder ellipsoid sphere pcolor surf2patch contourslice flow isocaps isocolors isonormals isosurface reducepatch reducevolume shrinkfaces slice smooth3 subvolume volumebounds coneplot curl divergence interpstreamspeed stream2 stream3 streamline streamparticles streamribbon streamslice streamtube fill fill3 patch surf2patch movie getframe frame2im im2frame animatedline comet comet3 drawnow refreshdata title xlabel ylabel zlabel clabel legend colorbar text texlabel gtext line rectangle annotation xlim ylim zlim axis box daspect pbaspect grid xticks yticks zticks xticklabels yticklabels zticklabels xtickformat ytickformat ztickformat xtickangle ytickangle ztickangle datetick ruler2num num2ruler hold subplot yyaxis cla axes figure colormap colorbar rgbplot colormapeditor brighten contrast caxis spinmap hsv2rgb rgb2hsv parula jet hsv hot cool spring summer autumn winter gray bone copper pink lines colorcube prism flag view makehgtform viewmtx cameratoolbar campan camzoom camdolly camlookat camorbit campos camproj camroll camtarget camup camva camlight light lightangle lighting shading diffuse material specular alim alpha alphamap imshow image imagesc imread imwrite imfinfo imformats frame2im im2frame im2java im2double ind2rgb rgb2gray rgb2ind imapprox dither cmpermute cmunique print saveas getframe savefig openfig orient hgexport printopt get set reset inspect gca gcf gcbf gcbo gco groot ancestor allchild findall findobj findfigs gobjects isgraphics ishandle copyobj delete gobjects isgraphics isempty isequal isa clf cla close uicontextmenu uimenu dragrect rbbox refresh shg hggroup hgtransform makehgtform eye hold ishold newplot clf cla drawnow opengl readtable detectimportoptions writetable textscan dlmread dlmwrite csvread csvwrite type readtable detectimportoptions writetable xlsfinfo xlsread xlswrite importdata im2java imfinfo imread imwrite nccreate ncdisp ncinfo ncread ncreadatt ncwrite ncwriteatt ncwriteschema h5create h5disp h5info h5read h5readatt h5write h5writeatt hdfinfo hdfread hdftool imread imwrite hdfan hdfhx hdfh hdfhd hdfhe hdfml hdfpt hdfv hdfvf hdfvh hdfvs hdfdf24 hdfdfr8 fitsdisp fitsinfo fitsread fitswrite multibandread multibandwrite cdfinfo cdfread cdfepoch todatenum audioinfo audioread audiowrite videoreader videowriter mmfileinfo lin2mu mu2lin audiodevinfo audioplayer audiorecorder sound soundsc beep xmlread xmlwrite xslt load save matfile disp who whos clear clearvars openvar fclose feof ferror fgetl fgets fileread fopen fprintf fread frewind fscanf fseek ftell fwrite tcpclient web webread webwrite websave weboptions sendmail jsondecode jsonencode readasync serial serialbreak seriallist stopasync instrcallback instrfind instrfindall record tabulartextdatastore imagedatastore spreadsheetdatastore filedatastore datastore tall datastore mapreducer gather head tail topkrows istall classunderlying isaunderlying write mapreduce datastore add addmulti hasnext getnext mapreducer gcmr matfile memmapfile ismissing rmmissing fillmissing missing standardizemissing isoutlier filloutliers smoothdata movmean movmedian detrend filter filter2 discretize histcounts histcounts2 findgroups splitapply rowfun varfun accumarray min max bounds mean median mode std var corrcoef cov cummax cummin movmad movmax movmean movmedian movmin movprod movstd movsum movvar pan zoom rotate rotate3d brush datacursormode ginput linkdata linkaxes linkprop refreshdata figurepalette plotbrowser plotedit plottools propertyeditor propedit showplottool if for parfor switch try while break continue end pause return edit input publish grabcode snapnow function nargin nargout varargin varargout narginchk nargoutchk validateattributes validatestring inputname isvarname namelengthmax persistent assignin global mlock munlock mislocked try error warning lastwarn assert oncleanup addpath rmpath path savepath userpath genpath pathsep pathtool restoredefaultpath rehash dir ls pwd fileattrib exist isdir type visdiff what which cd copyfile delete recycle mkdir movefile rmdir open winopen zip unzip gzip gunzip tar untar fileparts fullfile filemarker filesep tempdir tempname matlabroot toolboxdir dbclear dbcont dbdown dbquit dbstack dbstatus dbstep dbstop dbtype dbup checkcode keyboard mlintrpt edit echo eval evalc evalin feval run builtin mfilename pcode uiaxes uibutton uibuttongroup uicheckbox uidropdown uieditfield uilabel uilistbox uiradiobutton uislider uispinner uitable uitextarea uitogglebutton scroll uifigure uipanel uitabgroup uitab uigauge uiknob uilamp uiswitch uialert questdlg inputdlg listdlg uisetcolor uigetfile uiputfile uigetdir uiopen uisave appdesigner figure axes uicontrol uitable uipanel uibuttongroup uitab uitabgroup uimenu uicontextmenu uitoolbar uipushtool uitoggletool actxcontrol align movegui getpixelposition setpixelposition listfonts textwrap uistack inspect errordlg warndlg msgbox helpdlg waitbar questdlg inputdlg listdlg uisetcolor uisetfont export2wsdlg uigetfile uiputfile uigetdir uiopen uisave printdlg printpreview exportsetupdlg dialog uigetpref guide uiwait uiresume waitfor waitforbuttonpress closereq getappdata setappdata isappdata rmappdata guidata guihandles uisetpref class isobject enumeration events methods properties classdef classdef import properties isprop mustbefinite mustbegreaterthan mustbegreaterthanorequal mustbeinteger mustbelessthan mustbelessthanorequal mustbemember mustbenegative mustbenonempty mustbenonnan mustbenonnegative mustbenonpositive mustbenonsparse mustbenonzero mustbenumeric mustbenumericorlogical mustbepositive mustbereal methods ismethod isequal eq events superclasses enumeration isenum numargumentsfromsubscript subsref subsasgn subsindex substruct builtin empty disp display details saveobj loadobj edit metaclass properties methods events superclasses step clone getnuminputs getnumoutputs islocked resetsystemobject releasesystemobject mexext inmem loadlibrary unloadlibrary libisloaded calllib libfunctions libfunctionsview libstruct libpointer import isjava javaaddpath javaarray javachk javaclasspath javamethod javamethodedt javaobject javaobjectedt javarmpath usejava net enablenetfromnetworkdrive cell begininvoke endinvoke combine remove removeall bitand bitor bitxor bitnot actxserver actxcontrol actxcontrollist actxcontrolselect actxgetrunningserver iscom addproperty deleteproperty inspect fieldnames methods methodsview invoke isevent eventlisteners registerevent unregisterallevents unregisterevent isinterface interfaces release move pyversion pyargs pyargs pyargs builddocsearchdb try assert runtests testsuite functiontests runtests testsuite runtests testsuite runperf testsuite timeit tic toc cputime profile bench memory inmem pack memoize clearallmemoizedcaches clipboard computer system dos unix getenv setenv perl winqueryreg commandhistory commandwindow filebrowser workspace getpref setpref addpref rmpref ispref mex execute getchararray putchararray getfullmatrix putfullmatrix getvariable getworkspacedata putworkspacedata maximizecommandwindow minimizecommandwindow regmatlabserver enableservice mex dbmex mexext inmem ver computer mexext dbmex inmem mex mexext matlabwindows matlabmac matlablinux exit quit matlabrc startup finish prefdir preferences version ver verlessthan license ispc ismac isunix isstudent javachk usejava doc help docsearch lookfor demo echodemo)
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/typescript/common.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/typescript/common.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
module TypescriptCommon
def self.keywords
@keywords ||= super + Set.new(%w(
is namespace static private protected public
implements readonly
))
end
def self.declarations
@declarations ||= super + Set.new(%w(
type abstract
))
end
def self.reserved
@reserved ||= super + Set.new(%w(
string any void number namespace module
declare default interface keyof
))
end
def self.builtins
@builtins ||= super + %w(
Pick Partial Readonly Record
)
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/php/builtins.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/lexers/php/builtins.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
# automatically generated by `rake builtins:php`
module Rouge
module Lexers
class PHP
def self.builtins
@builtins ||= {}.tap do |b|
b["Apache"] = Set.new %w(apache_child_terminate apache_child_terminate apache_get_modules apache_get_version apache_getenv apache_lookup_uri apache_note apache_request_headers apache_reset_timeout apache_response_headers apache_setenv getallheaders virtual apache_child_terminate)
b["APC"] = Set.new %w(apc_add apc_add apc_bin_dump apc_bin_dumpfile apc_bin_load apc_bin_loadfile apc_cache_info apc_cas apc_clear_cache apc_compile_file apc_dec apc_define_constants apc_delete_file apc_delete apc_exists apc_fetch apc_inc apc_load_constants apc_sma_info apc_store apc_add)
b["APCu"] = Set.new %w(apcu_add apcu_add apcu_cache_info apcu_cas apcu_clear_cache apcu_dec apcu_delete apcu_entry apcu_exists apcu_fetch apcu_inc apcu_sma_info apcu_store apcu_add)
b["APD"] = Set.new %w(apd_breakpoint apd_breakpoint apd_callstack apd_clunk apd_continue apd_croak apd_dump_function_table apd_dump_persistent_resources apd_dump_regular_resources apd_echo apd_get_active_symbols apd_set_pprof_trace apd_set_session_trace_socket apd_set_session_trace apd_set_session override_function rename_function apd_breakpoint)
b["Array"] = Set.new %w(array_change_key_case array_change_key_case array_chunk array_column array_combine array_count_values array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_diff array_fill_keys array_fill array_filter array_flip array_intersect_assoc array_intersect_key array_intersect_uassoc array_intersect_ukey array_intersect array_key_exists array_keys array_map array_merge_recursive array_merge array_multisort array_pad array_pop array_product array_push array_rand array_reduce array_replace_recursive array_replace array_reverse array_search array_shift array_slice array_splice array_sum array_udiff_assoc array_udiff_uassoc array_udiff array_uintersect_assoc array_uintersect_uassoc array_uintersect array_unique array_unshift array_values array_walk_recursive array_walk array arsort asort compact count current each end extract in_array key_exists key krsort ksort list natcasesort natsort next pos prev range reset rsort shuffle sizeof sort uasort uksort usort array_change_key_case)
b["BBCode"] = Set.new %w(bbcode_add_element bbcode_add_element bbcode_add_smiley bbcode_create bbcode_destroy bbcode_parse bbcode_set_arg_parser bbcode_set_flags bbcode_add_element)
b["BC Math"] = Set.new %w(bcadd bcadd bccomp bcdiv bcmod bcmul bcpow bcpowmod bcscale bcsqrt bcsub bcadd)
b["bcompiler"] = Set.new %w(bcompiler_load_exe bcompiler_load_exe bcompiler_load bcompiler_parse_class bcompiler_read bcompiler_write_class bcompiler_write_constant bcompiler_write_exe_footer bcompiler_write_file bcompiler_write_footer bcompiler_write_function bcompiler_write_functions_from_file bcompiler_write_header bcompiler_write_included_filename bcompiler_load_exe)
b["Blenc"] = Set.new %w(blenc_encrypt blenc_encrypt blenc_encrypt)
b["Bzip2"] = Set.new %w(bzclose bzclose bzcompress bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite bzclose)
b["Cairo"] = Set.new %w(cairo_create cairo_create cairo_font_face_get_type cairo_font_face_status cairo_font_options_create cairo_font_options_equal cairo_font_options_get_antialias cairo_font_options_get_hint_metrics cairo_font_options_get_hint_style cairo_font_options_get_subpixel_order cairo_font_options_hash cairo_font_options_merge cairo_font_options_set_antialias cairo_font_options_set_hint_metrics cairo_font_options_set_hint_style cairo_font_options_set_subpixel_order cairo_font_options_status cairo_format_stride_for_width cairo_image_surface_create_for_data cairo_image_surface_create_from_png cairo_image_surface_create cairo_image_surface_get_data cairo_image_surface_get_format cairo_image_surface_get_height cairo_image_surface_get_stride cairo_image_surface_get_width cairo_matrix_create_scale cairo_matrix_create_translate cairo_matrix_invert cairo_matrix_multiply cairo_matrix_rotate cairo_matrix_transform_distance cairo_matrix_transform_point cairo_matrix_translate cairo_pattern_add_color_stop_rgb cairo_pattern_add_color_stop_rgba cairo_pattern_create_for_surface cairo_pattern_create_linear cairo_pattern_create_radial cairo_pattern_create_rgb cairo_pattern_create_rgba cairo_pattern_get_color_stop_count cairo_pattern_get_color_stop_rgba cairo_pattern_get_extend cairo_pattern_get_filter cairo_pattern_get_linear_points cairo_pattern_get_matrix cairo_pattern_get_radial_circles cairo_pattern_get_rgba cairo_pattern_get_surface cairo_pattern_get_type cairo_pattern_set_extend cairo_pattern_set_filter cairo_pattern_set_matrix cairo_pattern_status cairo_pdf_surface_create cairo_pdf_surface_set_size cairo_ps_get_levels cairo_ps_level_to_string cairo_ps_surface_create cairo_ps_surface_dsc_begin_page_setup cairo_ps_surface_dsc_begin_setup cairo_ps_surface_dsc_comment cairo_ps_surface_get_eps cairo_ps_surface_restrict_to_level cairo_ps_surface_set_eps cairo_ps_surface_set_size cairo_scaled_font_create cairo_scaled_font_extents cairo_scaled_font_get_ctm cairo_scaled_font_get_font_face cairo_scaled_font_get_font_matrix cairo_scaled_font_get_font_options cairo_scaled_font_get_scale_matrix cairo_scaled_font_get_type cairo_scaled_font_glyph_extents cairo_scaled_font_status cairo_scaled_font_text_extents cairo_surface_copy_page cairo_surface_create_similar cairo_surface_finish cairo_surface_flush cairo_surface_get_content cairo_surface_get_device_offset cairo_surface_get_font_options cairo_surface_get_type cairo_surface_mark_dirty_rectangle cairo_surface_mark_dirty cairo_surface_set_device_offset cairo_surface_set_fallback_resolution cairo_surface_show_page cairo_surface_status cairo_surface_write_to_png cairo_svg_surface_create cairo_svg_surface_restrict_to_version cairo_svg_version_to_string cairo_create)
b["Calendar"] = Set.new %w(cal_days_in_month cal_days_in_month cal_from_jd cal_info cal_to_jd easter_date easter_days frenchtojd gregoriantojd jddayofweek jdmonthname jdtofrench jdtogregorian jdtojewish jdtojulian jdtounix jewishtojd juliantojd unixtojd cal_days_in_month)
b["chdb"] = Set.new %w(chdb_create chdb_create chdb_create)
b["Classkit"] = Set.new %w(classkit_import classkit_import classkit_method_add classkit_method_copy classkit_method_redefine classkit_method_remove classkit_method_rename classkit_import)
b["Classes/Object"] = Set.new %w(__autoload __autoload call_user_method_array call_user_method class_alias class_exists get_called_class get_class_methods get_class_vars get_class get_declared_classes get_declared_interfaces get_declared_traits get_object_vars get_parent_class interface_exists is_a is_subclass_of method_exists property_exists trait_exists __autoload)
b["COM"] = Set.new %w(com_create_guid com_create_guid com_event_sink com_get_active_object com_load_typelib com_message_pump com_print_typeinfo variant_abs variant_add variant_and variant_cast variant_cat variant_cmp variant_date_from_timestamp variant_date_to_timestamp variant_div variant_eqv variant_fix variant_get_type variant_idiv variant_imp variant_int variant_mod variant_mul variant_neg variant_not variant_or variant_pow variant_round variant_set_type variant_set variant_sub variant_xor com_create_guid)
b["Crack"] = Set.new %w(crack_check crack_check crack_closedict crack_getlastmessage crack_opendict crack_check)
b["CSPRNG"] = Set.new %w(random_bytes random_bytes random_int random_bytes)
b["Ctype"] = Set.new %w(ctype_alnum ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_graph ctype_lower ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit ctype_alnum)
b["CUBRID"] = Set.new %w(cubrid_bind cubrid_bind cubrid_close_prepare cubrid_close_request cubrid_col_get cubrid_col_size cubrid_column_names cubrid_column_types cubrid_commit cubrid_connect_with_url cubrid_connect cubrid_current_oid cubrid_disconnect cubrid_drop cubrid_error_code_facility cubrid_error_code cubrid_error_msg cubrid_execute cubrid_fetch cubrid_free_result cubrid_get_autocommit cubrid_get_charset cubrid_get_class_name cubrid_get_client_info cubrid_get_db_parameter cubrid_get_query_timeout cubrid_get_server_info cubrid_get cubrid_insert_id cubrid_is_instance cubrid_lob_close cubrid_lob_export cubrid_lob_get cubrid_lob_send cubrid_lob_size cubrid_lob2_bind cubrid_lob2_close cubrid_lob2_export cubrid_lob2_import cubrid_lob2_new cubrid_lob2_read cubrid_lob2_seek64 cubrid_lob2_seek cubrid_lob2_size64 cubrid_lob2_size cubrid_lob2_tell64 cubrid_lob2_tell cubrid_lob2_write cubrid_lock_read cubrid_lock_write cubrid_move_cursor cubrid_next_result cubrid_num_cols cubrid_num_rows cubrid_pconnect_with_url cubrid_pconnect cubrid_prepare cubrid_put cubrid_rollback cubrid_schema cubrid_seq_drop cubrid_seq_insert cubrid_seq_put cubrid_set_add cubrid_set_autocommit cubrid_set_db_parameter cubrid_set_drop cubrid_set_query_timeout cubrid_version cubrid_bind)
b["cURL"] = Set.new %w(curl_close curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version curl_close)
b["Cyrus"] = Set.new %w(cyrus_authenticate cyrus_authenticate cyrus_bind cyrus_close cyrus_connect cyrus_query cyrus_unbind cyrus_authenticate)
b["Date/Time"] = Set.new %w(checkdate checkdate date_add date_create_from_format date_create_immutable_from_format date_create_immutable date_create date_date_set date_default_timezone_get date_default_timezone_set date_diff date_format date_get_last_errors date_interval_create_from_date_string date_interval_format date_isodate_set date_modify date_offset_get date_parse_from_format date_parse date_sub date_sun_info date_sunrise date_sunset date_time_set date_timestamp_get date_timestamp_set date_timezone_get date_timezone_set date getdate gettimeofday gmdate gmmktime gmstrftime idate localtime microtime mktime strftime strptime strtotime time timezone_abbreviations_list timezone_identifiers_list timezone_location_get timezone_name_from_abbr timezone_name_get timezone_offset_get timezone_open timezone_transitions_get timezone_version_get checkdate)
b["DBA"] = Set.new %w(dba_close dba_close dba_delete dba_exists dba_fetch dba_firstkey dba_handlers dba_insert dba_key_split dba_list dba_nextkey dba_open dba_optimize dba_popen dba_replace dba_sync dba_close)
b["dBase"] = Set.new %w(dbase_add_record dbase_add_record dbase_close dbase_create dbase_delete_record dbase_get_header_info dbase_get_record_with_names dbase_get_record dbase_numfields dbase_numrecords dbase_open dbase_pack dbase_replace_record dbase_add_record)
b["DB++"] = Set.new %w(dbplus_add dbplus_add dbplus_aql dbplus_chdir dbplus_close dbplus_curr dbplus_errcode dbplus_errno dbplus_find dbplus_first dbplus_flush dbplus_freealllocks dbplus_freelock dbplus_freerlocks dbplus_getlock dbplus_getunique dbplus_info dbplus_last dbplus_lockrel dbplus_next dbplus_open dbplus_prev dbplus_rchperm dbplus_rcreate dbplus_rcrtexact dbplus_rcrtlike dbplus_resolve dbplus_restorepos dbplus_rkeys dbplus_ropen dbplus_rquery dbplus_rrename dbplus_rsecindex dbplus_runlink dbplus_rzap dbplus_savepos dbplus_setindex dbplus_setindexbynumber dbplus_sql dbplus_tcl dbplus_tremove dbplus_undo dbplus_undoprepare dbplus_unlockrel dbplus_unselect dbplus_update dbplus_xlockrel dbplus_xunlockrel dbplus_add)
b["dbx"] = Set.new %w(dbx_close dbx_close dbx_compare dbx_connect dbx_error dbx_escape_string dbx_fetch_row dbx_query dbx_sort dbx_close)
b["Direct IO"] = Set.new %w(dio_close dio_close dio_fcntl dio_open dio_read dio_seek dio_stat dio_tcsetattr dio_truncate dio_write dio_close)
b["Directory"] = Set.new %w(chdir chdir chroot closedir dir getcwd opendir readdir rewinddir scandir chdir)
b["DOM"] = Set.new %w(dom_import_simplexml dom_import_simplexml dom_import_simplexml)
b["Eio"] = Set.new %w(eio_busy eio_busy eio_cancel eio_chmod eio_chown eio_close eio_custom eio_dup2 eio_event_loop eio_fallocate eio_fchmod eio_fchown eio_fdatasync eio_fstat eio_fstatvfs eio_fsync eio_ftruncate eio_futime eio_get_event_stream eio_get_last_error eio_grp_add eio_grp_cancel eio_grp_limit eio_grp eio_init eio_link eio_lstat eio_mkdir eio_mknod eio_nop eio_npending eio_nready eio_nreqs eio_nthreads eio_open eio_poll eio_read eio_readahead eio_readdir eio_readlink eio_realpath eio_rename eio_rmdir eio_seek eio_sendfile eio_set_max_idle eio_set_max_parallel eio_set_max_poll_reqs eio_set_max_poll_time eio_set_min_parallel eio_stat eio_statvfs eio_symlink eio_sync_file_range eio_sync eio_syncfs eio_truncate eio_unlink eio_utime eio_write eio_busy)
b["Enchant"] = Set.new %w(enchant_broker_describe enchant_broker_describe enchant_broker_dict_exists enchant_broker_free_dict enchant_broker_free enchant_broker_get_dict_path enchant_broker_get_error enchant_broker_init enchant_broker_list_dicts enchant_broker_request_dict enchant_broker_request_pwl_dict enchant_broker_set_dict_path enchant_broker_set_ordering enchant_dict_add_to_personal enchant_dict_add_to_session enchant_dict_check enchant_dict_describe enchant_dict_get_error enchant_dict_is_in_session enchant_dict_quick_check enchant_dict_store_replacement enchant_dict_suggest enchant_broker_describe)
b["Error Handling"] = Set.new %w(debug_backtrace debug_backtrace debug_print_backtrace error_clear_last error_get_last error_log error_reporting restore_error_handler restore_exception_handler set_error_handler set_exception_handler trigger_error user_error debug_backtrace)
b["Program execution"] = Set.new %w(escapeshellarg escapeshellarg escapeshellcmd exec passthru proc_close proc_get_status proc_nice proc_open proc_terminate shell_exec system escapeshellarg)
b["Exif"] = Set.new %w(exif_imagetype exif_imagetype exif_read_data exif_tagname exif_thumbnail read_exif_data exif_imagetype)
b["Expect"] = Set.new %w(expect_expectl expect_expectl expect_popen expect_expectl)
b["FAM"] = Set.new %w(fam_cancel_monitor fam_cancel_monitor fam_close fam_monitor_collection fam_monitor_directory fam_monitor_file fam_next_event fam_open fam_pending fam_resume_monitor fam_suspend_monitor fam_cancel_monitor)
b["Fann"] = Set.new %w(fann_cascadetrain_on_data fann_cascadetrain_on_data fann_cascadetrain_on_file fann_clear_scaling_params fann_copy fann_create_from_file fann_create_shortcut_array fann_create_shortcut fann_create_sparse_array fann_create_sparse fann_create_standard_array fann_create_standard fann_create_train_from_callback fann_create_train fann_descale_input fann_descale_output fann_descale_train fann_destroy_train fann_destroy fann_duplicate_train_data fann_get_activation_function fann_get_activation_steepness fann_get_bias_array fann_get_bit_fail_limit fann_get_bit_fail fann_get_cascade_activation_functions_count fann_get_cascade_activation_functions fann_get_cascade_activation_steepnesses_count fann_get_cascade_activation_steepnesses fann_get_cascade_candidate_change_fraction fann_get_cascade_candidate_limit fann_get_cascade_candidate_stagnation_epochs fann_get_cascade_max_cand_epochs fann_get_cascade_max_out_epochs fann_get_cascade_min_cand_epochs fann_get_cascade_min_out_epochs fann_get_cascade_num_candidate_groups fann_get_cascade_num_candidates fann_get_cascade_output_change_fraction fann_get_cascade_output_stagnation_epochs fann_get_cascade_weight_multiplier fann_get_connection_array fann_get_connection_rate fann_get_errno fann_get_errstr fann_get_layer_array fann_get_learning_momentum fann_get_learning_rate fann_get_MSE fann_get_network_type fann_get_num_input fann_get_num_layers fann_get_num_output fann_get_quickprop_decay fann_get_quickprop_mu fann_get_rprop_decrease_factor fann_get_rprop_delta_max fann_get_rprop_delta_min fann_get_rprop_delta_zero fann_get_rprop_increase_factor fann_get_sarprop_step_error_shift fann_get_sarprop_step_error_threshold_factor fann_get_sarprop_temperature fann_get_sarprop_weight_decay_shift fann_get_total_connections fann_get_total_neurons fann_get_train_error_function fann_get_train_stop_function fann_get_training_algorithm fann_init_weights fann_length_train_data fann_merge_train_data fann_num_input_train_data fann_num_output_train_data fann_print_error fann_randomize_weights fann_read_train_from_file fann_reset_errno fann_reset_errstr fann_reset_MSE fann_run fann_save_train fann_save fann_scale_input_train_data fann_scale_input fann_scale_output_train_data fann_scale_output fann_scale_train_data fann_scale_train fann_set_activation_function_hidden fann_set_activation_function_layer fann_set_activation_function_output fann_set_activation_function fann_set_activation_steepness_hidden fann_set_activation_steepness_layer fann_set_activation_steepness_output fann_set_activation_steepness fann_set_bit_fail_limit fann_set_callback fann_set_cascade_activation_functions fann_set_cascade_activation_steepnesses fann_set_cascade_candidate_change_fraction fann_set_cascade_candidate_limit fann_set_cascade_candidate_stagnation_epochs fann_set_cascade_max_cand_epochs fann_set_cascade_max_out_epochs fann_set_cascade_min_cand_epochs fann_set_cascade_min_out_epochs fann_set_cascade_num_candidate_groups fann_set_cascade_output_change_fraction fann_set_cascade_output_stagnation_epochs fann_set_cascade_weight_multiplier fann_set_error_log fann_set_input_scaling_params fann_set_learning_momentum fann_set_learning_rate fann_set_output_scaling_params fann_set_quickprop_decay fann_set_quickprop_mu fann_set_rprop_decrease_factor fann_set_rprop_delta_max fann_set_rprop_delta_min fann_set_rprop_delta_zero fann_set_rprop_increase_factor fann_set_sarprop_step_error_shift fann_set_sarprop_step_error_threshold_factor fann_set_sarprop_temperature fann_set_sarprop_weight_decay_shift fann_set_scaling_params fann_set_train_error_function fann_set_train_stop_function fann_set_training_algorithm fann_set_weight_array fann_set_weight fann_shuffle_train_data fann_subset_train_data fann_test_data fann_test fann_train_epoch fann_train_on_data fann_train_on_file fann_train fann_cascadetrain_on_data)
b["FrontBase"] = Set.new %w(fbsql_affected_rows fbsql_affected_rows fbsql_autocommit fbsql_blob_size fbsql_change_user fbsql_clob_size fbsql_close fbsql_commit fbsql_connect fbsql_create_blob fbsql_create_clob fbsql_create_db fbsql_data_seek fbsql_database_password fbsql_database fbsql_db_query fbsql_db_status fbsql_drop_db fbsql_errno fbsql_error fbsql_fetch_array fbsql_fetch_assoc fbsql_fetch_field fbsql_fetch_lengths fbsql_fetch_object fbsql_fetch_row fbsql_field_flags fbsql_field_len fbsql_field_name fbsql_field_seek fbsql_field_table fbsql_field_type fbsql_free_result fbsql_get_autostart_info fbsql_hostname fbsql_insert_id fbsql_list_dbs fbsql_list_fields fbsql_list_tables fbsql_next_result fbsql_num_fields fbsql_num_rows fbsql_password fbsql_pconnect fbsql_query fbsql_read_blob fbsql_read_clob fbsql_result fbsql_rollback fbsql_rows_fetched fbsql_select_db fbsql_set_characterset fbsql_set_lob_mode fbsql_set_password fbsql_set_transaction fbsql_start_db fbsql_stop_db fbsql_table_name fbsql_tablename fbsql_username fbsql_warnings fbsql_affected_rows)
b["FDF"] = Set.new %w(fdf_add_doc_javascript fdf_add_doc_javascript fdf_add_template fdf_close fdf_create fdf_enum_values fdf_errno fdf_error fdf_get_ap fdf_get_attachment fdf_get_encoding fdf_get_file fdf_get_flags fdf_get_opt fdf_get_status fdf_get_value fdf_get_version fdf_header fdf_next_field_name fdf_open_string fdf_open fdf_remove_item fdf_save_string fdf_save fdf_set_ap fdf_set_encoding fdf_set_file fdf_set_flags fdf_set_javascript_action fdf_set_on_import_javascript fdf_set_opt fdf_set_status fdf_set_submit_form_action fdf_set_target_frame fdf_set_value fdf_set_version fdf_add_doc_javascript)
b["Fileinfo"] = Set.new %w(finfo_buffer finfo_buffer finfo_close finfo_file finfo_open finfo_set_flags mime_content_type finfo_buffer)
b["filePro"] = Set.new %w(filepro_fieldcount filepro_fieldcount filepro_fieldname filepro_fieldtype filepro_fieldwidth filepro_retrieve filepro_rowcount filepro filepro_fieldcount)
b["Filesystem"] = Set.new %w(basename basename chgrp chmod chown clearstatcache copy delete dirname disk_free_space disk_total_space diskfreespace fclose feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents file fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype flock fnmatch fopen fpassthru fputcsv fputs fread fscanf fseek fstat ftell ftruncate fwrite glob is_dir is_executable is_file is_link is_readable is_uploaded_file is_writable is_writeable lchgrp lchown link linkinfo lstat mkdir move_uploaded_file parse_ini_file parse_ini_string pathinfo pclose popen readfile readlink realpath_cache_get realpath_cache_size realpath rename rewind rmdir set_file_buffer stat symlink tempnam tmpfile touch umask unlink basename)
b["Filter"] = Set.new %w(filter_has_var filter_has_var filter_id filter_input_array filter_input filter_list filter_var_array filter_var filter_has_var)
b["FPM"] = Set.new %w(fastcgi_finish_request fastcgi_finish_request fastcgi_finish_request)
b["FriBiDi"] = Set.new %w(fribidi_log2vis fribidi_log2vis fribidi_log2vis)
b["FTP"] = Set.new %w(ftp_alloc ftp_alloc ftp_cdup ftp_chdir ftp_chmod ftp_close ftp_connect ftp_delete ftp_exec ftp_fget ftp_fput ftp_get_option ftp_get ftp_login ftp_mdtm ftp_mkdir ftp_nb_continue ftp_nb_fget ftp_nb_fput ftp_nb_get ftp_nb_put ftp_nlist ftp_pasv ftp_put ftp_pwd ftp_quit ftp_raw ftp_rawlist ftp_rename ftp_rmdir ftp_set_option ftp_site ftp_size ftp_ssl_connect ftp_systype ftp_alloc)
b["Function handling"] = Set.new %w(call_user_func_array call_user_func_array call_user_func create_function forward_static_call_array forward_static_call func_get_arg func_get_args func_num_args function_exists get_defined_functions register_shutdown_function register_tick_function unregister_tick_function call_user_func_array)
b["GeoIP"] = Set.new %w(geoip_asnum_by_name geoip_asnum_by_name geoip_continent_code_by_name geoip_country_code_by_name geoip_country_code3_by_name geoip_country_name_by_name geoip_database_info geoip_db_avail geoip_db_filename geoip_db_get_all_info geoip_domain_by_name geoip_id_by_name geoip_isp_by_name geoip_netspeedcell_by_name geoip_org_by_name geoip_record_by_name geoip_region_by_name geoip_region_name_by_code geoip_setup_custom_directory geoip_time_zone_by_country_and_region geoip_asnum_by_name)
b["Gettext"] = Set.new %w(bind_textdomain_codeset bind_textdomain_codeset bindtextdomain dcgettext dcngettext dgettext dngettext gettext ngettext textdomain bind_textdomain_codeset)
b["GMP"] = Set.new %w(gmp_abs gmp_abs gmp_add gmp_and gmp_clrbit gmp_cmp gmp_com gmp_div_q gmp_div_qr gmp_div_r gmp_div gmp_divexact gmp_export gmp_fact gmp_gcd gmp_gcdext gmp_hamdist gmp_import gmp_init gmp_intval gmp_invert gmp_jacobi gmp_legendre gmp_mod gmp_mul gmp_neg gmp_nextprime gmp_or gmp_perfect_square gmp_popcount gmp_pow gmp_powm gmp_prob_prime gmp_random_bits gmp_random_range gmp_random_seed gmp_random gmp_root gmp_rootrem gmp_scan0 gmp_scan1 gmp_setbit gmp_sign gmp_sqrt gmp_sqrtrem gmp_strval gmp_sub gmp_testbit gmp_xor gmp_abs)
b["GnuPG"] = Set.new %w(gnupg_adddecryptkey gnupg_adddecryptkey gnupg_addencryptkey gnupg_addsignkey gnupg_cleardecryptkeys gnupg_clearencryptkeys gnupg_clearsignkeys gnupg_decrypt gnupg_decryptverify gnupg_encrypt gnupg_encryptsign gnupg_export gnupg_geterror gnupg_getprotocol gnupg_import gnupg_init gnupg_keyinfo gnupg_setarmor gnupg_seterrormode gnupg_setsignmode gnupg_sign gnupg_verify gnupg_adddecryptkey)
b["Gupnp"] = Set.new %w(gupnp_context_get_host_ip gupnp_context_get_host_ip gupnp_context_get_port gupnp_context_get_subscription_timeout gupnp_context_host_path gupnp_context_new gupnp_context_set_subscription_timeout gupnp_context_timeout_add gupnp_context_unhost_path gupnp_control_point_browse_start gupnp_control_point_browse_stop gupnp_control_point_callback_set gupnp_control_point_new gupnp_device_action_callback_set gupnp_device_info_get_service gupnp_device_info_get gupnp_root_device_get_available gupnp_root_device_get_relative_location gupnp_root_device_new gupnp_root_device_set_available gupnp_root_device_start gupnp_root_device_stop gupnp_service_action_get gupnp_service_action_return_error gupnp_service_action_return gupnp_service_action_set gupnp_service_freeze_notify gupnp_service_info_get_introspection gupnp_service_info_get gupnp_service_introspection_get_state_variable gupnp_service_notify gupnp_service_proxy_action_get gupnp_service_proxy_action_set gupnp_service_proxy_add_notify gupnp_service_proxy_callback_set gupnp_service_proxy_get_subscribed gupnp_service_proxy_remove_notify gupnp_service_proxy_set_subscribed gupnp_service_thaw_notify gupnp_context_get_host_ip)
b["Hash"] = Set.new %w(hash_algos hash_algos hash_copy hash_equals hash_file hash_final hash_hkdf hash_hmac_file hash_hmac hash_init hash_pbkdf2 hash_update_file hash_update_stream hash_update hash hash_algos)
b["Hyperwave API"] = Set.new %w(hwapi_attribute_new hwapi_content_new hwapi_hgcsp hwapi_object_new)
b["Firebird/InterBase"] = Set.new %w(ibase_add_user ibase_add_user ibase_affected_rows ibase_backup ibase_blob_add ibase_blob_cancel ibase_blob_close ibase_blob_create ibase_blob_echo ibase_blob_get ibase_blob_import ibase_blob_info ibase_blob_open ibase_close ibase_commit_ret ibase_commit ibase_connect ibase_db_info ibase_delete_user ibase_drop_db ibase_errcode ibase_errmsg ibase_execute ibase_fetch_assoc ibase_fetch_object ibase_fetch_row ibase_field_info ibase_free_event_handler ibase_free_query ibase_free_result ibase_gen_id ibase_maintain_db ibase_modify_user ibase_name_result ibase_num_fields ibase_num_params ibase_param_info ibase_pconnect ibase_prepare ibase_query ibase_restore ibase_rollback_ret ibase_rollback ibase_server_info ibase_service_attach ibase_service_detach ibase_set_event_handler ibase_trans ibase_wait_event ibase_add_user)
b["IBM DB2"] = Set.new %w(db2_autocommit db2_autocommit db2_bind_param db2_client_info db2_close db2_column_privileges db2_columns db2_commit db2_conn_error db2_conn_errormsg db2_connect db2_cursor_type db2_escape_string db2_exec db2_execute db2_fetch_array db2_fetch_assoc db2_fetch_both db2_fetch_object db2_fetch_row db2_field_display_size db2_field_name db2_field_num db2_field_precision db2_field_scale db2_field_type db2_field_width db2_foreign_keys db2_free_result db2_free_stmt db2_get_option db2_last_insert_id db2_lob_read db2_next_result db2_num_fields db2_num_rows db2_pclose db2_pconnect db2_prepare db2_primary_keys db2_procedure_columns db2_procedures db2_result db2_rollback db2_server_info db2_set_option db2_special_columns db2_statistics db2_stmt_error db2_stmt_errormsg db2_table_privileges db2_tables db2_autocommit)
b["iconv"] = Set.new %w(iconv_get_encoding iconv_get_encoding iconv_mime_decode_headers iconv_mime_decode iconv_mime_encode iconv_set_encoding iconv_strlen iconv_strpos iconv_strrpos iconv_substr iconv ob_iconv_handler iconv_get_encoding)
b["ID3"] = Set.new %w(id3_get_frame_long_name id3_get_frame_long_name id3_get_frame_short_name id3_get_genre_id id3_get_genre_list id3_get_genre_name id3_get_tag id3_get_version id3_remove_tag id3_set_tag id3_get_frame_long_name)
b["Informix"] = Set.new %w(ifx_affected_rows ifx_affected_rows ifx_blobinfile_mode ifx_byteasvarchar ifx_close ifx_connect ifx_copy_blob ifx_create_blob ifx_create_char ifx_do ifx_error ifx_errormsg ifx_fetch_row ifx_fieldproperties ifx_fieldtypes ifx_free_blob ifx_free_char ifx_free_result ifx_get_blob ifx_get_char ifx_getsqlca ifx_htmltbl_result ifx_nullformat ifx_num_fields ifx_num_rows ifx_pconnect ifx_prepare ifx_query ifx_textasvarchar ifx_update_blob ifx_update_char ifxus_close_slob ifxus_create_slob ifxus_free_slob ifxus_open_slob ifxus_read_slob ifxus_seek_slob ifxus_tell_slob ifxus_write_slob ifx_affected_rows)
b["IIS"] = Set.new %w(iis_add_server iis_add_server iis_get_dir_security iis_get_script_map iis_get_server_by_comment iis_get_server_by_path iis_get_server_rights iis_get_service_state iis_remove_server iis_set_app_settings iis_set_dir_security iis_set_script_map iis_set_server_rights iis_start_server iis_start_service iis_stop_server iis_stop_service iis_add_server)
b["GD and Image"] = Set.new %w(gd_info gd_info getimagesize getimagesizefromstring image_type_to_extension image_type_to_mime_type image2wbmp imageaffine imageaffinematrixconcat imageaffinematrixget imagealphablending imageantialias imagearc imagebmp imagechar imagecharup imagecolorallocate imagecolorallocatealpha imagecolorat imagecolorclosest imagecolorclosestalpha imagecolorclosesthwb imagecolordeallocate imagecolorexact imagecolorexactalpha imagecolormatch imagecolorresolve imagecolorresolvealpha imagecolorset imagecolorsforindex imagecolorstotal imagecolortransparent imageconvolution imagecopy imagecopymerge imagecopymergegray imagecopyresampled imagecopyresized imagecreate imagecreatefrombmp imagecreatefromgd2 imagecreatefromgd2part imagecreatefromgd imagecreatefromgif imagecreatefromjpeg imagecreatefrompng imagecreatefromstring imagecreatefromwbmp imagecreatefromwebp imagecreatefromxbm imagecreatefromxpm imagecreatetruecolor imagecrop imagecropauto imagedashedline imagedestroy imageellipse imagefill imagefilledarc imagefilledellipse imagefilledpolygon imagefilledrectangle imagefilltoborder imagefilter imageflip imagefontheight imagefontwidth imageftbbox imagefttext imagegammacorrect imagegd2 imagegd imagegetclip imagegif imagegrabscreen imagegrabwindow imageinterlace imageistruecolor imagejpeg imagelayereffect imageline imageloadfont imageopenpolygon imagepalettecopy imagepalettetotruecolor imagepng imagepolygon imagepsbbox imagepsencodefont imagepsextendfont imagepsfreefont imagepsloadfont imagepsslantfont imagepstext imagerectangle imageresolution imagerotate imagesavealpha imagescale imagesetbrush imagesetclip imagesetinterpolation imagesetpixel imagesetstyle imagesetthickness imagesettile imagestring imagestringup imagesx imagesy imagetruecolortopalette imagettfbbox imagettftext imagetypes imagewbmp imagewebp imagexbm iptcembed iptcparse jpeg2wbmp png2wbmp gd_info)
b["IMAP"] = Set.new %w(imap_8bit imap_8bit imap_alerts imap_append imap_base64 imap_binary imap_body imap_bodystruct imap_check imap_clearflag_full imap_close imap_create imap_createmailbox imap_delete imap_deletemailbox imap_errors imap_expunge imap_fetch_overview imap_fetchbody imap_fetchheader imap_fetchmime imap_fetchstructure imap_fetchtext imap_gc imap_get_quota imap_get_quotaroot imap_getacl imap_getmailboxes imap_getsubscribed imap_header imap_headerinfo imap_headers imap_last_error imap_list imap_listmailbox imap_listscan imap_listsubscribed imap_lsub imap_mail_compose imap_mail_copy imap_mail_move imap_mail imap_mailboxmsginfo imap_mime_header_decode imap_msgno imap_num_msg imap_num_recent imap_open imap_ping imap_qprint imap_rename imap_renamemailbox imap_reopen imap_rfc822_parse_adrlist imap_rfc822_parse_headers imap_rfc822_write_address imap_savebody imap_scan imap_scanmailbox imap_search imap_set_quota imap_setacl imap_setflag_full imap_sort imap_status imap_subscribe imap_thread imap_timeout imap_uid imap_undelete imap_unsubscribe imap_utf7_decode imap_utf7_encode imap_utf8 imap_8bit)
b["inclued"] = Set.new %w(inclued_get_data inclued_get_data inclued_get_data)
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | true |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/themes/pastie.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/themes/pastie.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Themes
# A port of the pastie style from Pygments.
# See https://bitbucket.org/birkenfeld/pygments-main/src/default/pygments/styles/pastie.py
class Pastie < CSSTheme
name 'pastie'
style Comment, :fg => '#888888'
style Comment::Preproc, :fg => '#cc0000', :bold => true
style Comment::Special, :fg => '#cc0000', :bg => '#fff0f0', :bold => true
style Error, :fg => '#a61717', :bg => '#e3d2d2'
style Generic::Error, :fg => '#aa0000'
style Generic::Heading, :fg => '#333333'
style Generic::Subheading, :fg => '#666666'
style Generic::Deleted, :fg => '#000000', :bg => '#ffdddd'
style Generic::Inserted, :fg => '#000000', :bg => '#ddffdd'
style Generic::Emph, :italic => true
style Generic::Strong, :bold => true
style Generic::Lineno, :fg => '#888888'
style Generic::Output, :fg => '#888888'
style Generic::Prompt, :fg => '#555555'
style Generic::Traceback, :fg => '#aa0000'
style Keyword, :fg => '#008800', :bold => true
style Keyword::Pseudo, :fg => '#008800'
style Keyword::Type, :fg => '#888888', :bold => true
style Num, :fg => '#0000dd', :bold => true
style Str, :fg => '#dd2200', :bg => '#fff0f0'
style Str::Escape, :fg => '#0044dd', :bg => '#fff0f0'
style Str::Interpol, :fg => '#3333bb', :bg => '#fff0f0'
style Str::Other, :fg => '#22bb22', :bg => '#f0fff0'
#style Str::Regex, :fg => '#008800', :bg => '#fff0ff'
# The background color on regex really doesn't look good, so let's drop it
style Str::Regex, :fg => '#008800'
style Str::Symbol, :fg => '#aa6600', :bg => '#fff0f0'
style Name::Attribute, :fg => '#336699'
style Name::Builtin, :fg => '#003388'
style Name::Class, :fg => '#bb0066', :bold => true
style Name::Constant, :fg => '#003366', :bold => true
style Name::Decorator, :fg => '#555555'
style Name::Exception, :fg => '#bb0066', :bold => true
style Name::Function, :fg => '#0066bb', :bold => true
#style Name::Label, :fg => '#336699', :italic => true
# Name::Label is used for built-in CSS properties in Rouge, so let's drop italics
style Name::Label, :fg => '#336699'
style Name::Namespace, :fg => '#bb0066', :bold => true
style Name::Property, :fg => '#336699', :bold => true
style Name::Tag, :fg => '#bb0066', :bold => true
style Name::Variable, :fg => '#336699'
style Name::Variable::Global, :fg => '#dd7700'
style Name::Variable::Instance, :fg => '#3333bb'
style Operator::Word, :fg => '#008800'
style Text, {}
style Text::Whitespace, :fg => '#bbbbbb'
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/themes/monokai_sublime.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/themes/monokai_sublime.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Themes
class MonokaiSublime < CSSTheme
name 'monokai.sublime'
palette :black => '#000000'
palette :bright_green => '#a6e22e'
palette :bright_pink => '#f92672'
palette :carmine => '#960050'
palette :dark => '#49483e'
palette :dark_grey => '#888888'
palette :dark_red => '#aa0000'
palette :dimgrey => '#75715e'
palette :emperor => '#555555'
palette :grey => '#999999'
palette :light_grey => '#aaaaaa'
palette :light_violet => '#ae81ff'
palette :soft_cyan => '#66d9ef'
palette :soft_yellow => '#e6db74'
palette :very_dark => '#1e0010'
palette :whitish => '#f8f8f2'
palette :orange => '#f6aa11'
palette :white => '#ffffff'
style Generic::Heading, :fg => :grey
style Literal::String::Regex, :fg => :orange
style Generic::Output, :fg => :dark_grey
style Generic::Prompt, :fg => :emperor
style Generic::Strong, :bold => false
style Generic::Subheading, :fg => :light_grey
style Name::Builtin, :fg => :orange
style Comment::Multiline,
Comment::Preproc,
Comment::Single,
Comment::Special,
Comment, :fg => :dimgrey
style Error,
Generic::Error,
Generic::Traceback, :fg => :carmine
style Generic::Deleted,
Generic::Inserted,
Generic::Emph, :fg => :dark
style Keyword::Constant,
Keyword::Declaration,
Keyword::Reserved,
Name::Constant,
Keyword::Type, :fg => :soft_cyan
style Literal::Number::Float,
Literal::Number::Hex,
Literal::Number::Integer::Long,
Literal::Number::Integer,
Literal::Number::Oct,
Literal::Number,
Literal::String::Char,
Literal::String::Escape,
Literal::String::Symbol, :fg => :light_violet
style Literal::String::Doc,
Literal::String::Double,
Literal::String::Backtick,
Literal::String::Heredoc,
Literal::String::Interpol,
Literal::String::Other,
Literal::String::Single,
Literal::String, :fg => :soft_yellow
style Name::Attribute,
Name::Class,
Name::Decorator,
Name::Exception,
Name::Function, :fg => :bright_green
style Name::Variable::Class,
Name::Namespace,
Name::Label,
Name::Entity,
Name::Builtin::Pseudo,
Name::Variable::Global,
Name::Variable::Instance,
Name::Variable,
Text::Whitespace,
Text,
Name, :fg => :white
style Operator::Word,
Name::Tag,
Keyword,
Keyword::Namespace,
Keyword::Pseudo,
Operator, :fg => :bright_pink
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/themes/base16.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/themes/base16.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Themes
# default base16 theme
# by Chris Kempson (http://chriskempson.com)
class Base16 < CSSTheme
name 'base16'
palette base00: "#151515"
palette base01: "#202020"
palette base02: "#303030"
palette base03: "#505050"
palette base04: "#b0b0b0"
palette base05: "#d0d0d0"
palette base06: "#e0e0e0"
palette base07: "#f5f5f5"
palette base08: "#ac4142"
palette base09: "#d28445"
palette base0A: "#f4bf75"
palette base0B: "#90a959"
palette base0C: "#75b5aa"
palette base0D: "#6a9fb5"
palette base0E: "#aa759f"
palette base0F: "#8f5536"
extend HasModes
def self.light!
mode :dark # indicate that there is a dark variant
mode! :light
end
def self.dark!
mode :light # indicate that there is a light variant
mode! :dark
end
def self.make_dark!
style Text, :fg => :base05, :bg => :base00
end
def self.make_light!
style Text, :fg => :base02
end
light!
style Error, :fg => :base00, :bg => :base08
style Comment, :fg => :base03
style Comment::Preproc,
Name::Tag, :fg => :base0A
style Operator,
Punctuation, :fg => :base05
style Generic::Inserted, :fg => :base0B
style Generic::Deleted, :fg => :base08
style Generic::Heading, :fg => :base0D, :bg => :base00, :bold => true
style Keyword, :fg => :base0E
style Keyword::Constant,
Keyword::Type, :fg => :base09
style Keyword::Declaration, :fg => :base09
style Literal::String, :fg => :base0B
style Literal::String::Regex, :fg => :base0C
style Literal::String::Interpol,
Literal::String::Escape, :fg => :base0F
style Name::Namespace,
Name::Class,
Name::Constant, :fg => :base0A
style Name::Attribute, :fg => :base0D
style Literal::Number,
Literal::String::Symbol, :fg => :base0B
class Solarized < Base16
name 'base16.solarized'
light!
# author "Ethan Schoonover (http://ethanschoonover.com/solarized)"
palette base00: "#002b36"
palette base01: "#073642"
palette base02: "#586e75"
palette base03: "#657b83"
palette base04: "#839496"
palette base05: "#93a1a1"
palette base06: "#eee8d5"
palette base07: "#fdf6e3"
palette base08: "#dc322f"
palette base09: "#cb4b16"
palette base0A: "#b58900"
palette base0B: "#859900"
palette base0C: "#2aa198"
palette base0D: "#268bd2"
palette base0E: "#6c71c4"
palette base0F: "#d33682"
end
class Monokai < Base16
name 'base16.monokai'
dark!
# author "Wimer Hazenberg (http://www.monokai.nl)"
palette base00: "#272822"
palette base01: "#383830"
palette base02: "#49483e"
palette base03: "#75715e"
palette base04: "#a59f85"
palette base05: "#f8f8f2"
palette base06: "#f5f4f1"
palette base07: "#f9f8f5"
palette base08: "#f92672"
palette base09: "#fd971f"
palette base0A: "#f4bf75"
palette base0B: "#a6e22e"
palette base0C: "#a1efe4"
palette base0D: "#66d9ef"
palette base0E: "#ae81ff"
palette base0F: "#cc6633"
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/themes/github.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/themes/github.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Themes
class Github < CSSTheme
name 'github'
style Comment::Multiline, :fg => '#999988', :italic => true
style Comment::Preproc, :fg => '#999999', :bold => true
style Comment::Single, :fg => '#999988', :italic => true
style Comment::Special, :fg => '#999999', :italic => true, :bold => true
style Comment, :fg => '#999988', :italic => true
style Error, :fg => '#a61717', :bg => '#e3d2d2'
style Generic::Deleted, :fg => '#000000', :bg => '#ffdddd'
style Generic::Emph, :fg => '#000000', :italic => true
style Generic::Error, :fg => '#aa0000'
style Generic::Heading, :fg => '#999999'
style Generic::Inserted, :fg => '#000000', :bg => '#ddffdd'
style Generic::Output, :fg => '#888888'
style Generic::Prompt, :fg => '#555555'
style Generic::Strong, :bold => true
style Generic::Subheading, :fg => '#aaaaaa'
style Generic::Traceback, :fg => '#aa0000'
style Keyword::Constant, :fg => '#000000', :bold => true
style Keyword::Declaration, :fg => '#000000', :bold => true
style Keyword::Namespace, :fg => '#000000', :bold => true
style Keyword::Pseudo, :fg => '#000000', :bold => true
style Keyword::Reserved, :fg => '#000000', :bold => true
style Keyword::Type, :fg => '#445588', :bold => true
style Keyword, :fg => '#000000', :bold => true
style Literal::Number::Float, :fg => '#009999'
style Literal::Number::Hex, :fg => '#009999'
style Literal::Number::Integer::Long, :fg => '#009999'
style Literal::Number::Integer, :fg => '#009999'
style Literal::Number::Oct, :fg => '#009999'
style Literal::Number, :fg => '#009999'
style Literal::String::Backtick, :fg => '#d14'
style Literal::String::Char, :fg => '#d14'
style Literal::String::Doc, :fg => '#d14'
style Literal::String::Double, :fg => '#d14'
style Literal::String::Escape, :fg => '#d14'
style Literal::String::Heredoc, :fg => '#d14'
style Literal::String::Interpol, :fg => '#d14'
style Literal::String::Other, :fg => '#d14'
style Literal::String::Regex, :fg => '#009926'
style Literal::String::Single, :fg => '#d14'
style Literal::String::Symbol, :fg => '#990073'
style Literal::String, :fg => '#d14'
style Name::Attribute, :fg => '#008080'
style Name::Builtin::Pseudo, :fg => '#999999'
style Name::Builtin, :fg => '#0086B3'
style Name::Class, :fg => '#445588', :bold => true
style Name::Constant, :fg => '#008080'
style Name::Decorator, :fg => '#3c5d5d', :bold => true
style Name::Entity, :fg => '#800080'
style Name::Exception, :fg => '#990000', :bold => true
style Name::Function, :fg => '#990000', :bold => true
style Name::Label, :fg => '#990000', :bold => true
style Name::Namespace, :fg => '#555555'
style Name::Tag, :fg => '#000080'
style Name::Variable::Class, :fg => '#008080'
style Name::Variable::Global, :fg => '#008080'
style Name::Variable::Instance, :fg => '#008080'
style Name::Variable, :fg => '#008080'
style Operator::Word, :fg => '#000000', :bold => true
style Operator, :fg => '#000000', :bold => true
style Text::Whitespace, :fg => '#bbbbbb'
style Text, :bg => '#f8f8f8'
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/themes/thankful_eyes.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/themes/thankful_eyes.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Themes
class ThankfulEyes < CSSTheme
name 'thankful_eyes'
# pallette, from GTKSourceView's ThankfulEyes
palette :cool_as_ice => '#6c8b9f'
palette :slate_blue => '#4e5d62'
palette :eggshell_cloud => '#dee5e7'
palette :krasna => '#122b3b'
palette :aluminum1 => '#fefeec'
palette :scarletred2 => '#cc0000'
palette :butter3 => '#c4a000'
palette :go_get_it => '#b2fd6d'
palette :chilly => '#a8e1fe'
palette :unicorn => '#faf6e4'
palette :sandy => '#f6dd62'
palette :pink_merengue => '#f696db'
palette :dune => '#fff0a6'
palette :backlit => '#4df4ff'
palette :schrill => '#ffb000'
style Text, :fg => :unicorn, :bg => :krasna
style Generic::Lineno, :fg => :eggshell_cloud, :bg => :slate_blue
style Generic::Prompt, :fg => :chilly, :bold => true
style Comment, :fg => :cool_as_ice, :italic => true
style Comment::Preproc, :fg => :go_get_it, :bold => true, :italic => true
style Error, :fg => :aluminum1, :bg => :scarletred2
style Generic::Error, :fg => :scarletred2, :italic => true, :bold => true
style Keyword, :fg => :sandy, :bold => true
style Operator, :fg => :backlit, :bold => true
style Punctuation, :fg => :backlit
style Generic::Deleted, :fg => :scarletred2
style Generic::Inserted, :fg => :go_get_it
style Generic::Emph, :italic => true
style Generic::Strong, :bold => true
style Generic::Traceback, :fg => :eggshell_cloud, :bg => :slate_blue
style Keyword::Constant, :fg => :pink_merengue, :bold => true
style Keyword::Namespace,
Keyword::Pseudo,
Keyword::Reserved,
Generic::Heading,
Generic::Subheading, :fg => :schrill, :bold => true
style Keyword::Type,
Name::Constant,
Name::Class,
Name::Decorator,
Name::Namespace,
Name::Builtin::Pseudo,
Name::Exception, :fg => :go_get_it, :bold => true
style Name::Label,
Name::Tag, :fg => :schrill, :bold => true
style Literal::Number,
Literal::Date,
Literal::String::Symbol, :fg => :pink_merengue, :bold => true
style Literal::String, :fg => :dune, :bold => true
style Literal::String::Escape,
Literal::String::Char,
Literal::String::Interpol, :fg => :backlit, :bold => true
style Name::Builtin, :bold => true
style Name::Entity, :fg => '#999999', :bold => true
style Text::Whitespace,
Generic::Output, :fg => '#BBBBBB'
style Name::Function,
Name::Property,
Name::Attribute, :fg => :chilly
style Name::Variable, :fg => :chilly, :bold => true
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/themes/monokai.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/themes/monokai.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Themes
class Monokai < CSSTheme
name 'monokai'
palette :black => '#000000'
palette :bright_green => '#a6e22e'
palette :bright_pink => '#f92672'
palette :carmine => '#960050'
palette :dark => '#49483e'
palette :dark_grey => '#888888'
palette :dark_red => '#aa0000'
palette :dimgrey => '#75715e'
palette :dimgreen => '#324932'
palette :dimred => '#493131'
palette :emperor => '#555555'
palette :grey => '#999999'
palette :light_grey => '#aaaaaa'
palette :light_violet => '#ae81ff'
palette :soft_cyan => '#66d9ef'
palette :soft_yellow => '#e6db74'
palette :very_dark => '#1e0010'
palette :whitish => '#f8f8f2'
palette :orange => '#f6aa11'
palette :white => '#ffffff'
style Comment,
Comment::Multiline,
Comment::Single, :fg => :dimgrey, :italic => true
style Comment::Preproc, :fg => :dimgrey, :bold => true
style Comment::Special, :fg => :dimgrey, :italic => true, :bold => true
style Error, :fg => :carmine, :bg => :very_dark
style Generic::Inserted, :fg => :white, :bg => :dimgreen
style Generic::Deleted, :fg => :white, :bg => :dimred
style Generic::Emph, :fg => :black, :italic => true
style Generic::Error,
Generic::Traceback, :fg => :dark_red
style Generic::Heading, :fg => :grey
style Generic::Output, :fg => :dark_grey
style Generic::Prompt, :fg => :emperor
style Generic::Strong, :bold => true
style Generic::Subheading, :fg => :light_grey
style Keyword,
Keyword::Constant,
Keyword::Declaration,
Keyword::Pseudo,
Keyword::Reserved,
Keyword::Type, :fg => :soft_cyan, :bold => true
style Keyword::Namespace,
Operator::Word,
Operator, :fg => :bright_pink, :bold => true
style Literal::Number::Float,
Literal::Number::Hex,
Literal::Number::Integer::Long,
Literal::Number::Integer,
Literal::Number::Oct,
Literal::Number,
Literal::String::Escape, :fg => :light_violet
style Literal::String::Backtick,
Literal::String::Char,
Literal::String::Doc,
Literal::String::Double,
Literal::String::Heredoc,
Literal::String::Interpol,
Literal::String::Other,
Literal::String::Regex,
Literal::String::Single,
Literal::String::Symbol,
Literal::String, :fg => :soft_yellow
style Name::Attribute, :fg => :bright_green
style Name::Class,
Name::Decorator,
Name::Exception,
Name::Function, :fg => :bright_green, :bold => true
style Name::Constant, :fg => :soft_cyan
style Name::Builtin::Pseudo,
Name::Builtin,
Name::Entity,
Name::Namespace,
Name::Variable::Class,
Name::Variable::Global,
Name::Variable::Instance,
Name::Variable,
Text::Whitespace, :fg => :whitish
style Name::Label, :fg => :whitish, :bold => true
style Name::Tag, :fg => :bright_pink
style Text, :fg => :whitish, :bg => :dark
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/themes/molokai.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/themes/molokai.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Themes
class Molokai < CSSTheme
name 'molokai'
palette :black => '#1b1d1e'
palette :white => '#f8f8f2'
palette :blue => '#66d9ef'
palette :green => '#a6e22e'
palette :grey => '#403d3d'
palette :red => '#f92672'
palette :light_grey => '#465457'
palette :dark_blue => '#5e5d83'
palette :violet => '#af87ff'
palette :yellow => '#d7d787'
style Comment,
Comment::Multiline,
Comment::Single, :fg => :dark_blue, :italic => true
style Comment::Preproc, :fg => :light_grey, :bold => true
style Comment::Special, :fg => :light_grey, :italic => true, :bold => true
style Error, :fg => :white, :bg => :grey
style Generic::Inserted, :fg => :green
style Generic::Deleted, :fg => :red
style Generic::Emph, :fg => :black, :italic => true
style Generic::Error,
Generic::Traceback, :fg => :red
style Generic::Heading, :fg => :grey
style Generic::Output, :fg => :grey
style Generic::Prompt, :fg => :blue
style Generic::Strong, :bold => true
style Generic::Subheading, :fg => :light_grey
style Keyword,
Keyword::Constant,
Keyword::Declaration,
Keyword::Pseudo,
Keyword::Reserved,
Keyword::Type, :fg => :blue, :bold => true
style Keyword::Namespace,
Operator::Word,
Operator, :fg => :red, :bold => true
style Literal::Number::Float,
Literal::Number::Hex,
Literal::Number::Integer::Long,
Literal::Number::Integer,
Literal::Number::Oct,
Literal::Number,
Literal::String::Escape, :fg => :violet
style Literal::String::Backtick,
Literal::String::Char,
Literal::String::Doc,
Literal::String::Double,
Literal::String::Heredoc,
Literal::String::Interpol,
Literal::String::Other,
Literal::String::Regex,
Literal::String::Single,
Literal::String::Symbol,
Literal::String, :fg => :yellow
style Name::Attribute, :fg => :green
style Name::Class,
Name::Decorator,
Name::Exception,
Name::Function, :fg => :green, :bold => true
style Name::Constant, :fg => :blue
style Name::Builtin::Pseudo,
Name::Builtin,
Name::Entity,
Name::Namespace,
Name::Variable::Class,
Name::Variable::Global,
Name::Variable::Instance,
Name::Variable,
Text::Whitespace, :fg => :white
style Name::Label, :fg => :white, :bold => true
style Name::Tag, :fg => :red
style Text, :fg => :white, :bg => :black
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/themes/igor_pro.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/themes/igor_pro.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Themes
class IgorPro < CSSTheme
name 'igorpro'
style Text, :fg => '#444444'
style Comment::Preproc, :fg => '#CC00A3'
style Comment::Special, :fg => '#CC00A3'
style Comment, :fg => '#FF0000'
style Keyword::Constant, :fg => '#C34E00'
style Keyword::Declaration, :fg => '#0000FF'
style Keyword::Reserved, :fg => '#007575'
style Keyword, :fg => '#0000FF'
style Literal::String, :fg => '#009C00'
style Name::Builtin, :fg => '#C34E00'
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/themes/tulip.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/themes/tulip.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Themes
class Tulip < CSSTheme
name 'tulip'
palette :purple => '#766DAF'
palette :lpurple => '#9f93e6'
palette :orange => '#FAAF4C'
palette :green => '#3FB34F'
palette :lgreen => '#41ff5b'
palette :yellow => '#FFF02A'
palette :black => '#000000'
palette :gray => '#6D6E70'
palette :red => '#CC0000'
palette :dark_purple => '#231529'
palette :lunicorn => '#faf8ed'
palette :white => '#FFFFFF'
palette :earth => '#181a27'
palette :dune => '#fff0a6'
style Text, :fg => :white, :bg => :dark_purple
style Comment, :fg => :gray, :italic => true
style Comment::Preproc, :fg => :lgreen, :bold => true, :italic => true
style Error,
Generic::Error, :fg => :white, :bg => :red
style Keyword, :fg => :yellow, :bold => true
style Operator,
Punctuation, :fg => :lgreen
style Generic::Deleted, :fg => :red
style Generic::Inserted, :fg => :green
style Generic::Emph, :italic => true
style Generic::Strong, :bold => true
style Generic::Traceback,
Generic::Lineno, :fg => :white, :bg => :purple
style Keyword::Constant, :fg => :lpurple, :bold => true
style Keyword::Namespace,
Keyword::Pseudo,
Keyword::Reserved,
Generic::Heading,
Generic::Subheading, :fg => :white, :bold => true
style Keyword::Type,
Name::Constant,
Name::Class,
Name::Decorator,
Name::Namespace,
Name::Builtin::Pseudo,
Name::Exception, :fg => :orange, :bold => true
style Name::Label,
Name::Tag, :fg => :lpurple, :bold => true
style Literal::Number,
Literal::Date,
Literal::String::Symbol, :fg => :lpurple, :bold => true
style Literal::String, :fg => :dune, :bold => true
style Literal::String::Escape,
Literal::String::Char,
Literal::String::Interpol, :fg => :orange, :bold => true
style Name::Builtin, :bold => true
style Name::Entity, :fg => '#999999', :bold => true
style Text::Whitespace, :fg => '#BBBBBB'
style Name::Function,
Name::Property,
Name::Attribute, :fg => :lgreen
style Name::Variable, :fg => :lgreen, :bold => true
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/themes/colorful.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/themes/colorful.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Themes
# stolen from pygments
class Colorful < CSSTheme
name 'colorful'
style Text, :fg => "#bbbbbb", :bg => '#000'
style Comment, :fg => "#888"
style Comment::Preproc, :fg => "#579"
style Comment::Special, :fg => "#cc0000", :bold => true
style Keyword, :fg => "#080", :bold => true
style Keyword::Pseudo, :fg => "#038"
style Keyword::Type, :fg => "#339"
style Operator, :fg => "#333"
style Operator::Word, :fg => "#000", :bold => true
style Name::Builtin, :fg => "#007020"
style Name::Function, :fg => "#06B", :bold => true
style Name::Class, :fg => "#B06", :bold => true
style Name::Namespace, :fg => "#0e84b5", :bold => true
style Name::Exception, :fg => "#F00", :bold => true
style Name::Variable, :fg => "#963"
style Name::Variable::Instance, :fg => "#33B"
style Name::Variable::Class, :fg => "#369"
style Name::Variable::Global, :fg => "#d70", :bold => true
style Name::Constant, :fg => "#036", :bold => true
style Name::Label, :fg => "#970", :bold => true
style Name::Entity, :fg => "#800", :bold => true
style Name::Attribute, :fg => "#00C"
style Name::Tag, :fg => "#070"
style Name::Decorator, :fg => "#555", :bold => true
style Literal::String, :bg => "#fff0f0"
style Literal::String::Char, :fg => "#04D"
style Literal::String::Doc, :fg => "#D42"
style Literal::String::Interpol, :bg => "#eee"
style Literal::String::Escape, :fg => "#666", :bold => true
style Literal::String::Regex, :fg => "#000", :bg => "#fff0ff"
style Literal::String::Symbol, :fg => "#A60"
style Literal::String::Other, :fg => "#D20"
style Literal::Number, :fg => "#60E", :bold => true
style Literal::Number::Integer, :fg => "#00D", :bold => true
style Literal::Number::Float, :fg => "#60E", :bold => true
style Literal::Number::Hex, :fg => "#058", :bold => true
style Literal::Number::Oct, :fg => "#40E", :bold => true
style Generic::Heading, :fg => "#000080", :bold => true
style Generic::Subheading, :fg => "#800080", :bold => true
style Generic::Deleted, :fg => "#A00000"
style Generic::Inserted, :fg => "#00A000"
style Generic::Error, :fg => "#FF0000"
style Generic::Emph, :italic => true
style Generic::Strong, :bold => true
style Generic::Prompt, :fg => "#c65d09", :bold => true
style Generic::Output, :fg => "#888"
style Generic::Traceback, :fg => "#04D"
style Error, :fg => "#F00", :bg => "#FAA"
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/themes/gruvbox.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/themes/gruvbox.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
# TODO how are we going to handle soft/hard contrast?
module Rouge
module Themes
# Based on https://github.com/morhetz/gruvbox, with help from
# https://github.com/daveyarwood/gruvbox-pygments
class Gruvbox < CSSTheme
name 'gruvbox'
# global Gruvbox colours {{{
C_dark0_hard = '#1d2021'
C_dark0 ='#282828'
C_dark0_soft = '#32302f'
C_dark1 = '#3c3836'
C_dark2 = '#504945'
C_dark3 = '#665c54'
C_dark4 = '#7c6f64'
C_dark4_256 = '#7c6f64'
C_gray_245 = '#928374'
C_gray_244 = '#928374'
C_light0_hard = '#f9f5d7'
C_light0 = '#fbf1c7'
C_light0_soft = '#f2e5bc'
C_light1 = '#ebdbb2'
C_light2 = '#d5c4a1'
C_light3 = '#bdae93'
C_light4 = '#a89984'
C_light4_256 = '#a89984'
C_bright_red = '#fb4934'
C_bright_green = '#b8bb26'
C_bright_yellow = '#fabd2f'
C_bright_blue = '#83a598'
C_bright_purple = '#d3869b'
C_bright_aqua = '#8ec07c'
C_bright_orange = '#fe8019'
C_neutral_red = '#cc241d'
C_neutral_green = '#98971a'
C_neutral_yellow = '#d79921'
C_neutral_blue = '#458588'
C_neutral_purple = '#b16286'
C_neutral_aqua = '#689d6a'
C_neutral_orange = '#d65d0e'
C_faded_red = '#9d0006'
C_faded_green = '#79740e'
C_faded_yellow = '#b57614'
C_faded_blue = '#076678'
C_faded_purple = '#8f3f71'
C_faded_aqua = '#427b58'
C_faded_orange = '#af3a03'
# }}}
extend HasModes
def self.light!
mode :dark # indicate that there is a dark variant
mode! :light
end
def self.dark!
mode :light # indicate that there is a light variant
mode! :dark
end
def self.make_dark!
palette bg0: C_dark0
palette bg1: C_dark1
palette bg2: C_dark2
palette bg3: C_dark3
palette bg4: C_dark4
palette gray: C_gray_245
palette fg0: C_light0
palette fg1: C_light1
palette fg2: C_light2
palette fg3: C_light3
palette fg4: C_light4
palette fg4_256: C_light4_256
palette red: C_bright_red
palette green: C_bright_green
palette yellow: C_bright_yellow
palette blue: C_bright_blue
palette purple: C_bright_purple
palette aqua: C_bright_aqua
palette orange: C_bright_orange
end
def self.make_light!
palette bg0: C_light0
palette bg1: C_light1
palette bg2: C_light2
palette bg3: C_light3
palette bg4: C_light4
palette gray: C_gray_244
palette fg0: C_dark0
palette fg1: C_dark1
palette fg2: C_dark2
palette fg3: C_dark3
palette fg4: C_dark4
palette fg4_256: C_dark4_256
palette red: C_faded_red
palette green: C_faded_green
palette yellow: C_faded_yellow
palette blue: C_faded_blue
palette purple: C_faded_purple
palette aqua: C_faded_aqua
palette orange: C_faded_orange
end
dark!
mode :light
style Text, :fg => :fg0, :bg => :bg0
style Error, :fg => :red, :bg => :bg0, :bold => true
style Comment, :fg => :gray, :italic => true
style Comment::Preproc, :fg => :aqua
style Name::Tag, :fg => :red
style Operator,
Punctuation, :fg => :fg0
style Generic::Inserted, :fg => :green, :bg => :bg0
style Generic::Deleted, :fg => :red, :bg => :bg0
style Generic::Heading, :fg => :green, :bold => true
style Keyword, :fg => :red
style Keyword::Constant, :fg => :purple
style Keyword::Type, :fg => :yellow
style Keyword::Declaration, :fg => :orange
style Literal::String,
Literal::String::Interpol,
Literal::String::Regex, :fg => :green, :italic => true
style Literal::String::Escape, :fg => :orange
style Name::Namespace,
Name::Class, :fg => :aqua
style Name::Constant, :fg => :purple
style Name::Attribute, :fg => :green
style Literal::Number, :fg => :purple
style Literal::String::Symbol, :fg => :blue
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/formatters/html_legacy.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/formatters/html_legacy.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
# stdlib
require 'cgi'
module Rouge
module Formatters
# Transforms a token stream into HTML output.
class HTMLLegacy < Formatter
tag 'html_legacy'
# @option opts [String] :css_class ('highlight')
# @option opts [true/false] :line_numbers (false)
# @option opts [Rouge::CSSTheme] :inline_theme (nil)
# @option opts [true/false] :wrap (true)
#
# Initialize with options.
#
# If `:inline_theme` is given, then instead of rendering the
# tokens as <span> tags with CSS classes, the styles according to
# the given theme will be inlined in "style" attributes. This is
# useful for formats in which stylesheets are not available.
#
# Content will be wrapped in a tag (`div` if tableized, `pre` if
# not) with the given `:css_class` unless `:wrap` is set to `false`.
def initialize(opts={})
@formatter = opts[:inline_theme] ? HTMLInline.new(opts[:inline_theme])
: HTML.new
@formatter = HTMLTable.new(@formatter, opts) if opts[:line_numbers]
if opts.fetch(:wrap, true)
@formatter = HTMLPygments.new(@formatter, opts.fetch(:css_class, 'codehilite'))
end
end
# @yield the html output.
def stream(tokens, &b)
@formatter.stream(tokens, &b)
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/formatters/html_linewise.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/formatters/html_linewise.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Formatters
class HTMLLinewise < Formatter
def initialize(formatter, opts={})
@formatter = formatter
@class_format = opts.fetch(:class, 'line-%i')
end
def stream(tokens, &b)
token_lines(tokens) do |line|
yield "<div class=#{next_line_class}>"
line.each do |tok, val|
yield @formatter.span(tok, val)
end
yield '</div>'
end
end
def next_line_class
@lineno ||= 0
sprintf(@class_format, @lineno += 1).inspect
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/formatters/html_table.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/formatters/html_table.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Formatters
class HTMLTable < Formatter
tag 'html_table'
def initialize(inner, opts={})
@inner = inner
@start_line = opts.fetch(:start_line, 1)
@line_format = opts.fetch(:line_format, '%i')
@table_class = opts.fetch(:table_class, 'rouge-table')
@gutter_class = opts.fetch(:gutter_class, 'rouge-gutter')
@code_class = opts.fetch(:code_class, 'rouge-code')
end
def style(scope)
yield "#{scope} .rouge-table { border-spacing: 0 }"
yield "#{scope} .rouge-gutter { text-align: right }"
end
def stream(tokens, &b)
num_lines = 0
last_val = ''
formatted = String.new('')
tokens.each do |tok, val|
last_val = val
num_lines += val.scan(/\n/).size
formatted << @inner.span(tok, val)
end
# add an extra line for non-newline-terminated strings
if last_val[-1] != "\n"
num_lines += 1
@inner.span(Token::Tokens::Text::Whitespace, "\n") { |str| formatted << str }
end
# generate a string of newline-separated line numbers for the gutter>
formatted_line_numbers = (@start_line..num_lines+@start_line-1).map do |i|
sprintf("#{@line_format}", i) << "\n"
end.join('')
numbers = %(<pre class="lineno">#{formatted_line_numbers}</pre>)
yield %(<table class="#@table_class"><tbody><tr>)
# the "gl" class applies the style for Generic.Lineno
yield %(<td class="#@gutter_class gl">)
yield numbers
yield '</td>'
yield %(<td class="#@code_class"><pre>)
yield formatted
yield '</pre></td>'
yield "</tr></tbody></table>"
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/formatters/terminal256.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/formatters/terminal256.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Formatters
# A formatter for 256-color terminals
class Terminal256 < Formatter
tag 'terminal256'
# @private
attr_reader :theme
# @param [Hash,Rouge::Theme] theme
# the theme to render with.
def initialize(theme = Themes::ThankfulEyes.new)
if theme.is_a?(Rouge::Theme)
@theme = theme
elsif theme.is_a?(Hash)
@theme = theme[:theme] || Themes::ThankfulEyes.new
else
raise ArgumentError, "invalid theme: #{theme.inspect}"
end
end
def stream(tokens, &b)
tokens.each do |tok, val|
escape = escape_sequence(tok)
yield escape.style_string
yield val.gsub("\n", "#{escape.reset_string}\n#{escape.style_string}")
yield escape.reset_string
end
end
class EscapeSequence
attr_reader :style
def initialize(style)
@style = style
end
def self.xterm_colors
@xterm_colors ||= [].tap do |out|
# colors 0..15: 16 basic colors
out << [0x00, 0x00, 0x00] # 0
out << [0xcd, 0x00, 0x00] # 1
out << [0x00, 0xcd, 0x00] # 2
out << [0xcd, 0xcd, 0x00] # 3
out << [0x00, 0x00, 0xee] # 4
out << [0xcd, 0x00, 0xcd] # 5
out << [0x00, 0xcd, 0xcd] # 6
out << [0xe5, 0xe5, 0xe5] # 7
out << [0x7f, 0x7f, 0x7f] # 8
out << [0xff, 0x00, 0x00] # 9
out << [0x00, 0xff, 0x00] # 10
out << [0xff, 0xff, 0x00] # 11
out << [0x5c, 0x5c, 0xff] # 12
out << [0xff, 0x00, 0xff] # 13
out << [0x00, 0xff, 0xff] # 14
out << [0xff, 0xff, 0xff] # 15
# colors 16..232: the 6x6x6 color cube
valuerange = [0x00, 0x5f, 0x87, 0xaf, 0xd7, 0xff]
217.times do |i|
r = valuerange[(i / 36) % 6]
g = valuerange[(i / 6) % 6]
b = valuerange[i % 6]
out << [r, g, b]
end
# colors 233..253: grayscale
1.upto 22 do |i|
v = 8 + i * 10
out << [v, v, v]
end
end
end
def fg
return @fg if instance_variable_defined? :@fg
@fg = style.fg && self.class.color_index(style.fg)
end
def bg
return @bg if instance_variable_defined? :@bg
@bg = style.bg && self.class.color_index(style.bg)
end
def style_string
@style_string ||= begin
attrs = []
attrs << ['38', '5', fg.to_s] if fg
attrs << ['48', '5', bg.to_s] if bg
attrs << '01' if style[:bold]
attrs << '04' if style[:italic] # underline, but hey, whatevs
escape(attrs)
end
end
def reset_string
@reset_string ||= begin
attrs = []
attrs << '39' if fg # fg reset
attrs << '49' if bg # bg reset
attrs << '00' if style[:bold] || style[:italic]
escape(attrs)
end
end
private
def escape(attrs)
return '' if attrs.empty?
"\e[#{attrs.join(';')}m"
end
def self.color_index(color)
@color_index_cache ||= {}
@color_index_cache[color] ||= closest_color(*get_rgb(color))
end
def self.get_rgb(color)
color = $1 if color =~ /#([0-9a-f]+)/i
hexes = case color.size
when 3
color.chars.map { |c| "#{c}#{c}" }
when 6
color.scan(/../)
else
raise "invalid color: #{color}"
end
hexes.map { |h| h.to_i(16) }
end
# max distance between two colors, #000000 to #ffffff
MAX_DISTANCE = 257 * 257 * 3
def self.closest_color(r, g, b)
@@colors_cache ||= {}
key = (r << 16) + (g << 8) + b
@@colors_cache.fetch(key) do
distance = MAX_DISTANCE
match = 0
xterm_colors.each_with_index do |(cr, cg, cb), i|
d = (r - cr)**2 + (g - cg)**2 + (b - cb)**2
next if d >= distance
match = i
distance = d
end
match
end
end
end
# private
def escape_sequence(token)
@escape_sequences ||= {}
@escape_sequences[token.qualname] ||=
EscapeSequence.new(get_style(token))
end
def get_style(token)
return text_style if token.ancestors.include? Token::Tokens::Text
theme.get_own_style(token) || text_style
end
def text_style
style = theme.get_style(Token['Text'])
# don't highlight text backgrounds
style.delete :bg
style
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/formatters/html_inline.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/formatters/html_inline.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Formatters
class HTMLInline < HTML
tag 'html_inline'
def initialize(theme)
if theme.is_a?(Class) && theme < Rouge::Theme
@theme = theme.new
elsif theme.is_a?(Rouge::Theme)
@theme = theme
elsif theme.is_a?(String)
@theme = Rouge::Theme.find(theme).new
else
raise ArgumentError, "invalid theme: #{theme.inspect}"
end
end
def safe_span(tok, safe_val)
return safe_val if tok == Token::Tokens::Text
rules = @theme.style_for(tok).rendered_rules
"<span style=\"#{rules.to_a.join(';')}\">#{safe_val}</span>"
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
grab/engineering-blog | https://github.com/grab/engineering-blog/blob/d8026a4e9cc6348bf38951ee96c523f4ec19f3c4/_vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/formatters/null.rb | _vendor/ruby/2.6.0/gems/rouge-3.3.0/lib/rouge/formatters/null.rb | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Formatters
# A formatter which renders nothing.
class Null < Formatter
tag 'null'
def initialize(*)
end
def stream(tokens, &b)
tokens.each do |tok, val|
yield "#{tok.qualname} #{val.inspect}\n"
end
end
end
end
end
| ruby | MIT | d8026a4e9cc6348bf38951ee96c523f4ec19f3c4 | 2026-01-04T17:45:10.474201Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.