* The options object for adding a token to XRegExp.
| 180 | * The options object for adding a token to XRegExp. |
| 181 | */ |
| 182 | interface TokenOptions { |
| 183 | /** |
| 184 | * Scope where the token applies: `default`, `class`, or `all`. |
| 185 | */ |
| 186 | scope?: TokenScopeOption; |
| 187 | |
| 188 | /** |
| 189 | * Single-character flag that triggers the token. This also registers the |
| 190 | * flag, which prevents XRegExp from throwing an 'unknown flag' error when the flag is used. |
| 191 | */ |
| 192 | flag?: TokenFlag; |
| 193 | |
| 194 | /** |
| 195 | * Any custom flags checked for within the token `handler` that are |
| 196 | * not required to trigger the token. This registers the flags, to prevent XRegExp from |
| 197 | * throwing an 'unknown flag' error when any of the flags are used. |
| 198 | */ |
| 199 | optionalFlags?: string; |
| 200 | |
| 201 | /** |
| 202 | * Whether the `handler` function's output should not be treated as |
| 203 | * final, and instead be reparseable by other tokens (including the current token). Allows |
| 204 | * token chaining or deferring. |
| 205 | */ |
| 206 | reparse?: boolean; |
| 207 | |
| 208 | /** |
| 209 | * Single character that occurs at the beginning of any successful match |
| 210 | * of the token (not always applicable). This doesn't change the behavior of the token unless |
| 211 | * you provide an erroneous value. However, providing it can increase the token's performance |
| 212 | * since the token can be skipped at any positions where this character doesn't appear. |
| 213 | */ |
| 214 | leadChar?: string; |
| 215 | } |
| 216 | |
| 217 | /** |
| 218 | * Repesents a list of named capture groups. Only valid if the `namespacing` feature is turned on. |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…