Sha256: 34bcdc46e828ce9f0c4629dae187416ca33e5910b20920c0d7e33fe195579871

Contents?: true

Size: 1.37 KB

Versions: 3

Compression:

Stored size: 1.37 KB

Contents

require 'parslet'

module Shift
	module Parser
		include Parslet

		rule(:read_keyword) { str('read') }

		rule(:all_keyword) { str('all') }

		rule(:new_keyword) { str('new') }

		rule(:find_keyword) { str('find') }

		rule(:where_keyword) { str('where') }

		rule(:find_by_id_keyword) { str('find_by_id') }

		rule(:update_keyword) { str('update') }

		rule(:delete_keyword) { str('delete') }

		rule(:write_keyword) { str('write') }

		rule(:write_file_keyword) { str('write_file') }

		rule(:redirect_keyword) { str('redirect') }

		rule(:if_keyword) { str('if') }

		rule(:else_keyword) { str('else') }

		rule(:for_keyword) { str('for') }

		rule(:in_keyword) { str('in') }

		rule(:while_keyword) { str('while') }

		rule(:get_keyword) { str('get') }

		rule(:post_keyword) { str('post') }

		rule(:model_keyword) { str('model') }

		rule(:string_keyword) { str('string') }

		rule(:integer_keyword) { str('integer') }

		rule(:integer_cast_keyword) { str('int') }
	
		rule(:keyword) { 
						read_keyword | write_keyword | write_file_keyword | redirect_keyword |
						all_keyword | new_keyword | find_keyword | where_keyword | find_by_id_keyword | update_keyword | delete_keyword | 
						if_keyword | else_keyword | for_keyword | in_keyword | while_keyword |
						get_keyword | post_keyword |
						model_keyword | string_keyword | integer_keyword | 
						integer_cast_keyword 
					}

	end
end 

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
shift-lang-0.1.4 lib/shift-lang/parser/keyword_parser.rb
shift-lang-0.1.3 lib/shift-lang/parser/keyword_parser.rb
shift-lang-0.1.2 lib/shift-lang/parser/keyword_parser.rb