src/less/parse.js
function getVariable() {
  const type = NodeType.VariableType;
  const token = tokens[pos];
  const line = token.ln;
  const column = token.col;
  const content = [];

  // Skip `$`.
  pos++;

  if (checkVariable(pos)) content.push(getVariable());
  else content.push(getIdent());

  return newNode(type, content, line, column);
}
function getVariable() {
  const type = NodeType.VariableType;
  const token = tokens[pos];
  const line = token.ln;
  const column = token.col;
  const content = [];

  // Skip `$`.
  pos++;

  if (checkVariable(pos)) content.push(getVariable());
  else content.push(getIdent());

  return newNode(type, content, line, column);
}
function getVariable ( ) { const type = NodeType . VariableType ; const token = tokens [ pos ] ; const line = token . ln ; const column = token . col ; const content = [ ] ; // Skip `$`. pos ++ ; if ( checkVariable ( pos ) ) content . push ( getVariable ( ) ) ; else content . push ( getIdent ( ) ) ; return newNode ( type , content , line , column ) ; }
Get node with a variable
@returns {Array} `['variable', ['ident', x]]` where `x` is
a variable name.
Get node with a variable