vendor/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/scss/parser.rb
# Expose for the SASS parser.
Expose for the SASS parser.
Expose for the SASS parser .
def declaration
        name_start_pos = source_position
        if (s = tok(/[:\*\.]|\#(?!\{)/))
          name = [s, str {ss}, *expr!(:interp_ident)]
        else
          return unless (name = interp_ident)
          name = Array(name)
        end
        if (comment = tok(COMMENT))
          name << comment
        end
        name_end_pos = source_position
        ss
        tok!(/:/)
        ss
        value_start_pos = source_position
        value = value!(name.first.is_a?(String) && name.first.start_with?("--"))
        value_end_pos = source_position
        ss
        require_block = tok?(/\{/)
        node = node(Sass::Tree::PropNode.new(name.flatten.compact, value, :new),
                    name_start_pos, value_end_pos)
        node.name_source_range = range(name_start_pos, name_end_pos)
        node.value_source_range = range(value_start_pos, value_end_pos)
        return node unless require_block
        nested_properties! node
      end
def declaration name_start_pos = source_position if ( s = tok ( / [: \* \. ]| \# (?! \{ ) / ) ) name = [ s , str { ss } , * expr! ( :interp_ident ) ] else return unless ( name = interp_ident ) name = Array ( name ) end if ( comment = tok ( COMMENT ) ) name << comment end name_end_pos = source_position ss tok! ( / : / ) ss value_start_pos = source_position value = value! ( name . first . is_a? ( String ) && name . first . start_with? ( "--" ) ) value_end_pos = source_position ss require_block = tok? ( / \{ / ) node = node ( Sass :: Tree :: PropNode . new ( name . flatten . compact , value , :new ) , name_start_pos , value_end_pos ) node . name_source_range = range ( name_start_pos , name_end_pos ) node . value_source_range = range ( value_start_pos , value_end_pos ) return node unless require_block nested_properties! node end
Expose for the SASS parser.
Expose for the SASS parser .
# This allows the "*prop: val", ":prop: val", "#prop: val", and ".prop: # val" hacks.