Last touch

This commit is contained in:
Clément Fournier
2018-06-04 23:45:06 +02:00
parent 45ea598337
commit cc5a99b232

View File

@ -13,6 +13,12 @@ module Rouge
filenames '*.xpath' filenames '*.xpath'
mimetypes 'text/x-xpath' mimetypes 'text/x-xpath'
state :root do
mixin :basic
mixin :operators
mixin :names
end
state :basic do state :basic do
rule /\s+/, Text::Whitespace rule /\s+/, Text::Whitespace
rule /[(]:(?![)])/, Comment, :nested_comment rule /[(]:(?![)])/, Comment, :nested_comment
@ -28,7 +34,7 @@ module Rouge
end end
state :operators do state :operators do
rule /(<|>|=<|>=|==|\/\/|[|\/*+-])(?=\s|[a-zA-Z0-9\[])/, Operator rule /(<|>|=<|>=|==|:=|\/\/|[|\/*+-])(?=\s|[a-zA-Z0-9\[])/, Operator
# operators # operators
rule /(or|and|not|mod|ne|eq|lt|le|gt|ge)/, Operator::Word rule /(or|and|not|mod|ne|eq|lt|le|gt|ge)/, Operator::Word
# keywords # keywords
@ -45,17 +51,11 @@ module Rouge
# Attributes # Attributes
rule /@[a-zA-Z][_\-a-zA-Z0-9]*/, Name::Attribute rule /@[a-zA-Z][_\-a-zA-Z0-9]*/, Name::Attribute
# XPath variables # XPath variables
rule /\$[a-zA-Z][_\-a-zA-Z0-9]*/, Name::Variable rule /\$\s*[a-zA-Z][_\-a-zA-Z0-9]*/, Name::Variable
# Functions # Functions
rule /[a-zA-Z\-]+(?=\s*+\()/, Name::Function rule /[a-zA-Z\-]+(?=\s*+\()/, Name::Function
# Node names # Node names
rule /[a-zA-Z]+/, Name::Class rule /[a-zA-Z]+/, Name::Tag
end
state :root do
mixin :basic
mixin :operators
mixin :names
end end
state :nested_comment do state :nested_comment do