Skip to content

Commit

Permalink
Remove trailing whitespace (#1245)
Browse files Browse the repository at this point in the history
This commit removes trailing whitespace.
  • Loading branch information
ashmaroli authored and pyrmont committed Jul 3, 2019
1 parent ba2bfba commit 1af45d5
Show file tree
Hide file tree
Showing 16 changed files with 72 additions and 72 deletions.
2 changes: 1 addition & 1 deletion lib/rouge/guessers/modeline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def filter(lexers)

matches = MODELINES.map { |re| re.match(search_space) }.compact
return lexers unless matches.any?

match_set = Set.new(matches.map { |m| m[1] })
lexers.select { |l| match_set.include?(l.tag) || l.aliases.any? { |a| match_set.include?(a) } }
end
Expand Down
10 changes: 5 additions & 5 deletions lib/rouge/lexers/ceylon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ class Ceylon < RegexLexer
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
Expand All @@ -48,7 +48,7 @@ class Ceylon < RegexLexer
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
Expand Down Expand Up @@ -84,7 +84,7 @@ class Ceylon < RegexLexer
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!
Expand Down
2 changes: 1 addition & 1 deletion lib/rouge/lexers/elm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module exposing port

# Single, double quotes, and triple double quotes
rule %r/"""/, Str, :multiline_string
rule %r/'(\\.|.)'/, Str::Char
rule %r/'(\\.|.)'/, Str::Char
rule %r/"/, Str, :double_quote

# Numbers
Expand Down
8 changes: 4 additions & 4 deletions lib/rouge/lexers/fsharp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ def self.keywords
internal lazy let let! match member module mutable namespace
new not null of open or override private public rec return
return! select static struct then to true try type upcast
use use! val void when while with yield yield! sig atomic
break checked component const constraint constructor
continue eager event external fixed functor include method
mixin object parallel process protected pure sealed tailcall
use use! val void when while with yield yield! sig atomic
break checked component const constraint constructor
continue eager event external fixed functor include method
mixin object parallel process protected pure sealed tailcall
trait virtual volatile
)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/rouge/lexers/glsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def self.builtins
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_FogCoord gl_MaxVertexAttribs gl_MaxVertexUniformComponents
gl_MaxVaryingFloats gl_MaxVaryingComponents gl_MaxVertexOutputComponents
gl_MaxGeometryInputComponents gl_MaxGeometryOutputComponents
gl_MaxFragmentInputComponents gl_MaxVertexTextureImageUnits
Expand Down
6 changes: 3 additions & 3 deletions lib/rouge/lexers/jsp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class JSP < TemplateLexer
desc 'JSP'
tag 'jsp'
filenames '*.jsp'
mimetypes 'text/x-jsp', 'application/x-jsp'
mimetypes 'text/x-jsp', 'application/x-jsp'

def initialize(*)
super
Expand All @@ -16,7 +16,7 @@ def initialize(*)

directives = %w(page include taglib)
actions = %w(scriptlet declaration expression)

state :root do

rule %r/<%--/, Comment, :jsp_comment
Expand Down Expand Up @@ -106,7 +106,7 @@ def initialize(*)

state :jsp_interp do
rule %r/\}/, Str::Interpol, :pop!
rule %r/'/, Literal, :jsp_interp_literal_start
rule %r/'/, Literal, :jsp_interp_literal_start
rule(/[^'\}]+/) { delegate @java }
end

Expand Down
86 changes: 43 additions & 43 deletions lib/rouge/lexers/mosel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Mosel < RegexLexer
tag 'mosel'
filenames '*.mos'
title "Mosel"
desc "An optimization language used by Fico's Xpress."
desc "An optimization language used by Fico's Xpress."
# http://www.fico.com/en/products/fico-xpress-optimization-suite
filenames '*.mos'

Expand All @@ -24,46 +24,46 @@ def self.detect?(text)
############################################################################################################################

core_keywords = %w(
and array as
boolean break
case count counter
declarations div do dynamic
elif else end evaluation exit
false forall forward from function
if imports in include initialisations initializations integer inter is_binary is_continuous is_free is_integer is_partint is_semcont is_semint is_sos1 is_sos2
linctr list
and array as
boolean break
case count counter
declarations div do dynamic
elif else end evaluation exit
false forall forward from function
if imports in include initialisations initializations integer inter is_binary is_continuous is_free is_integer is_partint is_semcont is_semint is_sos1 is_sos2
linctr list
max min mod model mpvar
next not of options or
package parameters procedure
public prod range real record repeat requirements
package parameters procedure
public prod range real record repeat requirements
set string sum
then to true
union until uses
version
while with
)

core_functions = %w(
abs arctan assert
bitflip bitneg bitset bitshift bittest bitval
ceil cos create currentdate currenttime cuthead cuttail
delcell exists exit exp exportprob
fclose fflush finalize findfirst findlast floor fopen fselect fskipline
fclose fflush finalize findfirst findlast floor fopen fselect fskipline
getact getcoeff getcoeffs getdual getfid getfirst gethead getfname getlast getobjval getparam getrcost getreadcnt getreverse getsize getslack getsol gettail gettype getvars
iseof ishidden isodd ln log
makesos1 makesos2 maxlist minlist
publish
iseof ishidden isodd ln log
makesos1 makesos2 maxlist minlist
publish
random read readln reset reverse round
setcoeff sethidden setioerr setname setparam setrandseed settype sin splithead splittail sqrt strfmt substr
timestamp
unpublish
setcoeff sethidden setioerr setname setparam setrandseed settype sin splithead splittail sqrt strfmt substr
timestamp
unpublish
write writeln
)

############################################################################################################################
# mmxprs module elements
############################################################################################################################

mmxprs_functions = %w(
addmipsol
basisstability
Expand All @@ -79,26 +79,26 @@ def self.detect?(text)
readbasis readdirs readsol refinemipsol rejectintsol repairinfeas resetbasis resetiis resetsol
savebasis savemipsol savesol savestate selectsol setbstat setcallback setcbcutoff setgndata setlb setmipdir setmodcut setsol setub setucbdata stopoptimize
unloadprob
writebasis writedirs writeprob writesol
writebasis writedirs writeprob writesol
xor
)

mmxpres_constants = %w(XPRS_OPT XPRS_UNF XPRS_INF XPRS_UNB XPRS_OTH)

mmxprs_parameters = %w(XPRS_colorder XPRS_enumduplpol XPRS_enummaxsol XPRS_enumsols XPRS_fullversion XPRS_loadnames XPRS_problem XPRS_probname XPRS_verbose)


############################################################################################################################
# mmsystem module elements
############################################################################################################################

mmsystem_functions = %w(
addmonths
copytext cuttext
deltext
deltext
endswith expandpath
fcopy fdelete findfiles findtext fmove
getasnumber getchar getcwd getdate getday getdaynum getdays getdirsep
getasnumber getchar getcwd getdate getday getdaynum getdays getdirsep
getendparse setendparse
getenv getfsize getfstat getftime gethour getminute getmonth getmsec getpathsep
getqtype setqtype
Expand All @@ -108,37 +108,37 @@ def self.detect?(text)
getstart setstart
getsucc setsucc
getsysinfo getsysstat gettime
gettmpdir
gettmpdir
gettrim settrim
getweekday getyear
inserttext isvalid
makedir makepath newtar
newzip nextfield
openpipe
openpipe
parseextn parseint parsereal parsetext pastetext pathmatch pathsplit
qsort quote
readtextline regmatch regreplace removedir removefiles
readtextline regmatch regreplace removedir removefiles
setchar setdate setday setenv sethour
setminute setmonth setmsec setsecond settime setyear sleep startswith system
tarlist textfmt tolower toupper trim
untar unzip
ziplist
)

mmsystem_parameters = %w(datefmt datetimefmt monthnames sys_endparse sys_fillchar sys_pid sys_qtype sys_regcache sys_sepchar)

############################################################################################################################
# mmjobs module elements
############################################################################################################################

mmjobs_instance_mgmt_functions = %w(
clearaliases connect
disconnect
findxsrvs
getaliases getbanner gethostalias
sethostalias
)

mmjobs_model_mgmt_functions = %w(
compile
detach
Expand All @@ -148,7 +148,7 @@ def self.detect?(text)
setcontrol setdefstream setmodpar setworkdir stop
unload
)

mmjobs_synchornization_functions = %w(
dropnextevent
getclass getfromgid getfromid getfromuid getnextevent getvalue
Expand All @@ -158,9 +158,9 @@ def self.detect?(text)
send setgid setuid
wait waitfor
)

mmjobs_functions = mmjobs_instance_mgmt_functions + mmjobs_model_mgmt_functions + mmjobs_synchornization_functions

mmjobs_parameters = %w(conntmpl defaultnode fsrvdelay fsrvnbiter fsrvport jobid keepalive nodenumber parentnumber)


Expand Down Expand Up @@ -201,22 +201,22 @@ def self.detect?(text)
rule %r{[~!@#\$%\^&\*\(\)\+`\-={}\[\]:;<>\?,\.\/\|\\]}, Punctuation
# rule %r{'([^']|'')*'}, Str
# rule %r/"(\\\\|\\"|[^"])*"/, Str



rule %r/(true|false)\b/i, Name::Builtin
rule %r/\b(#{core_keywords.join('|')})\b/i, Keyword
rule %r/\b(#{core_functions.join('|')})\b/, Name::Builtin



rule %r/\b(#{mmxprs_functions.join('|')})\b/, Name::Function
rule %r/\b(#{mmxpres_constants.join('|')})\b/, Name::Constant
rule %r/\b(#{mmxprs_parameters.join('|')})\b/i, Name::Property

rule %r/\b(#{mmsystem_functions.join('|')})\b/i, Name::Function
rule %r/\b(#{mmsystem_parameters.join('|')})\b/, Name::Property

rule %r/\b(#{mmjobs_functions.join('|')})\b/i, Name::Function
rule %r/\b(#{mmjobs_parameters.join('|')})\b/, Name::Property

Expand Down
2 changes: 1 addition & 1 deletion lib/rouge/lexers/nix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class Nix < RegexLexer
rule %r/}/, Punctuation, :pop!
mixin :expression
end

state :expression do
mixin :ignore
mixin :comment
Expand Down
6 changes: 3 additions & 3 deletions lib/rouge/lexers/powershell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Powershell < RegexLexer
\$REPORTERRORSHOWSOURCE \$REPORTERRORSHOWSTACKTRACE
\$SENDER \$ShellId \$StackTrace \$switch \$this \$true
).join('|')

# https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_reserved_words?view=powershell-6
KEYWORDS = %w(
assembly exit process base filter public begin finally return break for
Expand All @@ -40,7 +40,7 @@ class Powershell < RegexLexer
inlinescript until do interface using dynamicparam module var else
namespace while elseif parallel workflow end param enum private
).join('|')

# https://devblogs.microsoft.com/scripting/powertip-find-a-list-of-powershell-type-accelerators/
# ([PSObject].Assembly.GetType("System.Management.Automation.TypeAccelerators")::Get).Keys -join ' '
KEYWORDS_TYPE = %w(
Expand Down Expand Up @@ -74,7 +74,7 @@ class Powershell < RegexLexer
MULTILINE_KEYWORDS = %w(
synopsis description parameter example inputs outputs notes link
component role functionality forwardhelptargetname forwardhelpcategory
remotehelprunspace externalhelp
remotehelprunspace externalhelp
).join('|')

state :variable do
Expand Down
2 changes: 1 addition & 1 deletion lib/rouge/lexers/scala.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class Scala < RegexLexer
(#{keywords.join("|")})\b|
(<[%:-]|=>|>:|[#=@_\u21D2\u2190])(\b|(?=\s)|$)
)x, Keyword
rule %r/:(?!#{op})/, Keyword, :type
rule %r/:(?!#{op})/, Keyword, :type
rule %r/(true|false|null)\b/, Keyword::Constant
rule %r/(import|package)(\s+)/ do
groups Keyword, Text
Expand Down
8 changes: 4 additions & 4 deletions lib/rouge/lexers/swift.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ class deinit enum convenience extension final func import init internal lazy let
groups Keyword::Declaration, Error, Keyword::Declaration
end
end

rule %r/#available\([^)]+\)/, Keyword::Declaration

rule %r/(#(?:selector|keyPath)\()([^)]+?(?:[(].*?[)])?)(\))/ do
groups Keyword::Declaration, Name::Function, Keyword::Declaration
end

rule %r/#(line|file|column|function|dsohandle)/, Keyword::Declaration

rule %r/(let|var)\b(\s*)(#{id})/ do
Expand All @@ -122,7 +122,7 @@ class deinit enum convenience extension final func import init internal lazy let
token Name::Function
end
end

rule %r/as[?!]?(?=\s)/, Keyword
rule %r/try[!]?(?=\s)/, Keyword

Expand Down
2 changes: 1 addition & 1 deletion lib/rouge/lexers/vala.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Vala < RegexLexer
)

keywords_type = %w(
bool char double float int int8 int16 int32 int64 long short size_t
bool char double float int int8 int16 int32 int64 long short size_t
ssize_t string unichar uint uint8 uint16 uint32 uint64 ulong ushort
)

Expand Down
2 changes: 1 addition & 1 deletion lib/rouge/lexers/vhdl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def self.operator_words

# Find Attributes
rule %r/'#{id}/i, Name::Attribute

# Punctuations
rule %r/[(),:;]/, Punctuation

Expand Down
Loading

0 comments on commit 1af45d5

Please sign in to comment.