Sha256: f7218628b28998064f1ab98813e12aa0d13cee32e8528962f1ba843ee7594eae

Contents?: true

Size: 418 Bytes

Versions: 2

Compression:

Stored size: 418 Bytes

Contents

module Basic101

  class Parser < Parslet::Parser

    rule(:define_function_statement) do
      str('DEF').as(:def) >>
        space? >> user_defined_function_identifier.as(:identifier) >>
        (space? >> str('(') >>
         space? >> scalar_reference_list >>
         space? >> str(')')
         ).as(:parameters) >>
        space? >> str('=') >>
        space? >> expression.as(:expression)
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
basic101-0.4.0 lib/basic101/parser/define_function_statement.rb
basic101-0.2.0 lib/basic101/parser/define_function_statement.rb