Sha256: 495ad9a41b29a0d84dabd0ecf124af02b028ccb2cec9e1a612d8dcf1ebcb368e

Contents?: true

Size: 453 Bytes

Versions: 3

Compression:

Stored size: 453 Bytes

Contents

# frozen_string_literal: true

module Basic101

  class Parser < Parslet::Parser

    rule(:input_statement) do
      str('INPUT').as(:input) >>
        (space? >> quoted_string.as(:prompt) >>
         space? >> prompt_delimeter.as(:prompt_delimeter)).maybe >>
        space? >> reference_list.as(:references)
    end

    rule(:prompt_delimeter) do
      str(';').as(:prompt_delimeter) |
        str(',').as(:null_prompt_delimeter)
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
basic101-1.0.2 lib/basic101/parser/input_statement.rb
basic101-1.0.1 lib/basic101/parser/input_statement.rb
basic101-1.0.0 lib/basic101/parser/input_statement.rb