code: function parseVariableDeclarations(string) {
    // Do not parse empty files. Otherwise gonzales.parse will fail
    if (!string) {
      return [];
    }
  
    var out = [],
        ast = gonzales.parse(string, {
          syntax: syntax
        }),
        visitor = {
          // Visitor for SASS, SCSS and plain CSS syntaxes
          test: function(name, nodes) {
            if (name !== 'declaration') {
              return false;
            }
  
            if (
                nodes.content[0] &&
                nodes.content[0].content &&
                nodes.content[0].content[0] &&
                nodes.content[0].content[0].type &&
                nodes.content[0].content[0].type === 'variable'
              ) {
              return true;
            }
  
          },
          process: function(nodes) {
            var varName = nodes.content[0].content[0].content[0].content;
  
            // trim the spaces
            var content = nodes.content.filter(function(item) {
              return (item.type !== 'space');
            });
  
            if (content[2] && content[2].type && content[2].type === 'value') {
              out.push({
                name: varName,
                value: content[2].toString(syntax),
                line: content[2].start.line
              });
            }
          }
        };
  
    traverser.traverse(ast, visitor);
    return out;
  }
docs: Parse Style variables to object