Sha256: f280d9dcc3ee7d73d462d7a53be69f47b25680bf0ddb5853b71ac72c88fcf313
Contents?: true
Size: 1.31 KB
Versions: 65
Compression:
Stored size: 1.31 KB
Contents
# frozen_string_literal: true class Code class Parser class If < Language def statement IfModifier end def if_class If end def whitespace Whitespace end def code Code end def whitespace? whitespace.maybe end def if_keyword str("if") end def unless_keyword str("unless") end def elsif_keyword str("elsif") end def else_keyword str("else") end def end_keyword str("end") end def root ( (if_keyword | unless_keyword).aka(:first_operator) << whitespace << statement.aka(:first_statement) << code.aka(:first_body) << ( ( elsif_keyword.aka(:operator) << whitespace << statement.aka(:statement) << code.aka(:body) ) | ( else_keyword << whitespace << (if_keyword | unless_keyword).aka(:operator) << whitespace << statement.aka(:statement) << code.aka(:body) ) | (else_keyword.aka(:operator) << code.aka(:body)) ).repeat(1).aka(:elses).maybe << end_keyword.maybe ).aka(:if) | statement end end end end
Version data entries
65 entries across 65 versions & 1 rubygems