summaryrefslogtreecommitdiff
path: root/sheets/ruby.ssh
blob: 2f385783bdbd38228b20ac3ece5d11468b25f253 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Style sheet for ruby

style Ruby is

written by "Noritsugu Nakamura <>"
version is 0.0.2

first alphabet is
   "$@ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_"
second alphabet is
   "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_"
case sensitive

keywords in Keyword_strong are
   alias, begin, BEGIN, break, "case", defined?, do, else, elsif, "end", END,
   ensure, for, if, "in", loop, next, raise, redo, rescue, retry, return,
   super, then, undef, unless, until, when, while, yield,
   false, nil, true,
   __FILE__, __LINE__,

   # built-in function
   abort, at_exit, autoload, binding, caller, callcc, catch, chop, chop!,
   chomp, chomp!, eval, exec, exit, exit!, fork, gets, global_variables,
   gsub, gsub!, iterator?, block_given?, load, local_variables, loop, open,
   print, printf, proc, lambda, putc, puts, raise, fail, rand, readline,
   readlines, require, scan, select, set_trace_func, sleep, split, sprintf,
   format, srand, sub, sub!, syscall, system, test, throw, trace_var, trap,
   untrace_var,
   #/[^.][ ]*\\(gets\\|print\\|puts\\)/

   # Module private method
   alias_method, append_features, attr, attr_accessor, attr_reader,
   attr_writer, define_method, extend_object, include, included, method_added,
   method_removed, method_undefined, module_function, private, protected,
   public, remove_class_variable, remove_const, remove_method, undef_method
end keywords

sequences are
    # Strings
    C-string,
    "'" Plain String "'" Plain
       exceptions are
	"\\'", "\\\\"
       end exceptions,

    # Comments
    "#"            Comment,
    /^=begin/           Comment_strong        /^=end/,

    # Some declarations
    (/\\(def\\|class\\|module\\)/	# \1. the keyword
     /\\([[:blank:]]+\\)/		# \2. blanks
     \1 Keyword_strong, \2 Plain) (Label_strong  + Index1)
	closers are
	  /$/ Plain,
	  /[ ;{(]/ Plain
	end closers
end sequences
end style