Class: Syntax::SQLite

### Home Classes Methods

### In Files

- lib/syntax/lang/sqlite.rb

### Parent

Syntax::Tokenizer

### Methods

- ::add_function
- #step

### Class/Module Index

Quicksearch

- Syntax
- Syntax::AnsiC
- Syntax::CSS21
- Syntax::Convertors
- Syntax::Convertors::Abstract
- Syntax::Convertors::HTML
- Syntax::Default
- Syntax::Fortran
- Syntax::Javascript
- Syntax::Ruby
- Syntax::SQLite
- Syntax::Token
- Syntax::Tokenizer
- Syntax::Version
- Syntax::XML
- Syntax::YAML

No matching classes.

# Syntax::SQLite

### Constants

SQLite_DATATYPES
SQLite_KEYWORDS
SQLite_OPERATORS
SQLite_PREDEFINED_FUNCTIONS

### Public Class Methods

add_function(name) click to toggle source

    # File lib/syntax/lang/sqlite.rb, line 7
    def self.add_function(name)
      SQLite_PREDEFINED_FUNCTIONS << name
    end

### Public Instance Methods

step() click to toggle source

    # File lib/syntax/lang/sqlite.rb, line 45
    def step
      case
      when scan(/\s+/)
        start_group :normal, matched
      when scan(%{ "(?: \\. | \\" | [^"\n])*" })
        start_group :string, matched
      when scan(%{ '(?: \\. | \\' | [^'\n])*' } )
        start_group :string, matched
      when (scan(/[a-z_][a-z_\d]+/) or scan(/[<>\|\*%&!=]+/))
        m = matched.downcase
        if SQLite_PREDEFINED_FUNCTIONS.include?( m )
          start_group :function, matched
        elsif SQLite_KEYWORDS.include?( m )
          start_group :keyword, matched
        elsif SQLite_DATATYPES.include?( m )
          start_group :datatype, matched
        elsif SQLite_OPERATORS.include?( m )
          start_group :operator, matched
        else
          start_group :ident, matched
        end
      when scan(/--.*$/)
        start_group :comment, matched
      else
        start_group :other, scan(/./)
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.