Sha256: 041aaa4394574c8fe74cca1d90ba65bc32a6b412bcfd42ad600aab22345f1159

Contents?: true

Size: 1.14 KB

Versions: 18

Compression:

Stored size: 1.14 KB

Contents

module Cucumber
  module Parser
    # TIP: When you hack on the grammar, just delete py_string.rb in this directory.
    # Also make sure you have uninstalled all cucumber gems (don't forget xxx-cucumber
    # github gems).
    #
    # Treetop will then generate the parser in-memory. When you're happy, just generate
    # the rb file with tt feature.tt
    grammar PyString
      include Common

      rule py_string
        open_py_string s:(!close_py_string .)* close_py_string {
          def at_line?(line)
            line >= open_py_string.line && line <= close_py_string.line
          end

          def build(filter=nil)
            Ast::PyString.new(open_py_string.line, close_py_string.line, s.text_value, open_py_string.indentation)
          end
        }
      end

      rule open_py_string
        indent:space* '"""' space* eol {
          def indentation
            indent.text_value.length
          end

          def line
            indent.line
          end
        }
      end

      rule close_py_string
        eol space* quotes:'"""' white {
          def line
            quotes.line
          end
        }
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 5 rubygems

Version Path
cucumber-0.6.3 lib/cucumber/parser/py_string.tt
davidtrogers-cucumber-0.6.2 lib/cucumber/parser/py_string.tt
cucumber-0.6.2 lib/cucumber/parser/py_string.tt
cucumber-0.6.1 lib/cucumber/parser/py_string.tt
cucumber-0.6.0 lib/cucumber/parser/py_string.tt
cucumber-0.5.3 lib/cucumber/parser/py_string.tt
cucumber-0.5.2 lib/cucumber/parser/py_string.tt
cucumber-0.5.1 lib/cucumber/parser/py_string.tt
cucumber-0.5.0 lib/cucumber/parser/py_string.tt
cucumber-0.4.5.rc2 lib/cucumber/parser/py_string.tt
kbaum-cucumber-0.4.5.pre lib/cucumber/parser/py_string.tt
cucumber-0.4.5.rc1 lib/cucumber/parser/py_string.tt
middleman-0.10.17 vendor/gems/gems/cucumber-0.4.4/lib/cucumber/parser/py_string.tt
middleman-0.10.16 vendor/gems/gems/cucumber-0.4.4/lib/cucumber/parser/py_string.tt
middleman-0.10.15 vendor/gems/gems/cucumber-0.4.4/lib/cucumber/parser/py_string.tt
rackjour-0.1.8 vendor/gems/gems/cucumber-0.4.4/lib/cucumber/parser/py_string.tt
middleman-0.10.14 vendor/gems/gems/cucumber-0.4.4/lib/cucumber/parser/py_string.tt
cucumber-0.4.4 lib/cucumber/parser/py_string.tt