src/less/parse.js
function getUri() {
  const startPos = pos;
  const uriExcluding = {};
  let uri;
  let token;
  let l;
  let raw;

  pos += 2;

  uriExcluding[TokenType.Space] = 1;
  uriExcluding[TokenType.Tab] = 1;
  uriExcluding[TokenType.Newline] = 1;
  uriExcluding[TokenType.LeftParenthesis] = 1;
  uriExcluding[TokenType.RightParenthesis] = 1;

  if (checkUri1(pos)) {
    uri = []
        .concat(getSC())
        .concat([getString()])
        .concat(getSC());
  } else {
    uri = getSC();
    l = checkExcluding(uriExcluding, pos);
    token = tokens[pos];
    raw = newNode(NodeType.RawType, joinValues(pos, pos + l), token.ln,
        token.col);

    uri.push(raw);

    pos += l + 1;

    uri = uri.concat(getSC());
  }

  token = tokens[startPos];
  const line = token.ln;
  const column = token.col;
  const end = getLastPosition(uri, line, column, 1);
  pos++;

  return newNode(NodeType.UriType, uri, line, column, end);
}
function getUri() {
  const startPos = pos;
  const uriExcluding = {};
  let uri;
  let token;
  let l;
  let raw;

  pos += 2;

  uriExcluding[TokenType.Space] = 1;
  uriExcluding[TokenType.Tab] = 1;
  uriExcluding[TokenType.Newline] = 1;
  uriExcluding[TokenType.LeftParenthesis] = 1;
  uriExcluding[TokenType.RightParenthesis] = 1;

  if (checkUri1(pos)) {
    uri = []
        .concat(getSC())
        .concat([getString()])
        .concat(getSC());
  } else {
    uri = getSC();
    l = checkExcluding(uriExcluding, pos);
    token = tokens[pos];
    raw = newNode(NodeType.RawType, joinValues(pos, pos + l), token.ln,
        token.col);

    uri.push(raw);

    pos += l + 1;

    uri = uri.concat(getSC());
  }

  token = tokens[startPos];
  const line = token.ln;
  const column = token.col;
  const end = getLastPosition(uri, line, column, 1);
  pos++;

  return newNode(NodeType.UriType, uri, line, column, end);
}
function getUri ( ) { const startPos = pos ; const uriExcluding = { } ; let uri ; let token ; let l ; let raw ; pos += 2 ; uriExcluding [ TokenType . Space ] = 1 ; uriExcluding [ TokenType . Tab ] = 1 ; uriExcluding [ TokenType . Newline ] = 1 ; uriExcluding [ TokenType . LeftParenthesis ] = 1 ; uriExcluding [ TokenType . RightParenthesis ] = 1 ; if ( checkUri1 ( pos ) ) { uri = [ ] . concat ( getSC ( ) ) . concat ( [ getString ( ) ] ) . concat ( getSC ( ) ) ; } else { uri = getSC ( ) ; l = checkExcluding ( uriExcluding , pos ) ; token = tokens [ pos ] ; raw = newNode ( NodeType . RawType , joinValues ( pos , pos + l ) , token . ln , token . col ) ; uri . push ( raw ) ; pos += l + 1 ; uri = uri . concat ( getSC ( ) ) ; } token = tokens [ startPos ] ; const line = token . ln ; const column = token . col ; const end = getLastPosition ( uri , line , column , 1 ) ; pos ++ ; return newNode ( NodeType . UriType , uri , line , column , end ) ; }
Get node with URI
@returns {Array} `['uri', x]` where `x` is URI's nodes (without `url`
and braces, e.g. `['string', ''/css/styles.css'']`).
Get node with URI