class Parser

Defined in:

parser.cr

Constant Summary

LINE_RE = /^\s*--\s*name:\s*([a-z\_\?\!0-9]+)(\(.*?\)|).*?$/
PARAM_RAW_RE = /\{\{\!(.*?)\}\}/
PARAM_RE = /\{\{(.*?)\}\}/

Constructors

Instance Method Summary

Constructor Detail

def self.new(lines : Array(String)) #

[View source]

Instance Method Detail

def define_method(metadata, sql) #

[View source]
def get_metadata(meta) #

[View source]
def metadata?(line) #

checks if the given line contains metadata example: -- name: get_users(name, surname)


[View source]
def parse #

[View source]
def parse_sql(sql) #

[View source]
def set_indent(sql) #

[View source]
def sql?(line) #

checks for lines that is neither comment line (starts with -- ) nor whitespace


[View source]