You are here

function lessc::tag in Less CSS Preprocessor 6.3

Same name and namespace in other branches
  1. 6 lessc.inc.php \lessc::tag()
2 calls to lessc::tag()
lessc::chunk in lessphp/lessc.inc.php
lessc::tags in lessphp/lessc.inc.php

File

lessphp/lessc.inc.php, line 611

Class

lessc

Code

function tag(&$tag, $simple = false) {
  if ($simple) {
    $chars = '^,:;{}\\][>\\(\\) ';
  }
  else {
    $chars = '^,;{}[';
  }
  $tag = '';
  if ($this
    ->tagBracket($first)) {
    $tag .= $first;
  }
  while ($this
    ->match('([' . $chars . '0-9][' . $chars . ']*)', $m)) {
    $tag .= $m[1];
    if ($simple) {
      break;
    }
    if ($this
      ->tagBracket($brack)) {
      $tag .= $brack;
    }
  }
  $tag = trim($tag);
  if ($tag == '') {
    return false;
  }
  return true;
}