def node(parent, indent = nil)
      return unless (name = lookahead(:node_lookahead) ||
                            lookahead(:shorthand_lookahead))

      # Skip node if it's a reserved keyword
      return nil if KEYWORDS.include? name[0].to_sym

      # Accept either explicit node_name or implicit :div node_name
      # with shorthand attributes
      if (node_name = accept :node)
        node_name = node_name.to_sym
        shorthand = shorthand_attributes
      elsif (shorthand = shorthand_attributes)
        node_name = :div
      end

      # Node creation options
      options = {}

      # Get leading whitespace
      options[:recursive] = accept(:recursive)

      # Get leading whitespace
      options[:leading_whitespace] = accept_stripped(:leading_whitespace)

      # Get trailing whitespace
      options[:trailing_whitespace] = accept_stripped(:trailing_whitespace)

      # Get wrapped node attributes
      atts = attributes(shorthand) || {}

      # Inherit attributes from definition
      options[:extension] = extend_attributes

      # Get unwrapped node attributes
      options[:attributes] = attributes_assignments atts, false

      # Create node
      current_node = [:node, node_name, options, [], indent]

      # Check for self enclosing tags and definitions
      def_check = !@definitions.keys.include?(node_name) &&
                  Settings::SELF_ENCLOSING.include?(node_name)

      # Check if the node is explicitly self enclosing
      if (close = accept_stripped :self_enclosing) || def_check
        current_node[@options][:self_enclosing] = true

        unless close.nil? || close.strip.empty?
          undo close
          Logger.error :parse, @code, @i, @j, :self_enclosing
        end
      end

      # Check whether we have explicit inline elements and add them
      # with increased base indentation
      if accept :inline_child
        # Inline node element
        Logger.error :parse,
                     @code,
                     @i,
                     @j,
                     :inline_child unless node current_node, indent
      elsif comment current_node, indent
        # Accept same line comments
      else
        # Accept inline text element
        text current_node, indent, false
      end

      # Add the current node to the root
      root current_node, indent

      # Add the parsed node to the parent
      parent[@children] << current_node
    end
def node(parent, indent = nil)
      return unless (name = lookahead(:node_lookahead) ||
                            lookahead(:shorthand_lookahead))

      # Skip node if it's a reserved keyword
      return nil if KEYWORDS.include? name[0].to_sym

      # Accept either explicit node_name or implicit :div node_name
      # with shorthand attributes
      if (node_name = accept :node)
        node_name = node_name.to_sym
        shorthand = shorthand_attributes
      elsif (shorthand = shorthand_attributes)
        node_name = :div
      end

      # Node creation options
      options = {}

      # Get leading whitespace
      options[:recursive] = accept(:recursive)

      # Get leading whitespace
      options[:leading_whitespace] = accept_stripped(:leading_whitespace)

      # Get trailing whitespace
      options[:trailing_whitespace] = accept_stripped(:trailing_whitespace)

      # Get wrapped node attributes
      atts = attributes(shorthand) || {}

      # Inherit attributes from definition
      options[:extension] = extend_attributes

      # Get unwrapped node attributes
      options[:attributes] = attributes_assignments atts, false

      # Create node
      current_node = [:node, node_name, options, [], indent]

      # Check for self enclosing tags and definitions
      def_check = !@definitions.keys.include?(node_name) &&
                  Settings::SELF_ENCLOSING.include?(node_name)

      # Check if the node is explicitly self enclosing
      if (close = accept_stripped :self_enclosing) || def_check
        current_node[@options][:self_enclosing] = true

        unless close.nil? || close.strip.empty?
          undo close
          Logger.error :parse, @code, @i, @j, :self_enclosing
        end
      end

      # Check whether we have explicit inline elements and add them
      # with increased base indentation
      if accept :inline_child
        # Inline node element
        Logger.error :parse,
                     @code,
                     @i,
                     @j,
                     :inline_child unless node current_node, indent
      elsif comment current_node, indent
        # Accept same line comments
      else
        # Accept inline text element
        text current_node, indent, false
      end

      # Add the current node to the root
      root current_node, indent

      # Add the parsed node to the parent
      parent[@children] << current_node
    end
Check if we match an node node with its attributes and possibly
 inline text

 node [ attributes ] Inline text

 @param parent [Node] Parent node to which we append the node