yap-shell-parser 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/yap/shell/parser/grammar.y +0 -4
- data/lib/yap/shell/parser/version.rb +1 -1
- data/lib/yap/shell/parser.rb +4 -0
- data/lib/yap/shell/parser_impl.rb +1 -5
- data/spec/yap/shell/parser_spec.rb +10 -0
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: c7f17d75ea90aa83388bee1083d1247d20261da3
         | 
| 4 | 
            +
              data.tar.gz: 0cf0a96f80e36feb9fbd1ac91251cba524820bfe
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 4b16e7e2c7e1e88280a1ca976729fb36639135a42f586bb044181c957190df62097ef199961841b66e13bd4f45194e15b6c5d2fb8529633b68d15a6c57295f00
         | 
| 7 | 
            +
              data.tar.gz: 696fc416a943bb644176dec23a67a1aa4723c70ae370b69e452f54d041c3215880244c0c6723e32cad41a8a77754c8af514ee7c528492b15c9b76cff7c2a68af
         | 
| @@ -100,10 +100,6 @@ end | |
| 100 100 | 
             
            ---- inner
         | 
| 101 101 | 
             
              include Yap::Shell::Parser::Nodes
         | 
| 102 102 |  | 
| 103 | 
            -
              def each_command_substitution_for(input, &blk)
         | 
| 104 | 
            -
                Yap::Shell::Parser::Lexer.new.each_command_substitution_for(input, &blk)
         | 
| 105 | 
            -
              end
         | 
| 106 | 
            -
             | 
| 107 103 | 
             
            #=end
         | 
| 108 104 | 
             
              def parse(str)
         | 
| 109 105 | 
             
                @yydebug = true
         | 
    
        data/lib/yap/shell/parser.rb
    CHANGED
    
    | @@ -10,6 +10,10 @@ module Yap | |
| 10 10 | 
             
                  rescue Racc::ParseError => ex
         | 
| 11 11 | 
             
                    raise ParseError, "Message: #{ex.message}\nInput: #{input}"
         | 
| 12 12 | 
             
                  end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                  def self.each_command_substitution_for(input, &blk)
         | 
| 15 | 
            +
                    Yap::Shell::Parser::Lexer.new.each_command_substitution_for(input, &blk)
         | 
| 16 | 
            +
                  end
         | 
| 13 17 | 
             
                end
         | 
| 14 18 | 
             
              end
         | 
| 15 19 | 
             
            end
         | 
| @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            #
         | 
| 2 2 | 
             
            # DO NOT MODIFY!!!!
         | 
| 3 | 
            -
            # This file is automatically generated by Racc 1.4. | 
| 3 | 
            +
            # This file is automatically generated by Racc 1.4.12
         | 
| 4 4 | 
             
            # from Racc grammer file "".
         | 
| 5 5 | 
             
            #
         | 
| 6 6 |  | 
| @@ -24,10 +24,6 @@ module Yap | |
| 24 24 | 
             
            module_eval(<<'...end grammar.y/module_eval...', 'grammar.y', 101)
         | 
| 25 25 | 
             
              include Yap::Shell::Parser::Nodes
         | 
| 26 26 |  | 
| 27 | 
            -
              def each_command_substitution_for(input, &blk)
         | 
| 28 | 
            -
                Yap::Shell::Parser::Lexer.new.each_command_substitution_for(input, &blk)
         | 
| 29 | 
            -
              end
         | 
| 30 | 
            -
             | 
| 31 27 | 
             
            #=end
         | 
| 32 28 | 
             
              def parse(str)
         | 
| 33 29 | 
             
                @yydebug = true
         | 
| @@ -23,6 +23,16 @@ describe Yap::Shell::Parser do | |
| 23 23 | 
             
                end
         | 
| 24 24 | 
             
              end
         | 
| 25 25 |  | 
| 26 | 
            +
              describe '.each_command_substitution_for' do
         | 
| 27 | 
            +
                let(:str){ "echo `echo hi`" }
         | 
| 28 | 
            +
             | 
| 29 | 
            +
                it "yields the command substitution string" do
         | 
| 30 | 
            +
                  expect { |b|
         | 
| 31 | 
            +
                    parser.each_command_substitution_for(str, &b)
         | 
| 32 | 
            +
                  }.to yield_with_args OpenStruct.new(str:"echo hi", position:5..14)
         | 
| 33 | 
            +
                end
         | 
| 34 | 
            +
              end
         | 
| 35 | 
            +
             | 
| 26 36 | 
             
              it_parses "ls"
         | 
| 27 37 | 
             
              it_parses "echo foo"
         | 
| 28 38 | 
             
              it_parses "echo foo ; echo bar baz yep"
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: yap-shell-parser
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.2. | 
| 4 | 
            +
              version: 0.2.1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Zach Dennis
         | 
| @@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 113 113 | 
             
                  version: '0'
         | 
| 114 114 | 
             
            requirements: []
         | 
| 115 115 | 
             
            rubyforge_project: 
         | 
| 116 | 
            -
            rubygems_version: 2.4. | 
| 116 | 
            +
            rubygems_version: 2.4.3
         | 
| 117 117 | 
             
            signing_key: 
         | 
| 118 118 | 
             
            specification_version: 4
         | 
| 119 119 | 
             
            summary: The parser for the yap shell
         |