Process numeric, and string, and predefined constants
@return {Function} compiled node
@private
760579
function processConstants(tokenizer, scope) {
  if (tokenizer.token.match(types.CONSTANT)) {
    const node = createConstantNode(tokenizer.token.value);

    tokenizer.skipToken();

    return node;
  }

  return processParentheses(tokenizer, scope);
}
888159
function Compiler(node, options) {
  this.options = options = options || {};
  this.node = node;
  this.hasCompiledDoctype = false;
  this.hasCompiledTag = false;
  this.pp = options.pretty || false;
  if (this.pp && typeof this.pp !== 'string') {
    this.pp = '  ';
  }
  this.debug = false !== options.compileDebug;
  this.indents = 0;
  this.parentIndents = 0;
  this.terse = false;
  this.mixins = {};
  this.dynamicMixins = false;
  this.eachCount = 0;
  if (options.doctype) this.setDoctype(options.doctype);
  this.runtimeFunctionsUsed = [];
  this.inlineRuntimeFunctions = options.inlineRuntimeFunctions || false;
  if (this.debug && this.inlineRuntimeFunctions) {
    this.runtimeFunctionsUsed.push('rethrow');
  }
  this.codeBuffer = '_=function*(){';
  this.codeMarker = {};
  this.codeIndex = -1;

  this.useGenerators = false;
  this.templateVars = ['locals']

}
246147
function processYAMLVariable(v, lvl, indent) {

    // Scalars
    if (typeof v === 'string')
      return yml.string(v);
    else if (typeof v === 'number')
      return yml.number(v);
    else if (typeof v === 'boolean')
      return yml.boolean(v);
    else if (typeof v === 'undefined' || v === null || isRealNaN(v))
      return yml.nullValue(v);

    // Nonscalars
    else if (isPlainObject(v))
      return yml.object(v, lvl, indent);
    else if (isArray(v))
      return yml.array(v, lvl);
    else if (typeof v === 'function')
      return yml.fn(v);

    // Error
    else
      throw TypeError('artoo.writers.processYAMLVariable: wrong type.');
  }
232289
function preprocessCode (code) {

  // Remove starting comments
  while (code.indexOf('//') === 0) {
    code = code.slice(code.indexOf('\n'));
  }

  // Starts with an object literal
  if (code.indexOf('{') === 0) {
    code = 'var json = ' + code;

  // Starts with an object property
  } else if (code.indexOf(':') !== -1 &&
             code.indexOf(':') < code.indexOf(' ')) {
    code = 'var json = {' + code + '}';
  }

  // Starts with an anonymous function
  if (code.indexOf('function') === 0) {
    code = 'var func = ' + code;
  }

  // Contains ...
  return code.replace('...', '');
}
326412
def _handle_constant(self, node, scope, ctxt, stream):
        
        self._dlog("handling constant type {}".format(node.type))
        switch = {
            "int": (self._str_to_int, self._choose_const_int_class),
            "long": (self._str_to_int, self._choose_const_int_class),
            # TODO this isn't quite right, but py010parser wouldn't have
            # parsed it if it wasn't correct...
            "float": (lambda x: float(x.lower().replace("f", "")), fields.Float),
            "double": (float, fields.Double),

            # cut out the quotes
            "char": (lambda x: ord(utils.string_escape(x[1:-1])), fields.Char),

            # TODO should this be unicode?? will probably bite me later...
            # cut out the quotes
            "string": (lambda x: str(utils.string_escape(x[1:-1])), fields.String)
        }

        if node.type in switch:
            #return switch[node.type](node.value)
            conversion,field_cls = switch[node.type]
            val = conversion(node.value)

            if hasattr(field_cls, "__call__") and not type(field_cls) is type:
                field_cls = field_cls(val)

            field = field_cls()
            field._pfp__set_value(val)
            return field

        raise UnsupportedConstantType(node.coord, node.type)
332579
function () {

// Parse a number value.

            var number,
                string = '';

            if (ch === '-') {
                string = '-';
                next('-');
            }
            while (ch >= '0' && ch <= '9') {
                string += ch;
                next();
            }
            if (ch === '.') {
                string += '.';
                while (next() && ch >= '0' && ch <= '9') {
                    string += ch;
                }
            }
            if (ch === 'e' || ch === 'E') {
                string += ch;
                next();
                if (ch === '-' || ch === '+') {
                    string += ch;
                    next();
                }
                while (ch >= '0' && ch <= '9') {
                    string += ch;
                    next();
                }
            }

            number = +string;

            if (!isFinite(number)) {
                error("Bad number");
            } else {
                
                // means JS rounded or truncated number, too big
                if (number.toString() !== string) {
                    try {
                        return new BigNumber(string);
                    } catch (e) {
                        // if fails, fallback to default behavior
                    }
                }

                return number;
            }
        }
132260
def process_number(line, base, str)
      value = str.to_i base
      case value
      when Fixnum
        AST::FixnumLiteral.new line, value
      when Bignum
        AST::NumberLiteral.new line, value
      end
    end
655381
function compile(self, str, locale) {
  var nodes, buf, key, strict_exec, forms_exec, plurals_cache;

  // Quick check to avoid parse in most cases :)
  if (!CAN_HAVE_DIRECTIVES_RE.test(str)) { return str; }

  nodes = parser.parse(str);

  if (nodes.length === 1 && nodes[0].type === 'literal') {
    return nodes[0].text;
  }

  // init cache instance for plural parts, if not exists yet.
  if (!self._plurals_cache[locale]) {
    self._plurals_cache[locale] = new BabelFish(locale);
  }
  plurals_cache = self._plurals_cache[locale];

  buf = [];
  buf.push([ 'var str = "", strict, strict_exec, forms, forms_exec, plrl, cache, loc, loc_plzr, anchor;' ]);
  buf.push('params = flatten(params);');

  forEach(nodes, function (node) {
    if (node.type === 'literal') {
      buf.push(format('str += %j;', node.text));
      return;
    }

    if (node.type === 'variable') {
      key = node.anchor;
      buf.push(format(
        'str += ("undefined" === typeof (params[%j])) ? "[missed variable: %s]" : params[%j];',
        key, key, key
      ));
      return;
    }

    // should never happen
    /*istanbul ignore next*/
    if (node.type !== 'plural') { throw new Error('Unknown node type'); }

    //
    // Compile plural
    //

    key = node.anchor;
    // check if plural parts are plain strings or executable,
    // and add executable to "cache" instance of babelfish
    // plural part text will be used as translation key
    strict_exec = {};
    forEach(node.strict, function (text, k) {
      var parsed = parser.parse(text);
      if (parsed.length === 1 && parsed[0].type === 'literal') {
        strict_exec[k] = false;
        // patch with unescaped value for direct extract
        node.strict[k] = parsed[0].text;
        return;
      }

      strict_exec[k] = true;
      if (!plurals_cache.hasPhrase(locale, text, true)) {
        plurals_cache.addPhrase(locale, text, text);
      }
    });

    forms_exec = {};
    forEach(node.forms, function (text, idx) {
      var parsed = parser.parse(text), unescaped;
      if (parsed.length === 1 && parsed[0].type === 'literal') {
        // patch with unescaped value for direct extract
        unescaped = parsed[0].text;
        node.forms[idx] = unescaped;
        forms_exec[unescaped] = false;
        return;
      }

      forms_exec[text] = true;
      if (!plurals_cache.hasPhrase(locale, text, true)) {
        plurals_cache.addPhrase(locale, text, text);
      }
    });
    /*eslint-disable space-in-parens*/
    buf.push(format('loc = %j;', locale));
    buf.push(format('loc_plzr = %j;', locale.split(/[-_]/)[0]));
    buf.push(format('anchor = params[%j];', key));
    buf.push(format('cache = this._plurals_cache[loc];'));
    buf.push(format('strict = %j;', node.strict));
    buf.push(format('strict_exec = %j;', strict_exec));
    buf.push(format('forms = %j;', node.forms));
    buf.push(format('forms_exec = %j;', forms_exec));
    buf.push(       'if (+(anchor) != anchor) {');
    buf.push(format('  str += "[invalid plurals amount: %s(" + anchor + ")]";', key));
    buf.push(       '} else {');
    buf.push(       '  if (strict[anchor] !== undefined) {');
    buf.push(       '    plrl = strict[anchor];');
    buf.push(       '    str += strict_exec[anchor] ? cache.t(loc, plrl, params) : plrl;');
    buf.push(       '  } else {');
    buf.push(       '    plrl = pluralizer(loc_plzr, +anchor, forms);');
    buf.push(       '    str += forms_exec[plrl] ? cache.t(loc, plrl, params) : plrl;');
    buf.push(       '  }');
    buf.push(       '}');
    return;
  });

  buf.push('return str;');

  /*eslint-disable no-new-func*/
  return new Function('params', 'flatten', 'pluralizer', buf.join('\n'));
}
789216
private function constDeclaration() {
    $node = new ConstantDeclarationNode();
    $name_node = new NameNode();
    $this->mustMatch(T_STRING, $name_node, NULL, TRUE);
    $node->addChild($name_node, 'name');
    if ($this->mustMatch('=', $node)) {
      $node->addChild($this->staticScalar(), 'value');
    }
    return $node;
  }
503350
function processValue(schema, value) {
  // "enum" is a reserved word, so only "type" and "items" can be destructured
  const { type, items } = schema;
  if (value === "") {
    return undefined;
  } else if (type === "array" && items && nums.has(items.type)) {
    return value.map(asNumber);
  } else if (type === "boolean") {
    return value === "true";
  } else if (type === "number") {
    return asNumber(value);
  }

  // If type is undefined, but an enum is present, try and infer the type from
  // the enum values
  if (schema.enum) {
    if (schema.enum.every(x => guessType(x) === "number")) {
      return asNumber(value);
    } else if (schema.enum.every(x => guessType(x) === "boolean")) {
      return value === "true";
    }
  }

  return value;
}
433496
function processNode(node) {
            if (!node.code.trim()) {
                // empty
                return
            }

            const innerTokens = microTemplateService.getMicroTemplateTokensInfo(
                node
            ).innerTokens
            if (!innerTokens.length) {
                return
            }
            const statement = microTemplateService.getMicroTemplateExpressionStatement(
                node,
                sourceCode
            )
            if (!statement) {
                return
            }

            const innerLast = innerTokens[innerTokens.length - 1]
            if (innerLast.value === ";") {
                context.report({
                    node: innerLast,
                    messageId: "unexpected",
                    fix: fixer => fixer.remove(innerLast),
                })
            }
        }
1102638
def constants_from_value(data=@value)
      data.scan(escape_pattern).flatten.collect { |value| value.strip }
    end
1337120
function compile(parsed) {
    var a = parsed[0],
        b = parsed[1] - 1;

    //when b <= 0, a*n won't be possible for any matches when a < 0
    //besides, the specification says that no element is matched when a and b are 0
    if (b < 0 && a <= 0) return falseFunc;

    //when a is in the range -1..1, it matches any element (so only b is checked)
    if (a === -1)
        return function(pos) {
            return pos <= b;
        };
    if (a === 0)
        return function(pos) {
            return pos === b;
        };
    //when b <= 0 and a === 1, they match any element
    if (a === 1)
        return b < 0
            ? trueFunc
            : function(pos) {
                  return pos >= b;
              };

    //when a > 0, modulo can be used to check if there is a match
    var bMod = b % a;
    if (bMod < 0) bMod += a;

    if (a > 1) {
        return function(pos) {
            return pos >= b && pos % a === bMod;
        };
    }

    a *= -1; //make `a` positive

    return function(pos) {
        return pos <= b && pos % a === bMod;
    };
}
1069012
function nodeToString(node) {
    switch (node.type) {
        case ("BinaryExpression"): {
            return nodeToString(node.left) + node.operator.toString() + nodeToString(node.right);
        }
        case ("CallExpression"): {
            var args = node.arguments.map(function(arg) {
                return nodeToString(arg);
            }).toString();
            return nodeToString(node.callee) + "(" + args + ")";
        }
        case ("ConditionalExpression"): {
            return nodeToString(node.test) + "?" + nodeToString(node.consequent) + ":" + nodeToString(node.alternate);
        }
        case ("Identifier"): {
            return node.name.toString();
        }
        case ("Literal"): {
            return node.value.toString();
        }
        case ("MemberExpression"): {
            return nodeToString(node.object) + "[" + nodeToString(node.property) + "]";
        }
        case ("TemplateElement"): {
            return node.value.raw.toString();
        }
        case ("TemplateLiteral"): {
            // interleave quasis with expressions
            var s = [];
            node.quasis.forEach(function(quasi, i) {
                if (quasi.value.raw) {
                    s.push(nodeToString(quasi));
                }
                var expression = node.expressions[i];
                if (expression) {
                    s.push(nodeToString(expression));
                }
            });
            return s.join("");
        }
        default: {
            // Silently ignore Nodes with types we don't handle
            return "";
        }
    }
}
74454
function compile(node) {
	switch (node.type) {
		case 'field':
			var obj = {};
			obj[node.name] = node.value;
			return obj;

		case 'op':
			var obj = {};
			var op = '$' + node.op;

			obj[op] = [
				compile(node.left),
				compile(node.right)
			];

			return obj;
	}
}
901207
function parseVariableDeclarations(string, syntax, options) {
  string = ignoreBlock.removeIgnoredBlocks(string);
  var parser = getParserForSyntax(syntax, options);
  if (parser) {
    return parser.parseVariableDeclarations(string);
  }
  return [];
}
387420
function process(str) {
        var div = document.createElement('div');
        div.innerHTML = str.trim();
        return format(div, 0).innerHTML;
    }