Sha256: 553d1357a02a7a31c854a0f8f94b95c771ba264747de4acb013c366a51080b51

Contents?: true

Size: 1.11 KB

Versions: 1

Compression:

Stored size: 1.11 KB

Contents

// Koala - Grammars - Ruby - Copyright TJ Holowaychuk <tj@vision-media.ca> (MIT Licensed)

/**
 * Module dependencies.
 */
 
// --- Grammar

Koala.lexers['rb'] = new Koala.Lexer({
  'this': 'self',
  'number float': /^(\d+\.\d+)/,
  'number integer': /^(\d+)/,
  'comment': /^(#[^\n]*)/,
  'keyword': /^(return|defined|alias|and|begin|BEGIN|break|case|class|def|do|else|if|END|end|ensure|false|true|for|in|module|next|nil|not|or|redo|rescue|retry|return|super|then|when|true|undef|unless|until|while|yield)\b/,
  'string': /^("(.*?)"|'(.*?)')/,
  'symbol string': /^(\:(\w+|".*?"|'.*?'))/,
  'class': /^((\:\:)?[A-Z]\w*)/,
  'global variable': /^(\$[!@&`'+~=\/\w\\,;<>*$?:"\-]+)/,
  'class variable': /^(@@\w+)/,
  'inst variable': /^(@\w+)/,
  'variable': /^([a-z_]\w*)/,
  'regexp': /^(\/(.*?)\/[a-z]*)/,
  'multiline comment': function(str){
    var buf = '=begin'
    if (str.indexOf('=begin') !== 0)
      return
    str = str.substr(6)
    while (true)
      if (str.indexOf('=end') === 0)
        break
      else
        buf += str.charAt(0),
        str = str.substr(1)
    str = str.substr(4)
    return buf + '=end'
  }
});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sc-docs-0.0.3 vendor/jsdoc/app/plugins/smartdown/koala/grammars/ruby.js