Sha256: bd647b74d701d01a8e99357b6500eebe2ff8951b6475f52ce98b98106e96b836
Contents?: true
Size: 1.27 KB
Versions: 1
Compression:
Stored size: 1.27 KB
Contents
require 'parslet' module Shift module Parser include Parslet rule(:url_method) { get_keyword.as(:url_method) | post_keyword.as(:url_method) } rule(:url_variable) { colon >> (identifier.as(:url_variable) | keyword.as(:url_variable)) } rule(:url_token) { (url_variable | (identifier.as(:url_token) | keyword.as(:url_variable))) >> fwd_slash.maybe } rule(:url) { fwd_slash >> url_token.repeat(0) } rule(:model_definition_statement) { model_keyword >> space >> identifier.as(:model_name) } rule(:model_attribute_type) { string_keyword | integer_keyword } rule(:model_attribute_definition_statement) { identifier.as(:attribute_name) >> space >> model_attribute_type.as(:attribute_type) } rule(:model_definition) { model_definition_statement.as(:model_definition_statement) | model_attribute_definition_statement.as(:model_attribute_definition_statement) } rule(:write_statement) { write_keyword >> space >> string_valued_expression.as(:write_statement_param) } rule(:write_file_statement) { write_file_keyword >> space >> string_valued_expression.as(:file_name) >> (space? >> comma >> space? >> variables).as(:template_values).repeat(0) } rule(:redirect_statement) { redirect_keyword >> space >> string_valued_expression.as(:redirect_statement_param) } end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
shift-lang-0.1.2 | lib/shift-lang/parser/routing_expression_parser.rb |