Skip to main content
Home

latest
It is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
It is unknown whether this package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
47%
Published
a year ago (0.1.0)
class RecursiveDescentParser

Constructors

new
RecursiveDescentParser(tokens: T[])

Type Parameters

T extends { type?: string; }

Properties

private
current: number
private
readonly
tokens: T[]

Methods

Consume the current token and return it

Check if the current token is of the given type

consume(
type: string,
message?: string,
): T

Expect the current token to be of the given type, then advance

Check if we have used up all of the tokens

match(...types: string[]): boolean

Check if the current token matches one of the given types

Return the current token without consuming it

Return the most recently consumed token

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@idk/descent

Import symbol

import { RecursiveDescentParser } from "@idk/descent";
or

Import directly with a jsr specifier

import { RecursiveDescentParser } from "jsr:@idk/descent";

Add Package

pnpm i jsr:@idk/descent
or (using pnpm 10.8 or older)
pnpm dlx jsr add @idk/descent

Import symbol

import { RecursiveDescentParser } from "@idk/descent";

Add Package

yarn add jsr:@idk/descent
or (using Yarn 4.8 or older)
yarn dlx jsr add @idk/descent

Import symbol

import { RecursiveDescentParser } from "@idk/descent";

Add Package

vlt install jsr:@idk/descent

Import symbol

import { RecursiveDescentParser } from "@idk/descent";

Add Package

npx jsr add @idk/descent

Import symbol

import { RecursiveDescentParser } from "@idk/descent";

Add Package

bunx jsr add @idk/descent

Import symbol

import { RecursiveDescentParser } from "@idk/descent";