Sha256: c270ac935408cd8b18684c5cf88572bdc9c41f48ab0a87f60b7a71f93b36f358

Contents?: true

Size: 786 Bytes

Versions: 27

Compression:

Stored size: 786 Bytes

Contents

# @Opulent
module Opulent
  # @Parser
  class Parser
    # Check if we match an compile time filter
    #
    # :filter
    #
    # @param parent [Node] Parent node to which we append the element
    #
    def filter(parent, indent)
      return unless (filter_name = accept :filter)

      # Get element attributes
      atts = attributes(shorthand_attributes) || {}

      # Accept inline text or multiline text feed as first child
      error :fiter unless accept(:line_feed).strip.empty?

      # Get everything under the filter and set it as the node value
      # and create a new node and set its extension
      parent[@children] << [
        :filter,
        filter_name[1..-1].to_sym,
        atts,
        get_indented_lines(indent),
        indent
      ]
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
opulent-1.8.5 lib/opulent/parser/filter.rb
opulent-1.8.4 lib/opulent/parser/filter.rb
opulent-1.8.3 lib/opulent/parser/filter.rb
opulent-1.8.2 lib/opulent/parser/filter.rb
opulent-1.8.1 lib/opulent/parser/filter.rb
opulent-1.8.0 lib/opulent/parser/filter.rb
opulent-1.7.11 lib/opulent/parser/filter.rb
opulent-1.7.10 lib/opulent/parser/filter.rb
opulent-1.7.9 lib/opulent/parser/filter.rb
opulent-1.7.8 lib/opulent/parser/filter.rb
opulent-1.7.7 lib/opulent/parser/filter.rb
opulent-1.7.6 lib/opulent/parser/filter.rb
opulent-1.7.5 lib/opulent/parser/filter.rb
opulent-1.7.4 lib/opulent/parser/filter.rb
opulent-1.7.3 lib/opulent/parser/filter.rb
opulent-1.7.2 lib/opulent/parser/filter.rb
opulent-1.7.1 lib/opulent/parser/filter.rb
opulent-1.7.0 lib/opulent/parser/filter.rb
opulent-1.6.9 lib/opulent/parser/filter.rb
opulent-1.6.8 lib/opulent/parser/filter.rb