Class: Rouge::Lexers::Nial

Inherits:
RegexLexer show all
Defined in:
lib/rouge/lexers/nial.rb

Constant Summary

Constants inherited from RegexLexer

RegexLexer::MAX_NULL_SCANS

Constants included from Token::Tokens

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

Methods inherited from Rouge::Lexer

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

Methods included from Token::Tokens

token

Constructor Details

This class inherits a constructor from Rouge::Lexer

Class Method Details

.constsObject



110
111
112
# File 'lib/rouge/lexers/nial.rb', line 110

def self.consts
  @consts ||= Set.new %w(false null pi true)
end

.funcsObject



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/rouge/lexers/nial.rb', line 44

def self.funcs
  @funcs ||= Set.new ["operation", "expression", "and", "abs",
            "allbools", "allints", "allchars", "allin",
            "allreals", "allnumeric", "append",
            "arcsin", "arccos", "appendfile", "apply",
            "arctan", "atomic", "assign", "atversion",
            "axes", "cart", "break", "blend", "breaklist",
            "breakin", "bye", "callstack", "choose", "char",
            "ceiling", "catenate", "charrep", "check_socket",
            "cos", "content", "close", "clearws",
            "clearprofile", "cols", "continue", "copyright",
            "cosh", "cull", "count", "diverse", "deepplace",
            "cutall", "cut", "display", "deparse",
            "deepupdate", "descan", "depth", "diagram",
            "div", "divide", "drop", "dropright", "edit",
            "empty", "expression", "exit", "except", "erase",
            "equal", "eval", "eraserecord", "execute", "exp",
            "external", "exprs", "findall", "find", 
            "fault", "falsehood", "filestatus", "filelength",
            "filepath", "filetally", "floor", "first",
            "flip", "fuse", "fromraw", "front",
            "gage", "getfile", "getdef", "getcommandline",
            "getenv", "getname", "hitch", "grid", "getsyms",
            "gradeup", "gt", "gte", "host", "in", "inverse",
            "innerproduct", "inv", "ip", "ln", "link", "isboolean",
            "isinteger", "ischar", "isfault", "isreal", "isphrase",
            "isstring", "istruthvalue", "last", "laminate",
            "like", "libpath", "library", "list", "load",
            "loaddefs", "nonlocal", "max", "match", "log",
            "lt", "lower", "lte", "mate", "min", "maxlength",
            "mod", "mix", "minus", "nialroot", "mold", "not",
            "numeric", "no_op", "no_expr", "notin",
            "operation", "open", "or", "opposite", "opp",
            "operators", "plus", "pick", "pack", "pass", "pair", "parse",
            "paste", "phrase", "place", "picture", "placeall",
            "power", "positions", "post", "quotient", "putfile",
            "profile", "prod", "product", "profiletree",
            "profiletable", "quiet_fault", "raise", "reach",
            "random", "reciprocal", "read", "readfile",
            "readchar", "readarray", "readfield",
            "readscreen", "readrecord", "recip", "reshape",
            "seek", "second", "rest", "reverse", "restart",
            "return_status", "scan", "save", "rows", "rotate",
            "seed", "see", "sublist", "sin", "simple", "shape",
            "setformat", "setdeftrace", "set", "seeusercalls",
            "seeprimcalls", "separator", "setwidth", "settrigger",
            "setmessages", "setlogname", "setinterrupts",
            "setprompt", "setprofile", "sinh", "single",
            "sqrt", "solitary", "sketch", "sleep",
            "socket_listen", "socket_accept", "socket_close",
            "socket_bind", "socket_connect", "socket_getline",
            "socket_receive", "socket_peek", "socket_read",
            "socket_send", "socket_write", "solve", "split",
            "sortup", "string", "status", "take", "symbols",
            "sum", "system", "tan", "tally", "takeright",
            "tanh", "tell", "tr", "times", "third", "time",
            "toupper", "tolower", "timestamp", "tonumber",
            "toraw", "toplevel", "transformer", "type",
            "transpose", "trs", "truth", "unequal",
            "variable", "valence", "up", "updateall",
            "update", "vacate", "value", "version", "vars",
            "void", "watch", "watchlist", "write", "writechars",
            "writearray", "writefile", "writefield",
            "writescreen", "writerecord"]
end

.keywordsObject



12
13
14
15
16
17
18
19
# File 'lib/rouge/lexers/nial.rb', line 12

def self.keywords
  @keywords ||= Set.new ["is", "gets", "op", "tr", ";",
               "if", "then", "elseif", "else",
               "endif", "case", "from", "endcase",
               "begin", "end", "for", "with",
               "endfor", "while", "do", "endwhile",
               "repeat", "until", "endrepeat"]
end

.operatorsObject



21
22
23
24
# File 'lib/rouge/lexers/nial.rb', line 21

def self.operators
  @operators||= Set.new [".",  "!", "#", "+", "*", "-", "<<",
           "/", "<", ">>", "<=", ">", "=", ">=", "@", "|", "~="]
end

.punctuationsObject



26
27
28
# File 'lib/rouge/lexers/nial.rb', line 26

def self.punctuations
  @punctuations ||= Set.new [ "{", "}", "[", "]", ",", "(", ")", ":=", ":", ";"]
end

.transformersObject



30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/rouge/lexers/nial.rb', line 30

def self.transformers
  @transformers ||= Set.new ["accumulate", "across",
  "bycols", "bykey",  "byrows",
  "converse",  "down",
  "eachboth", "eachall", "each",
  "eachleft", "eachright",
  "filter", "fold", "fork",
  "grade",  "inner", "iterate",
  "leaf",  "no_tr", "outer",
  "partition", "rank", "recur",
  "reduce", "reducecols", "reducerows",
  "sort", "team", "timeit", "twig"]
end