Query

actual class Query(language: Language, source: String) : AutoCloseable(source)

A class that represents a set of patterns which match nodes in a syntax tree.

NOTE: If you're targeting Android SDK level < 33, you must use or close the instance to free up resources.

Throws

If any error occurred while creating the query.

expect class Query(language: Language, source: String)(source)

A class that represents a set of patterns which match nodes in a syntax tree.

Throws

If any error occurred while creating the query.

actual class Query(language: Language, source: String)(source)

A class that represents a set of patterns which match nodes in a syntax tree.

Throws

If any error occurred while creating the query.

actual class Query(language: Language, source: String)(source)

A class that represents a set of patterns which match nodes in a syntax tree.

Throws

If any error occurred while creating the query.

Constructors

Link copied to clipboard
actual constructor(language: Language, source: String)

Create a new query from a particular language and a string containing one or more S-expression patterns.

expect constructor(language: Language, source: String)

Create a new query from a particular language and a string containing one or more S-expression patterns.

actual constructor(language: Language, source: String)

Create a new query from a particular language and a string containing one or more S-expression patterns.

actual constructor(language: Language, source: String)

Create a new query from a particular language and a string containing one or more S-expression patterns.

Properties

Link copied to clipboard
@get:JvmName(name = "getCaptureCount")
actual val captureCount: UInt

The number of captures in the query.

expect val captureCount: UInt

The number of captures in the query.

@get:JvmName(name = "getCaptureCount")
actual val captureCount: UInt

The number of captures in the query.

actual val captureCount: UInt

The number of captures in the query.

Link copied to clipboard
actual val captureNames: List<String>

The capture names used in the query.

expect val captureNames: List<String>

The capture names used in the query.

actual val captureNames: List<String>

The capture names used in the query.

actual val captureNames: List<String>

The capture names used in the query.

Link copied to clipboard
@get:JvmName(name = "getPatternCount")
actual val patternCount: UInt

The number of patterns in the query.

expect val patternCount: UInt

The number of patterns in the query.

@get:JvmName(name = "getPatternCount")
actual val patternCount: UInt

The number of patterns in the query.

actual val patternCount: UInt

The number of patterns in the query.

Link copied to clipboard
actual val stringValues: List<String>

The string literals used in the query.

expect val stringValues: List<String>

The string literals used in the query.

actual val stringValues: List<String>

The string literals used in the query.

actual val stringValues: List<String>

The string literals used in the query.

Functions

Link copied to clipboard
@JvmName(name = "assertions")
actual fun assertions(index: UInt): Map<String, Pair<String?, Boolean>>

Get the property assertions for the given pattern index.

expect fun assertions(index: UInt): Map<String, Pair<String?, Boolean>>

Get the property assertions for the given pattern index.

@JvmName(name = "assertions")
actual fun assertions(index: UInt): Map<String, Pair<String?, Boolean>>

Get the property assertions for the given pattern index.

actual fun assertions(index: UInt): Map<String, Pair<String?, Boolean>>

Get the property assertions for the given pattern index.

Link copied to clipboard
open override fun close()
Link copied to clipboard
actual external fun disableCapture(name: String)

Disable a certain capture within a query.

expect fun disableCapture(name: String)

Disable a certain capture within a query.

actual external fun disableCapture(name: String)

Disable a certain capture within a query.

actual fun disableCapture(name: String)

Disable a certain capture within a query.

Link copied to clipboard
@JvmName(name = "disablePattern")
actual external fun disablePattern(index: UInt)

Disable a certain pattern within a query.

expect fun disablePattern(index: UInt)

Disable a certain pattern within a query.

@JvmName(name = "disablePattern")
actual external fun disablePattern(index: UInt)

Disable a certain pattern within a query.

actual fun disablePattern(index: UInt)

Disable a certain pattern within a query.

Link copied to clipboard
@JvmName(name = "endByteForPattern")
actual external fun endByteForPattern(index: UInt): UInt

Get the byte offset where the given pattern ends in the query's source.

expect fun endByteForPattern(index: UInt): UInt

Get the byte offset where the given pattern ends in the query's source.

@JvmName(name = "endByteForPattern")
actual external fun endByteForPattern(index: UInt): UInt

Get the byte offset where the given pattern ends in the query's source.

actual fun endByteForPattern(index: UInt): UInt

Get the byte offset where the given pattern ends in the query's source.

Link copied to clipboard
@JvmName(name = "exec")
actual operator fun invoke(node: Node, progressCallback: QueryProgressCallback?): QueryCursor

Execute the query on the given Node.

expect operator fun invoke(node: Node, progressCallback: QueryProgressCallback? = null): QueryCursor

Execute the query on the given Node.

@JvmName(name = "exec")
actual operator fun invoke(node: Node, progressCallback: QueryProgressCallback?): QueryCursor

Execute the query on the given Node.

actual operator fun invoke(node: Node, progressCallback: QueryProgressCallback?): QueryCursor

Execute the query on the given Node.

Link copied to clipboard
@JvmName(name = "isPatternGuaranteedAtStep")
actual fun isPatternGuaranteedAtStep(offset: UInt): Boolean

Check if a pattern is guaranteed to match once a given byte offset is reached.

Check if a pattern is guaranteed to match once a given byte offset is reached.

@JvmName(name = "isPatternGuaranteedAtStep")
actual fun isPatternGuaranteedAtStep(offset: UInt): Boolean

Check if a pattern is guaranteed to match once a given byte offset is reached.

Check if a pattern is guaranteed to match once a given byte offset is reached.

Link copied to clipboard
@JvmName(name = "isPatternNonLocal")
actual external fun isPatternNonLocal(index: UInt): Boolean

Check if the pattern with the given index is "non-local".

expect fun isPatternNonLocal(index: UInt): Boolean

Check if the pattern with the given index is "non-local".

@JvmName(name = "isPatternNonLocal")
actual external fun isPatternNonLocal(index: UInt): Boolean

Check if the pattern with the given index is "non-local".

actual fun isPatternNonLocal(index: UInt): Boolean

Check if the pattern with the given index is "non-local".

Link copied to clipboard
@JvmName(name = "isPatternRooted")
actual external fun isPatternRooted(index: UInt): Boolean

Check if the pattern with the given index has a single root node.

expect fun isPatternRooted(index: UInt): Boolean

Check if the pattern with the given index has a single root node.

@JvmName(name = "isPatternRooted")
actual external fun isPatternRooted(index: UInt): Boolean

Check if the pattern with the given index has a single root node.

actual fun isPatternRooted(index: UInt): Boolean

Check if the pattern with the given index has a single root node.

Link copied to clipboard
@JvmName(name = "settings")
actual fun settings(index: UInt): Map<String, String?>

Get the property settings for the given pattern index.

expect fun settings(index: UInt): Map<String, String?>

Get the property settings for the given pattern index.

@JvmName(name = "settings")
actual fun settings(index: UInt): Map<String, String?>

Get the property settings for the given pattern index.

actual fun settings(index: UInt): Map<String, String?>

Get the property settings for the given pattern index.

Link copied to clipboard
@JvmName(name = "startByteForPattern")
actual external fun startByteForPattern(index: UInt): UInt

Get the byte offset where the given pattern starts in the query's source.

expect fun startByteForPattern(index: UInt): UInt

Get the byte offset where the given pattern starts in the query's source.

@JvmName(name = "startByteForPattern")
actual external fun startByteForPattern(index: UInt): UInt

Get the byte offset where the given pattern starts in the query's source.

actual fun startByteForPattern(index: UInt): UInt

Get the byte offset where the given pattern starts in the query's source.

toString
Link copied to clipboard
open override fun toString(): String
open override fun toString(): String
open override fun toString(): String