Last touch
This commit is contained in:
@ -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
|
||||||
|
Reference in New Issue
Block a user