ids_with_token {lintr}R Documentation

Get parsed IDs by token

Description

Gets the source IDs (row indices) corresponding to given token.

Usage

ids_with_token(source_file, value, fun = `==`)

with_id(source_file, id)

Arguments

source_file

A list of source expressions, the result of a call to 'get_source_expressions()', for the desired filename.

value

Character. String correspondin to the token to search for. For example:

  • "SYMBOL"

  • "FUNCTION"

  • "EQ_FORMALS"

  • "$"

  • "("

fun

For additionaly flexibility, a function to search for in the 'token' column of 'parsed_content'. Typically '==' or '%in%'.

id

Integer. The index corresponding to the desired row of 'parsed_content'.

Value

'ids_with_token': The indices of the 'parsed_content' data frame entry of the list of source expressions. Indices correspond to the *rows* where 'fun' evaluates to 'TRUE' for the 'value' in the *token* column.

'with_id': A data frame corresponding to the row(s) specified in 'id'.

Functions


[Package lintr version 2.0.0 Index]