atom ::= '(' expr ')' | '[' expr ']' | 'options'
             | long | shorts | argument | command ;
544016
def parse_atom(tokens, options):
    
    token = tokens.current()
    result = []
    if token == '(':
        tokens.move()
        result = [Required(*parse_expr(tokens, options))]
        if tokens.move() != ')':
            raise tokens.error("Unmatched '('")
        return result
    elif token == '[':
        tokens.move()
        result = [Optional(*parse_expr(tokens, options))]
        if tokens.move() != ']':
            raise tokens.error("Unmatched '['")
        return result
    elif token == 'options':
        tokens.move()
        return [AnyOptions()]
    elif token.startswith('--') and token != '--':
        return parse_long(tokens, options)
    elif token.startswith('-') and token not in ('-', '--'):
        return parse_shorts(tokens, options)
    elif token.startswith('<') and token.endswith('>') or token.isupper():
        return [Argument(tokens.move())]
    else:
        return [Command(tokens.move())]
34310
def call_elements(buffer = '')
      # Accept both shorthand and default ruby hash style. Following DRY
      # principles, a Proc is used to assign the value to the current key
      #
      # key: value
      # :key => value
      # value
      if (symbol = accept_stripped :hash_symbol)
        buffer += symbol

        # Get the value associated to the current hash key
        if (exp = expression(true))
          buffer += exp[@value]
        else
          error :call_elements
        end

        # If there is an comma ",", recursively gather the next
        # array element into the buffer
        if (terminator = accept_stripped :comma)
          buffer += call_elements terminator
        end
      elsif (exp = expression(true))
        buffer += exp[@value]

        if (assign = accept_stripped :hash_assignment)
          buffer += assign

          # Get the value associated to the current hash key
          if (exp = expression(true))
            buffer += exp[@value]
          else
            error :call_elements
          end
        end

        # If there is an comma ",", recursively gather the next
        # array element into the buffer
        if (terminator = accept_stripped :comma)
          buffer += call_elements terminator
        end
      end

      buffer
    end
976408
JCExpression argumentsOpt(List<JCExpression> typeArgs, JCExpression t) {
        if ((mode & EXPR) != 0 && token.kind == LPAREN || typeArgs != null) {
            mode = EXPR;
            return arguments(typeArgs, t);
        } else {
            return t;
        }
    }
414804
function checkArgument(i) {
  let l;

  if (l = checkEscapedString(i)) tokens[i].argument_child = 1;
  else if (l = checkDeclaration(i)) tokens[i].argument_child = 2;
  else if (l = checkVariablesList(i)) tokens[i].argument_child = 3;
  else if (l = checkVariable(i)) tokens[i].argument_child = 4;
  else if (l = checkSC(i)) tokens[i].argument_child = 5;
  else if (l = checkUnary(i)) tokens[i].argument_child = 6;
  else if (l = checkOperator(i)) tokens[i].argument_child = 7;
  else if (l = checkDelim(i)) tokens[i].argument_child = 8;
  else if (l = checkDeclDelim(i)) tokens[i].argument_child = 9;
  else if (l = checkString(i)) tokens[i].argument_child = 10;
  else if (l = checkPercentage(i)) tokens[i].argument_child = 11;
  else if (l = checkDimension(i)) tokens[i].argument_child = 12;
  else if (l = checkNumber(i)) tokens[i].argument_child = 13;
  else if (l = checkUri(i)) tokens[i].argument_child = 14;
  else if (l = checkFunction(i)) tokens[i].argument_child = 15;
  else if (l = checkIdent(i)) tokens[i].argument_child = 16;
  else if (l = checkVhash(i)) tokens[i].argument_child = 17;
  else if (l = checkBlock(i)) tokens[i].argument_child = 18;
  else if (l = checkParentheses(i)) tokens[i].argument_child = 19;

  return l;
}
402677
def argument(short_name, long_name, description, default_value, validate = nil, &block)
			return define_value(short_name, long_name, description, false, default_value, validate || block)
		end
1157991
function (options) {
        options = options || {};
        var qs = '';
        if (typeof options === 'string') {
            qs = options;
            options = this.parseOptions(qs);
        }

        for (var key in options) {
            if (!(key in DEFAULT_OPTIONS)) {
                throw new Error('No such option.');
            }
        }
        if (qs.length && !Object.keys(options).length) {
            throw new Error('Invalid argument syntax.');
        }

        this.options = extend(DEFAULT_OPTIONS, options);
    }
896134
def ast2expr(ast):
    """"""
    if ast[0] == 'const':
        return _CONSTS[ast[1]]
    elif ast[0] == 'var':
        return exprvar(ast[1], ast[2])
    else:
        xs = [ast2expr(x) for x in ast[1:]]
        return ASTOPS[ast[0]](*xs, simplify=False)
1209456
def literal(compiler, cont, arg):
  ''''''
  text = compiler.new_var(il.ConstLocalVar('text'))
  pos = compiler.new_var(il.ConstLocalVar('pos'))
  p = compiler.new_var(il.LocalVar('p'))
  i = compiler.new_var(il.LocalVar('i'))
  x = compiler.new_var(il.ConstLocalVar('x'))
  length = compiler.new_var(il.ConstLocalVar('length'))  
  length2 = compiler.new_var(il.ConstLocalVar('length2'))  
  if isinstance(arg, Var):
    return il.Begin((
      il.Assign(x, il.Deref(arg)),
      il.AssignFromList(text, pos, il.parse_state),
      il.Assign(length, il.Len(text)),
      il.Assign(length, il.Len(x)),
      il.Assign(i, il.Integer(0)),
      il.Assign(p, pos),
      il.while_(il.and_(il.Lt(i, length2), il.Lt(p, length), il.Eq(il.GetItem(text, p), il.GetItem(x, i))), 
        il.AddAssign(p, il.Integer(1))),
      il.If(il.Lt(i, length2), 
        il.failcont(il.NONE),
        il.begin(il.append_failcont(compiler, 
          il.SetParseState(il.Tuple(text, pos))),
          il.SetParseState(il.Tuple(text, p)),
          cont(arg)))))
  elif isinstance(arg, String):
    arg = arg.interlang()
    return il.Begin((
      il.AssignFromList(text, pos, il.parse_state),
      il.Assign(length, il.Len(text)),
      il.Assign(length2, il.Len(arg)),
      il.Assign(i, il.Integer(0)),
      il.Assign(p, pos),
      il.while_(il.and_(il.Lt(i, length2), il.Lt(p, length), il.Eq(il.GetItem(text, p), il.GetItem(arg, i))), 
        il.AddAssign(p, il.Integer(1)),
        il.AddAssign(i, il.Integer(1)),
        ),
      il.If(il.Lt(i, length2), 
        il.failcont(il.NONE),
        il.begin(il.append_failcont(compiler, 
          il.SetParseState(il.Tuple(text, pos))),
          il.SetParseState(il.Tuple(text, p)),
          cont(arg)))))
  else:
    raise CompileTypeError
387591
function parseExpression(str) {

  var expMatches = str.match(expressionRegex)

  // get the args from the second match
  // extract options from args using filter with side effect
  var options = {}
  var args = compact((expMatches[2] || '').split(argsRegex))
    .filter(function (arg) {
      var keyValue = arg.split('=')
      return keyValue.length === 1 || (options[keyValue[0]] = keyValue[1], false)
    })

  return {
    expression: expMatches[1] || null,
    args: args,
    options: options
  }
}
117739
def [](arg)
      case
      when arg.is_a?(Range)
        index = @index.select{|i| arg.include?(i)}
        Mikon::DataFrame.new(index.map{|i| self.row(i)}, {index: index})

      when arg.is_a?(Symbol)
        self.column(arg)
      end
    end
353488
def fromTerm(cls, term):
        """"""

        if isinstance(term, Term):
            term = term.handle
        elif not isinstance(term, (c_void_p, int)):
            raise ArgumentTypeError((str(Term), str(c_void_p)), str(type(term)))

        a = atom_t()
        if PL_get_atom(term, byref(a)):
            return cls(a.value)
770990
def p_expr_list_assign(p):
    ''
    p[0] = ast.ListAssignment(p[3], p[6], lineno=p.lineno(1))
993877
function $(tok) {
        var match, length, c, endIndex;

        // Non-terminal
        if (tok instanceof Function) {
            return tok.call(parser.parsers);
        // Terminal
        // Either match a single character in the input,
        // or match a regexp in the current chunk (chunk[j]).
        } else if (typeof(tok) === 'string') {
            match = input.charAt(i) === tok ? tok : null;
            length = 1;
            sync();
        } else {
            sync();

            match = tok.exec(chunks[j]);
            if (match) {
                length = match[0].length;
            } else {
                return null;
            }
        }

        // The match is confirmed, add the match length to `i`,
        // and consume any extra white-space characters (' ' || '\n')
        // which come after that. The reason for this is that LeSS's
        // grammar is mostly white-space insensitive.
        if (match) {
            var mem = i += length;
            endIndex = i + chunks[j].length - length;

            while (i < endIndex) {
                c = input.charCodeAt(i);
                if (! (c === 32 || c === 10 || c === 9)) { break; }
                i++;
            }
            chunks[j] = chunks[j].slice(length + (i - mem));
            current = i;

            if (chunks[j].length === 0 && j < chunks.length - 1) { j++; }

            if (typeof(match) === 'string') {
                return match;
            } else {
                return match.length === 1 ? match[0] : match;
            }
        }
    }
373386
function substArguments(str, args, key) {
        var reArgs = /\{\{\s*(.+?)\s*\}\}/g;
        return str.replace(reArgs, function(matched_text, arg) {
            if (args && arg in args) {
                return args[arg];
            }
            if (arg in gL10nData) {
                return gL10nData[arg];
            }
            console.log("argument {{" + arg + "}} for #" + key + " is undefined.");
            return matched_text;
        });
    }
4621
def prop atom
      val, format, nitems = prop_raw atom
      case format
      when 32; val.unpack("l!#{nitems}")
      when 16; val.unpack("s#{nitems}")
      when 8; val[0, nitems]
      when 0; nil
      end
    end
327865
def define(cls, expr):
        

        try:
            lang = cls.lang
            items = items_(expr)
            for item in items:
                op, term = item
                full_op = operators.get(op)
                if full_op:
                    class_ = lang.ops[full_op.id]
                    clauses = {k: jx_expression(v) for k, v in expr.items() if k != op}
                    break
            else:
                if not items:
                    return NULL
                raise Log.error("{{operator|quote}} is not a known operator", operator=expr)

            if term == None:
                return class_([], **clauses)
            elif is_list(term):
                terms = [jx_expression(t) for t in term]
                return class_(terms, **clauses)
            elif is_data(term):
                items = items_(term)
                if class_.has_simple_form:
                    if len(items) == 1:
                        k, v = items[0]
                        return class_([Variable(k), Literal(v)], **clauses)
                    else:
                        return class_({k:  Literal(v) for k, v in items}, **clauses)
                else:
                    return class_(_jx_expression(term, lang), **clauses)
            else:
                if op in ["literal", "date", "offset"]:
                    return class_(term, **clauses)
                else:
                    return class_(_jx_expression(term, lang), **clauses)
        except Exception as e:
            Log.error("programmer error expr = {{value|quote}}", value=expr, cause=e)
1250773
def inc(self, *args, **kwargs):
        '''  '''
        pairs = []
        if len(args) == 1:
            pairs.append((args[0], 1))
        elif len(args) == 2:
            pairs.append(args)
        elif len(kwargs) != 0:
            pairs.extend([(k, v) for k, v in kwargs.items()])
        else:
            raise UpdateException('Invalid arguments for set.  Requires either two positional arguments or at least one keyword argument')

        ret = self
        for qfield, value in pairs:
            ret = self._atomic_op('$inc', qfield, value)
        return ret