rubyx/lib/parser/keywords.rb

15 lines
631 B
Ruby
Raw Normal View History

module Parser
module Keywords
include Parslet
rule(:keyword_if) { str('if') >> space? }
rule(:keyword_else) { str('else') >> space? }
rule(:keyword_def) { str('def') >> space? }
2014-04-28 14:46:57 +02:00
rule(:keyword_end) { str('end') >> space? }
2014-05-10 11:54:31 +02:00
rule(:keyword_true) { str('true').as(:true) >> space?}
rule(:keyword_false){ str('false').as(:false) >> space?}
rule(:keyword_nil) { str('null').as(:nil) >> space?}
2014-05-10 18:02:51 +02:00
rule(:keyword_while) { str('while').as(:while) >> space?}
rule(:keyword_do) { str('do').as(:do) >> space?}
rule(:keyword_begin) { str('begin').as(:begin) >> space?}
end
end