getArgList: Get argument list for next function in Javascript source.

Description Usage Arguments Value Note Examples

Description

This looks through the text (by default current source in the RStudio editor) for the next function header, and extracts the argument names.

Usage

1
getArgList(text = getSource(), start = attr(text, "start"), id = attr(text, "id"))

Arguments

text

Javascript source code, perhaps with "start" and "file" attributes to indicate its starting location in a file.

start

Where is the function definition?

id

The id of the source file containing the Javascript.

Value

A character vector containing all of the argument names for the first function found in the text. The vector has an attribute "start" indicating where the function keyword was found for the function header. If the text had such an attribute, the location is relative to the original file; otherwise, just within the current text.

Note

Currently default values for parameters are ignored.

Examples

1
getArgList("function(a, b = 3)")

dmurdoch/JSDocPlugin documentation built on May 20, 2019, 7:55 a.m.