Class: Rouge::Lexers::Idris

Inherits:
RegexLexer show all
Defined in:
lib/rouge/lexers/idris.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

.asciiObject



23
24
25
26
27
28
# File 'lib/rouge/lexers/idris.rb', line 23

def self.ascii
  @ascii ||= %w(
    NUL SOH [SE]TX EOT ENQ ACK BEL BS HT LF VT FF CR S[OI] DLE
    DC[1-4] NAK SYN ETB CAN EM SUB ESC [FGRU]S SP DEL
  )
end

.prelude_functionsObject



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

def self.prelude_functions
  @prelude_functions ||= %w(
    abs acos all and any asin atan atan2 break ceiling compare concat
    concatMap const cos cosh curry cycle div drop dropWhile elem
    encodeFloat enumFrom enumFromThen enumFromThenTo enumFromTo exp
    fail filter flip floor foldl foldl1 foldr foldr1 fromInteger fst
    gcd getChar getLine head id init iterate last lcm length lines log
    lookup map max maxBound maximum maybe min minBound minimum mod
    negate not null or pi pred print product putChar putStr putStrLn
    readFile recip repeat replicate return reverse scanl scanl1 sequence
    sequence_ show sin sinh snd span splitAt sqrt succ sum tail take
    takeWhile tan tanh uncurry unlines unwords unzip unzip3 words
    writeFile zip zip3 zipWith zipWith3
  )
end

.reserved_keywordsObject



15
16
17
18
19
20
21
# File 'lib/rouge/lexers/idris.rb', line 15

def self.reserved_keywords
  @reserved_keywords ||= %w(
    _ data class instance namespace
    infix[lr]? let where of with type
    do if then else case in
  )
end