Class: Rouge::Lexers::XPath
Direct Known Subclasses
XQuery
Constant Summary
Constants inherited
from RegexLexer
RegexLexer::MAX_NULL_SCANS
Token::Tokens::Num, Token::Tokens::Str
Instance Attribute Summary
Attributes inherited from Rouge::Lexer
#options
Class Method Summary
collapse
Methods inherited from RegexLexer
append, #delegate, get_state, #get_state, #goto, #group, #groups, #in_state?, #pop!, prepend, #push, #recurse, replace_state, #reset!, #reset_stack, #stack, start, start_procs, #state, state, #state?, state_definitions, states, #step, #stream_tokens, #token
aliases, all, #as_bool, #as_lexer, #as_list, #as_string, #as_token, assert_utf8!, #bool_option, #continue_lex, continue_lex, debug_enabled?, demo, demo_file, desc, detect?, detectable?, disable_debug!, enable_debug!, filenames, find, find_fancy, guess, guess_by_filename, guess_by_mimetype, guess_by_source, guesses, #hash_option, #initialize, lex, #lex, #lexer_option, #list_option, lookup_fancy, mimetypes, option, option_docs, #reset!, #stream_tokens, #string_option, tag, #tag, title, #token_option, #with
token
Constructor Details
This class inherits a constructor from Rouge::Lexer
Class Method Details
.axes ⇒ Object
67
68
69
70
71
72
73
|
# File 'lib/rouge/lexers/xpath.rb', line 67
def self.axes
@axes ||= Regexp.union %w(
child descendant attribute self descendant-or-self
following-sibling following namespace
parent ancestor preceding-sibling preceding ancestor-or-self
)
end
|
46
47
48
|
# File 'lib/rouge/lexers/xpath.rb', line 46
def self.
@commentStart ||= %r/\(:/
end
|
.constructorTypes ⇒ Object
92
93
94
|
# File 'lib/rouge/lexers/xpath.rb', line 92
def self.constructorTypes
@constructorTypes ||= Regexp.union %w(function array map empty-sequence)
end
|
.decimalLiteral ⇒ Object
18
19
20
|
# File 'lib/rouge/lexers/xpath.rb', line 18
def self.decimalLiteral
@decimalLiteral ||= %r/\.#{digits}|#{digits}\.[0-9]*/
end
|
.digits ⇒ Object
14
15
16
|
# File 'lib/rouge/lexers/xpath.rb', line 14
def self.digits
@digits ||= %r/[0-9]+/
end
|
.doubleLiteral ⇒ Object
22
23
24
|
# File 'lib/rouge/lexers/xpath.rb', line 22
def self.doubleLiteral
@doubleLiteral ||= %r/(\.#{digits})|#{digits}(\.[0-9]*)?[eE][+-]?#{digits}/
end
|
.eqName ⇒ Object
42
43
44
|
# File 'lib/rouge/lexers/xpath.rb', line 42
def self.eqName
@eqName ||= %r/(?:#{uriQName}|#{qName})/
end
|
.keywords ⇒ Object
79
80
81
|
# File 'lib/rouge/lexers/xpath.rb', line 79
def self.keywords
@keywords ||= Regexp.union %w(let for some every if then else return in satisfies)
end
|
.kindTest ⇒ Object
56
57
58
59
60
61
|
# File 'lib/rouge/lexers/xpath.rb', line 56
def self.kindTest
@kindTest ||= Regexp.union %w(
element attribute schema-element schema-attribute
comment text node document-node namespace-node
)
end
|
.kindTestForPI ⇒ Object
63
64
65
|
# File 'lib/rouge/lexers/xpath.rb', line 63
def self.kindTestForPI
@kindTestForPI ||= Regexp.union %w(processing-instruction)
end
|
.ncName ⇒ Object
30
31
32
|
# File 'lib/rouge/lexers/xpath.rb', line 30
def self.ncName
@ncName ||= %r/[a-z_][a-z_\-.0-9]*/i
end
|
.openParen ⇒ Object
50
51
52
|
# File 'lib/rouge/lexers/xpath.rb', line 50
def self.openParen
@openParen ||= %r/\((?!:)/
end
|
.operators ⇒ Object
75
76
77
|
# File 'lib/rouge/lexers/xpath.rb', line 75
def self.operators
@operators ||= Regexp.union %w(, => = := : >= >> > <= << < - * != + // / || |)
end
|
.qName ⇒ Object
34
35
36
|
# File 'lib/rouge/lexers/xpath.rb', line 34
def self.qName
@qName ||= %r/(?:#{ncName})(?::#{ncName})?/
end
|
.stringLiteral ⇒ Object
26
27
28
|
# File 'lib/rouge/lexers/xpath.rb', line 26
def self.stringLiteral
@stringLiteral ||= %r/("(("")|[^"])*")|('(('')|[^'])*')/
end
|
.uriQName ⇒ Object
38
39
40
|
# File 'lib/rouge/lexers/xpath.rb', line 38
def self.uriQName
@uriQName ||= %r/Q\{[^{}]*\}#{ncName}/
end
|
.word_operators ⇒ Object
83
84
85
86
87
88
89
90
|
# File 'lib/rouge/lexers/xpath.rb', line 83
def self.word_operators
@word_operators ||= Regexp.union %w(
and or eq ge gt le lt ne is
div mod idiv
intersect except union
to
)
end
|