Class: Rouge::Lexers::Magik
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, #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, #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
.character ⇒ Object
63
64
65
|
# File 'lib/rouge/lexers/magik.rb', line 63
def self.character
@character ||= /%u[0-9a-z]{4}|%[^\s]+/i
end
|
.decimal ⇒ Object
56
57
58
|
# File 'lib/rouge/lexers/magik.rb', line 56
def self.decimal
@decimal ||= /\.#{Magik.digits}/
end
|
.digits ⇒ Object
47
48
49
|
# File 'lib/rouge/lexers/magik.rb', line 47
def self.digits
@digits ||= /[0-9]+/
end
|
.exponent ⇒ Object
53
54
55
|
# File 'lib/rouge/lexers/magik.rb', line 53
def self.exponent
@exponent ||= /(e|&)[+-]?#{Magik.digits}/i
end
|
.keywords ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/rouge/lexers/magik.rb', line 13
def self.keywords
@keywords ||= %w(
_package
_pragma
_block _endblock
_handling _default
_protect _protection _endprotect
_try _with _when _endtry
_catch _endcatch
_throw
_lock _endlock
_if _then _elif _else _endif
_for _over _while _loop _finally _endloop _loopbody _continue _leave
_return
_class
_local _constant _recursive _global _dynamic _import
_private _iter _abstract _method _endmethod
_proc _endproc
_gather _scatter _allresults _optional
_thisthread _self _clone _super
_primitive
_unset _true _false _maybe
_is _isnt _not _and _or _xor _cf _andif _orif
_div _mod
)
end
|
.label ⇒ Object
85
86
87
|
# File 'lib/rouge/lexers/magik.rb', line 85
def self.label
@label = /@[\s]*#{Magik.identifier}/
end
|
.package_identifier ⇒ Object
76
77
78
|
# File 'lib/rouge/lexers/magik.rb', line 76
def self.package_identifier
@package_identifier ||= /#{Magik.identifier}:#{Magik.identifier}/
end
|
.piped_identifier ⇒ Object
70
71
72
|
# File 'lib/rouge/lexers/magik.rb', line 70
def self.piped_identifier
@piped_identifier ||= /\|[^\|\n]*\|/
end
|
.radix ⇒ Object
50
51
52
|
# File 'lib/rouge/lexers/magik.rb', line 50
def self.radix
@radix ||= /r[0-9a-z]/i
end
|
.simple_identifier ⇒ Object
67
68
69
|
# File 'lib/rouge/lexers/magik.rb', line 67
def self.simple_identifier
@simple_identifier ||= /(?>(?:[a-z0-9_!?]|\\.)+)/i
end
|
.string_double ⇒ Object
40
41
42
|
# File 'lib/rouge/lexers/magik.rb', line 40
def self.string_double
@string_double ||= /"[^"\n]*?"/
end
|
.string_single ⇒ Object
43
44
45
|
# File 'lib/rouge/lexers/magik.rb', line 43
def self.string_single
@string_single ||= /'[^'\n]*?'/
end
|
.symbol ⇒ Object
79
80
81
|
# File 'lib/rouge/lexers/magik.rb', line 79
def self.symbol
@symbol ||= /:#{Magik.identifier}/i
end
|