If the final text is of the form "$f:x" or "$v:y" will lookup the
 x field or the y variable. If the lookup is successful (not nil) will
 return the value, not the text (the value.to_s).
485140
def literal_sub(s, fexp, wi)

      case s
        when /^\$(?:variable|var|v):([^{}\s\$]+)$/
          fexp.lookup_variable($~[1])
        when /^\$([^{}:\s\$]+)$/, /^\$(?:field|fld|f):([^{}\s\$]+)$/
          Ruote.lookup(wi['fields'], $~[1])
        else
          s
      end
    end
1329591
public static boolean isVarValue( Object val)
    {
    return
      val == null
      || !val.getClass().equals( String.class)
      || varValueRegex_.matcher( val.toString()).matches();
    }
424079
def meaningful_value(self, val, undefined):
        
        if isinstance(val, fields.files.FieldFile):
            return val.name and not (
                isinstance(undefined, fields.files.FieldFile) and val == undefined)
        return val is not None and val != undefined
656853
def _get_value(self, variable):
        """"""
        return swiglpk.glp_mip_col_val(
            self._problem._p, self._problem._variables[variable])
924195
function(value, text) {
      text = (typeof text == 'string')
        ? text.toLowerCase()
        : text
      ;
      value = (typeof value == 'string')
        ? value.toLowerCase()
        : value
      ;
      return (value == text);
    }
1363198
def complete_variable(text):
    ''''''
    if text == '':
        return list(rline_mpstate.status.msgs.keys())

    if text.endswith(":2"):
        suffix = ":2"
        text = text[:-2]
    else:
        suffix = ''

    try:
        if mavutil.evaluate_expression(text, rline_mpstate.status.msgs) is not None:
            return [text+suffix]
    except Exception as ex:
        pass

    try:
        m1 = re.match("^(.*?)([A-Z0-9][A-Z0-9_]*)[.]([A-Za-z0-9_]*)$", text)
    except Exception as ex:
        return []
    if m1 is not None:
        prefix = m1.group(1)
        mtype = m1.group(2)
        fname = m1.group(3)
        if mtype in rline_mpstate.status.msgs:
            ret = []
            for f in rline_mpstate.status.msgs[mtype].get_fieldnames():
                if f.startswith(fname):
                    ret.append(prefix + mtype + '.' + f + suffix)
            return ret
        return []
    try:
        m2 = re.match("^(.*?)([A-Z0-9][A-Z0-9_]*)$", text)
    except Exception as ex:
        return []
    prefix = m2.group(1)
    mtype = m2.group(2)
    ret = []
    for k in list(rline_mpstate.status.msgs.keys()):
        if k.startswith(mtype):
            ret.append(prefix + k + suffix)
    return ret
826487
private static String resolveVariableExpression(final String value, final int last,
      final JexlEngine jexl) {
    final int lastIndex = value.lastIndexOf("$(", last);
    if (lastIndex == -1) {
      return value;
    }

    // Want to check that everything is well formed, and that
    // we properly capture $( ...(...)...).
    int bracketCount = 0;
    int nextClosed = lastIndex + 2;
    for (; nextClosed < value.length(); ++nextClosed) {
      if (value.charAt(nextClosed) == '(') {
        bracketCount++;
      } else if (value.charAt(nextClosed) == ')') {
        bracketCount--;
        if (bracketCount == -1) {
          break;
        }
      }
    }

    if (nextClosed == value.length()) {
      throw new IllegalArgumentException("Expression " + value
          + " not well formed.");
    }

    final String innerExpression = value.substring(lastIndex + 2, nextClosed);
    Object result = null;
    try {
      final Expression e = jexl.createExpression(innerExpression);
      result = e.evaluate(new MapContext());
    } catch (final JexlException e) {
      throw new IllegalArgumentException("Expression " + value
          + " not well formed. " + e.getMessage(), e);
    }

    if (result == null) {
      // for backward compatibility it is best to return value
      return value;
    }

    final String newValue =
        value.substring(0, lastIndex) + result.toString()
            + value.substring(nextClosed + 1);
    return resolveVariableExpression(newValue, lastIndex, jexl);
  }
1051034
def lookup_val_prefix(prefix, att_options={})

      lval(
        [ prefix ] + [ 'val', 'value' ].map { |s| "#{prefix}_#{s}" },
        %w[ v var variable ].map { |s| "#{prefix}_#{s}" },
        %w[ f fld field ].map { |s| "#{prefix}_#{s}" },
        att_options)
    end
138271
def is_var_or_func_exist(content):
    
    if not isinstance(content, basestring):
        return False

    try:
        match_start_position = content.index("$", 0)
    except ValueError:
        return False

    while match_start_position < len(content):
        dollar_match = dolloar_regex_compile.match(content, match_start_position)
        if dollar_match:
            match_start_position = dollar_match.end()
            continue

        func_match = function_regex_compile.match(content, match_start_position)
        if func_match:
            return True

        var_match = variable_regex_compile.match(content, match_start_position)
        if var_match:
            return True

        return False
198422
function isYzField(f) {
    return f === '_yz_id'   ||
           f === '_yz_ed'   ||
           f === '_yz_fpn'  ||
           f === '_yz_vtag' ||
           f === '_yz_pn'   ||
           f === '_yz_rk'   ||
           f === '_yz_rt'   ||
           f === '_yz_rb'   ||
           f === '_yz_err';
}
245084
@Override
    public boolean matchesIndexValue(int v) {
        if (pattern.length() == 0) {
            return true;
        }
        int c = UTF16.charAt(pattern, 0);
        UnicodeMatcher m = data.lookupMatcher(c);
        return (m == null) ? ((c & 0xFF) == v) : m.matchesIndexValue(v);
    }
145096
def get_value(value):
    
    v = Value()
    if not value:
        raise errors.HeaderParseError("Expected value but found end of string")
    leader = None
    if value[0] in CFWS_LEADER:
        leader, value = get_cfws(value)
    if not value:
        raise errors.HeaderParseError("Expected value but found "
                                      "only {}".format(leader))
    if value[0] == '"':
        token, value = get_quoted_string(value)
    else:
        token, value = get_extended_attribute(value)
    if leader is not None:
        token[:0] = [leader]
    v.append(token)
    return v, value
844394
function (value) {
      if (fp.is(String, value) && value.indexOf(':') > 0) {
        let [path, id] = value.split(':');
        return { _id: value, _type: path, [options.idField]: id };
      } else {
        // keep original value in _value
        return { _id: value, _type: value, [options.idField]: null, _value: value };
      }
    }
360573
function parseVariableIdentifier() {
        var token = lex();

        if (token.type !== Token.Identifier) {
            throwUnexpected(token);
        }

        return {
            type: Syntax.Identifier,
            name: token.value
        };
    }
52568
function getField(_, ctx) {
  if (!_.$field) return null;
  var k = 'f:' + _.$field + '_' + _.$name;
  return ctx.fn[k] || (ctx.fn[k] = field(_.$field, _.$name));
}
113774
def prefix=(value)
      value.is_a?(Prefix) ? super(value) : super(Prefix.find(value.to_s))
    end
1273161
function PRVTgetTextPosition( $x, $y, $angle, $size, $wa, $text )
    {
        $tmp = false;
        // given this information return an array containing x and y for the end position as elements 0 and 1

        $w = $this->getTextWidth($size,$text);
        // need to adjust for the number of spaces in this text
        $words = explode(' ',$text);
        $nspaces=count($words)-1;
        $w += $wa*$nspaces;
        $a = deg2rad((float)$angle);
        if ( $tmp )
        {
            return array($this->xOffset(),-sin($a)*$w+$y);
        }
        return array(cos($a)*$w+$x,-sin($a)*$w+$y);
    }