Parse CallExpression to get array of arguments

@param  {Object} node Node to parse
@return {String[]} Literal function's arguments
548513
function parseArgs(node) {
  let parsedArgs = [];

  if (isCallExpression(node)) {
    parsedArgs = node.arguments
      .filter(argument => isLiteral(argument) && argument.value)
      .map(argument => argument.value);
  }

  return parsedArgs;
}
487513
function callExpression(exprFn, key, value) {
          locals[valueName] = value;
          if (keyName) locals[keyName] = key;
          return exprFn(scope, locals);
        }
550877
function getAllExpressionStatements(node) {
  console.assert(node.body && node.body.body);
  var expressionStatements = [];
  node.body.body.forEach(function(childNode) {
    if (childNode.type == 'ExpressionStatement') {
      expressionStatements.push(childNode);
    } else if (childNode.body) {
      var childExpressions = getAllExpressionStatements(childNode);
      expressionStatements.push.apply(expressionStatements, childExpressions);
    }
  });
  return expressionStatements;
}
327510
function parseVariableDeclarations(string) {

  // Do not parse empty files. Otherwise gonzales.parse will fail
  if (!string) {
    return [];
  }

  var out = [],
      ast = gonzales.parse(string, {
        syntax: 'less'
      });
  // Exclude functions arguments
  ast.traverse(function(node, index, parent) {
    if (node.is('arguments')) {
      parent.removeChild(index);
    }
  });
  ast.traverseByType('declaration', function(decl) {
    // Only consider @variable: value declarations
    var varName,
        varFullName,
        varVal = '',
        varLine = 1;
    decl.traverseByType('variable', function(varNode) {
      varName = varNode.content.toString();
      varFullName = varNode.toString();
      decl.traverseByType('value', function(valNode) {
        varVal = valNode.toString();
        varLine = valNode.start.line;
      });
      if (varFullName !== varVal) {
        out.push({
          name: varName,
          value: varVal.trim(),
          line: varLine
        });
      }
    });
  });
  return out;
}
1069135
function getRegExpPattern(node) {
            if (node.regex) {
                return node.regex.pattern;
            }
            if (typeof node.value === "string" &&
                (node.parent.type === "NewExpression" || node.parent.type === "CallExpression") &&
                node.parent.callee.type === "Identifier" &&
                node.parent.callee.name === "RegExp" &&
                node.parent.arguments[0] === node
            ) {
                return node.value;
            }

            return null;
        }
233353
function(node) {
        var data = []

        for (var i = 0, len = node.childNodes.length; i < len; i++) {
            var child = node.childNodes[i]
            if (child.nodeType != ELEMENT_NODE) {
                continue
            }

            data.push(this._parseNode(child))
        }

        return data
    }
1102246
function parseArgs() {
    var args = Array.prototype.slice.call(arguments);

    var ret = {
        query: args[0],
        params: [],
        options: {},
        callback: undefined,
        endCallback: undefined
    };

    args.shift();

    // If specified, params must be an array
    if (args[0] instanceof Array) {
        ret.params = args[0];
        args.shift();
    }

    // If specified, options must be a non-Function object
    if (! (args[0] instanceof Function)) {
        ret.options = args[0];
        args.shift();
    }

    ret.callback = args[0];
    ret.endCallback = args[1];

    if (ret.query === undefined || ret.callback === undefined) {
        throw new Error('query and callback are required');
    }

    return ret;
}
390801
function parseArguments(options, callback) {
    if (_.isUndefined(options) && _.isUndefined(callback)) { // No params
        return [{}, undefined];
    }
    if (!_.isUndefined(options) && _.isFunction(options)) { // Only callback param
        callback = options;
        options = {};
    }
    return [options, callback]; // Both params
}
1000248
function getReactProps(node, parent) {
  if (node.openingElement.attributes.length === 0 ||
  htmlElements.indexOf(node.openingElement.name.name) > 0) return {};
  const result = node.openingElement.attributes
    .map(attribute => {
      const name = attribute.name.name;
      let valueName;
      if (attribute.value === null) valueName = undefined;
      else if (attribute.value.type === 'Literal') valueName = attribute.value.value;
      else if (attribute.value.expression.type === 'Literal') {
        valueName = attribute.value.expression.value;
      } else if (attribute.value.expression.type === 'Identifier') {
        valueName = attribute.value.expression.name;
      } else if (attribute.value.expression.type === 'CallExpression') {
        valueName = attribute.value.expression.callee.object.property.name;
      } else if (attribute.value.expression.type === 'BinaryExpression') {
        valueName = attribute.value.expression.left.name
          + attribute.value.expression.operator
          + (attribute.value.expression.right.name
          || attribute.value.expression.right.value);
      } else if (attribute.value.expression.type === 'MemberExpression') {
        let current = attribute.value.expression;
        while (current && current.property) {
          //  && !current.property.name.match(/(state|props)/)
          valueName = `.${current.property.name}${valueName || ''}`;
          current = current.object;
          if (current.type === 'Identifier') {
            valueName = `.${current.name}${valueName || ''}`;
            break;
          }
        }
        valueName = valueName.replace('.', '');
      } else if (attribute.value.expression.type === 'LogicalExpression') {
        valueName = attribute.value.expression.left.property.name;
        // valueType = attribute.value.expression.left.object.name;
      } else if (attribute.value.expression.type === 'JSXElement') {
        const nodez = attribute.value.expression;
        const output = {
          name: nodez.openingElement.name.name,
          children: getChildJSXElements(nodez, parent),
          props: getReactProps(nodez, parent),
          state: {},
          methods: [],
        };
        valueName = output;
      } else valueName = escodegen.generate(attribute.value);

      return {
        name,
        value: valueName,
        parent,
      };
    });
  return result;
}
640654
function ArrayExpression(node, print) {
  var elems = node.elements;
  var len = elems.length;

  this.push("[");
  print.printInnerComments();

  for (var i = 0; i < elems.length; i++) {
    var elem = elems[i];
    if (elem) {
      if (i > 0) this.space();
      print.plain(elem);
      if (i < len - 1) this.push(",");
    } else {
      // If the array expression ends with a hole, that hole
      // will be ignored by the interpreter, but if it ends with
      // two (or more) holes, we need to write out two (or more)
      // commas so that the resulting code is interpreted with
      // both (all) of the holes.
      this.push(",");
    }
  }

  this.push("]");
}
980247
function getArgs(args) {

  if (args.length === 0) {
    return [];
  }

  if (Array.isArray(args[0])) {
    return args[0];
  }

  return Array.prototype.slice.call(args);
}
254061
function parseArgumentList() {
                    var token, expr, args = [];

                    while (true) {
                        expr = parseExpression();
                        if (typeof expr === 'undefined') {
                            break;
                        }
                        args.push(expr);
                        token = lexer.peek();
                        if (!matchOp(token, ',')) {
                            break;
                        }
                        lexer.next();
                    }

                    return args;
                }
476652
def parse(node)
      node.xpath('*').each do |argument_child|
        case argument_child.name
        when 'argSz'
          @argument_size = ArgumentSize.new(parent: self).parse(argument_child)
        end
      end
      self
    end
560214
function findArguments (node) {
  if (!node) {
    return []
  }

  return node.map(arg => {
    const name = arg.name.value
    const fieldType = findType(arg.type)
    const isDeprecated = validateIfDeprecated(arg.directives)

    return Object.assign({ name, isDeprecated }, fieldType)
  })
}
543019
function invokeCallExpression(callExpression, app, argsDict) {
  const memberExpression = callExpression.callee;
  const functionPath = getPathFromMemberExpression(memberExpression);
  const [fnPtr, thisPtr] = functionPath.reduce(([_fn, _this], item) =>  [_fn[item], _fn], [app, undefined])

  const args = callExpression.arguments.map(a => {
    if (a.type === "Identifier") {
      return argsDict[a.name];
    } else if (a.type === "Literal") {
      return a.value;
    } else {
      throw new Error(`Expected Identifier or Literal but got ${a.type}.`);
    }
  });

  return fnPtr.apply(thisPtr, args)
}
286294
function(node){
    var test = null;
    if ('default' != node.expr) {
      test = node.astExpr || this.parseExpr(node.expr);
    }
    var consequent = []
    if (node.block) {
      consequent = this.visit(node.block, node);
      consequent.push(t.breakStatement());
    }
    var c = t.switchCase(test, consequent);
    return [c];
  }
675154
function parse_javascript(file /*, options*/) {
  let source = fs.readFileSync(file, 'utf8');

  let nodes, list = {};

  try {
    nodes = parser.parse(source);
  } catch (err) {
    throw new Error(`${err} [${file}:${err.line},${err.column}]`);
  }

  // do pre-distribute early work
  _.each(nodes, node /*, id*/ => {
    let clone;

    // assign hierarchy helpers
    node.aliases  = [];
    node.children = [];

    // set source fiel of the node
    node.file = file;

    if (node.type === 'class') {
      node.subclasses = [];
    }

    // collect sections
    if (node.type === 'section') {
      list[node.id] = node;
      return;
    }

    // elements with undefined section get '' section,
    // and will be resolved later, when we'll have full
    // element list
    list[(node.section || '') + '.' + node.id] = node;

    // bound methods produce two methods with the same description but different signatures
    // E.g. Element.foo(@element, a, b) becomes
    // Element.foo(element, a, b) and Element#foo(a, b)
    if (node.type === 'method' && node.bound) {
      clone = _.clone(node);
      clone.id = node.id.replace(/(.+)\.(.+)$/, '$1#$2');

      // link to methods
      node.bound = clone.id;
      clone.bound = node.id;

      // insert bound method clone
      list[(node.section || '') + '.' + clone.id] = clone;
    }
  });

  // TODO: section.related_to should mark related element as belonging to the section
  //_.each(list, function (node, id) {
  //  var ref_id = '.' + node.related_to, ref;
  //  if ('section' === node.type && node.related_to && list[ref_id]) {
  //    ref = list[ref_id];
  //    ref.id = node.id + '.' + node.related_to;
  //    delete list[ref_id];
  //    list[ref.id] = ref;
  //  }
  //});

  return list;
}