_nt_plugin_section

in logstash-core/lib/logstash/config/grammar.rb [376:456]


  def _nt_plugin_section
    start_index = index
    if node_cache[:plugin_section].has_key?(index)
      cached = node_cache[:plugin_section][index]
      if cached
        node_cache[:plugin_section][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
        @index = cached.interval.end
      end
      return cached
    end

    i0, s0 = index, []
    r1 = _nt_plugin_type
    s0 << r1
    if r1
      r2 = _nt_cs
      s0 << r2
      if r2
        if (match_len = has_terminal?("{", false, index))
          r3 = true
          @index += match_len
        else
          terminal_parse_failure('"{"')
          r3 = nil
        end
        s0 << r3
        if r3
          r4 = _nt_cs
          s0 << r4
          if r4
            s5, i5 = [], index
            loop do
              i6, s6 = index, []
              r7 = _nt_branch_or_plugin
              s6 << r7
              if r7
                r8 = _nt_cs
                s6 << r8
              end
              if s6.last
                r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
                r6.extend(PluginSection0)
              else
                @index = i6
                r6 = nil
              end
              if r6
                s5 << r6
              else
                break
              end
            end
            r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
            s0 << r5
            if r5
              if (match_len = has_terminal?("}", false, index))
                r9 = true
                @index += match_len
              else
                terminal_parse_failure('"}"')
                r9 = nil
              end
              s0 << r9
            end
          end
        end
      end
    end
    if s0.last
      r0 = instantiate_node(LogStash::Config::AST::PluginSection,input, i0...index, s0)
      r0.extend(PluginSection1)
    else
      @index = i0
      r0 = nil
    end

    node_cache[:plugin_section][start_index] = r0

    r0
  end