Blame view

docs/js/editarea_0_8_2/edit_area/reg_syntax/ruby.js 1.72 KB
c2589de4   Luigi Serra   added demo page
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
60
61
62
63
64
65
66
67
68
  /**

   * Ruby syntax v 1.0 

   * 

   * v1.0 by Patrice De Saint Steban (2007/01/03)

   *   

  **/

  editAreaLoader.load_syntax["ruby"] = {

  	'DISPLAY_NAME' : 'Ruby'

  	,'COMMENT_SINGLE' : {1 : '#'}

  	,'COMMENT_MULTI' : {}

  	,'QUOTEMARKS' : {1: "'", 2: '"'}

  	,'KEYWORD_CASE_SENSITIVE' : true

  	,'KEYWORDS' : {

  		'reserved' : [

  			'alias', 'and', 'BEGIN', 'begin', 'break', 'case', 'class', 'def', 'defined', 'do', 'else',

  			'elsif', 'END', 'end', 'ensure', 'false', 'for', 'if', 

  			'in', 'module', 'next', 'not', 'or', 'redo', 'rescue', 'retry',

  			'return', 'self', 'super', 'then', 'true', 'undef', 'unless', 'until', 'when', 'while', 'yield'

  		]

  	}

  	,'OPERATORS' :[

  		'+', '-', '/', '*', '=', '<', '>', '%', '!', '&', ';', '?', '`', ':', ','

  	]

  	,'DELIMITERS' :[

  		'(', ')', '[', ']', '{', '}'

  	]
  	,'REGEXPS' : {
  		'constants' : {

  			'search' : '()([A-Z]\\w*)()'

  			,'class' : 'constants'

  			,'modifiers' : 'g'

  			,'execute' : 'before' 

  		}
  		,'variables' : {

  			'search' : '()([\$\@\%]+\\w+)()'

  			,'class' : 'variables'

  			,'modifiers' : 'g'

  			,'execute' : 'before' 

  		}
  		,'numbers' : {

  			'search' : '()(-?[0-9]+)()'

  			,'class' : 'numbers'

  			,'modifiers' : 'g'

  			,'execute' : 'before' 

  		}
  		,'symbols' : {

  			'search' : '()(:\\w+)()'

  			,'class' : 'symbols'

  			,'modifiers' : 'g'

  			,'execute' : 'before'

  		}
  	}

  	,'STYLES' : {

  		'COMMENTS': 'color: #AAAAAA;'

  		,'QUOTESMARKS': 'color: #660066;'

  		,'KEYWORDS' : {

  			'reserved' : 'font-weight: bold; color: #0000FF;'

  			}

  		,'OPERATORS' : 'color: #993300;'

  		,'DELIMITERS' : 'color: #993300;'

  		,'REGEXPS' : {
  			'variables' : 'color: #E0BD54;'
  			,'numbers' : 'color: green;'
  			,'constants' : 'color: #00AA00;'
  			,'symbols' : 'color: #879EFA;'
  		}	

  	}

  };