Expands a unique rule symbol by evaluating it and checking that it hasn't
 previously been selected.

 @param [Symbol] symbol
342197
def unique_expansion(symbol)
      pending = true
      uniques[symbol] = [] if uniques[symbol].nil?

      while pending
        if uniques[symbol].size == expand(symbol).size
          uniques[symbol] = []
          pending = false
        end

        result = expand(symbol).evaluate(@options)

        unless uniques[symbol].include?(result)
          uniques[symbol] << result
          pending = false
        end
      end

      result
    end
546222
private void expandAffix(String pattern, String pluralCount, StringBuffer buffer) {
        buffer.setLength(0);
        for (int i = 0; i < pattern.length();) {
            char c = pattern.charAt(i++);
            if (c == QUOTE) {
                for (;;) {
                    int j = pattern.indexOf(QUOTE, i);
                    if (j == i) {
                        buffer.append(QUOTE);
                        i = j + 1;
                        break;
                    } else if (j > i) {
                        buffer.append(pattern.substring(i, j));
                        i = j + 1;
                        if (i < pattern.length() && pattern.charAt(i) == QUOTE) {
                            buffer.append(QUOTE);
                            ++i;
                            // loop again
                        } else {
                            break;
                        }
                    } else {
                        // Unterminated quote; should be caught by apply
                        // pattern.
                        throw new RuntimeException();
                    }
                }
                continue;
            }

            switch (c) {
            case CURRENCY_SIGN:
                // As of ICU 2.2 we use the currency object, and ignore the currency
                // symbols in the DFS, unless we have a null currency object. This occurs
                // if resurrecting a pre-2.2 object or if the user sets a custom DFS.
                boolean intl = i < pattern.length() && pattern.charAt(i) == CURRENCY_SIGN;
                boolean plural = false;
                if (intl) {
                    ++i;
                    if (i < pattern.length() && pattern.charAt(i) == CURRENCY_SIGN) {
                        plural = true;
                        intl = false;
                        ++i;
                    }
                }
                String s = null;
                Currency currency = getCurrency();
                if (currency != null) {
                    // plural name is only needed when pluralCount != null, which means
                    // when formatting currency plural names.  For other cases,
                    // pluralCount == null, and plural names are not needed.
                    if (plural && pluralCount != null) {
                        s = currency.getName(symbols.getULocale(), Currency.PLURAL_LONG_NAME,
                                             pluralCount, null);
                    } else if (!intl) {
                        s = currency.getName(symbols.getULocale(), Currency.SYMBOL_NAME, null);
                    } else {
                        s = currency.getCurrencyCode();
                    }
                } else {
                    s = intl ? symbols.getInternationalCurrencySymbol() :
                        symbols.getCurrencySymbol();
                }
                // Here is where FieldPosition could be set for CURRENCY PLURAL.
                buffer.append(s);
                break;
            case PATTERN_PERCENT:
                buffer.append(symbols.getPercentString());
                break;
            case PATTERN_PER_MILLE:
                buffer.append(symbols.getPerMillString());
                break;
            case PATTERN_MINUS_SIGN:
                buffer.append(symbols.getMinusSignString());
                break;
            default:
                buffer.append(c);
                break;
            }
        }
    }
766659
def add_rules(node)
      @rule = Sass::Util.strip_string_array(
        Sass::Util.merge_adjacent_strings(@rule + ["\n"] + node.rule))
      try_to_parse_non_interpolated_rules
    end
508043
function addSelector(prefix, selector) {
        if (selector !== undefined) {
            selectors[prefix] = selector;
        }
        return selectors[prefix];
    }
923989
def []=(key, new_value)
      key.kind_of?(Symbol) ? self[key.to_s]=new_value : super(key, new_value)
    end
675285
private static Set<Symbol> extractUniqueInternal(RowExpression expression)
    {
        if (isExpression(expression)) {
            return extractUnique(castToExpression(expression));
        }
        return extractUnique(expression);
    }
1255801
def delete(self, symbol):
        
        if isinstance(symbol, (str, unicode)):
            sym = self.get(symbol)
        elif isinstance(symbol, Symbol):
            sym = symbol
        else:
            raise Exception("Invalid symbol {}".format((repr(symbol))))

        # Has to handle the case where the table would exist already
        # and where it wouldn't.
        try:
            sym.datatable = Table(sym.name, Base.metadata, autoload=True)
            sym.datatable.drop(self.eng, checkfirst=True)
        except NoSuchTableError:
            print "No worries, {} never existed to begin with.".format(sym.name)

        self.ses.delete(sym)
        self.ses.commit()
1018255
def method(self, symbol_name):
        

        s = self.symbol(symbol_name)

        def bind(fn):
            setattr(s, fn.__name__, fn)
        return bind
998225
function checkNewlineBefore({
  string,
  globalIndex,
  startIndex,
  endIndex,
  node,
  result
}) {
  const symbol = string.substring(startIndex, endIndex + 1);
  let newLineBefore = false;

  let index = endIndex + 1;

  while (index && isWhitespace(string[index])) {
    if (string[index] === "\n") {
      newLineBefore = true;
      break;
    }

    index++;
  }

  if (newLineBefore) {
    utils.report({
      ruleName,
      result,
      node,
      message: messages.rejected(symbol),
      index: endIndex + globalIndex
    });
  }
}
3135
def expansion_attribute(styles={})
      return nil if styles.nil?
      return nil if styles[:expansion].nil?
      value = styles[:expansion]
      return 0 if [0, :default].include?(value)
      return nil unless value.respond_to?(:to_f)
      return value.to_f
    end
1174409
public void consumeExpectedSymbol(String symbol) {
        if (current().matches(Token.TokenType.SYMBOL, symbol)) {
            consume();
        } else {
            addError(current(), "Unexpected token: '%s'. Expected: '%s'", current().getSource(), symbol);
        }
    }
1326612
def trigger?(message)
      if @prefix.is_a? String
        standard_prefix_trigger(message.content, @prefix)
      elsif @prefix.is_a? Array
        @prefix.map { |e| standard_prefix_trigger(message.content, e) }.reduce { |m, e| m || e }
      elsif @prefix.respond_to? :call
        @prefix.call(message)
      end
    end
267622
def expand_rule(self, rule):
        ""
        init_ptrs = set()
        def _expand_rule(rule):
            assert not rule.is_term, rule

            for r in self.rules_by_origin[rule]:
                init_ptr = RulePtr(r, 0)
                init_ptrs.add(init_ptr)

                if r.expansion: # if not empty rule
                    new_r = init_ptr.next
                    if not new_r.is_term:
                        yield new_r

        for _ in bfs([rule], _expand_rule):
            pass

        return fzset(init_ptrs)
800262
def modify_symbol(sym: ast.Symbol, scope: ast.InstanceClass) -> None:
    

    # We assume that we do not screw up the order of applying modifications
    # when "moving up" with the scope.
    apply_args = [x for x in sym.class_modification.arguments
                  if x.scope is None or x.scope.full_reference().to_tuple() == scope.full_reference().to_tuple()]
    skip_args = [x for x in sym.class_modification.arguments
                 if x.scope is not None and x.scope.full_reference().to_tuple() != scope.full_reference().to_tuple()]

    for class_mod_argument in apply_args:
        argument = class_mod_argument.value

        assert isinstance(argument, ast.ElementModification), \
            "Found redeclaration modification which should already have been handled."

        # TODO: Strip all non-symbol stuff.
        if argument.component.name not in ast.Symbol.ATTRIBUTES:
            raise Exception("Trying to set unknown symbol property {}".format(argument.component.name))

        setattr(sym, argument.component.name, argument.modifications[0])

    sym.class_modification.arguments = skip_args
533162
function(rule, message) {
      if (is_object(rule)) {
        _messages = extend({}, _messages, rule);
      } else if (is_string(rule)) {
        _messages[rule] = message;
      }
    }
403852
public void updateRectangle(Point a, Point b, Symbol symbol) {
        int xfrom = (a.x < b.x) ? a.x : b.x;
        int xto = (a.x > b.x) ? a.x : b.x;
        int yfrom = (a.y < b.y) ? a.y : b.y;
        int yto = (a.y > b.y) ? a.y : b.y;
        for (int x = xfrom; x <= xto; x++) {
            for (int y = yfrom; y <= yto; y++) {
                updateLocation(new Point(x, y), symbol);
            }
        }
    }
1067591
def modify(name, old_value, new_value)
      @attributes[name] = new_value
      if @modifications && (old_value != new_value)
        original = @modifications[name].first if @modifications[name]
        @modifications[name] = [ (original || old_value), new_value ]
      end
    end