0.0.18 • Published 12 months ago

tarsec v0.0.18

Weekly downloads
-
License
ISC
Repository
-
Last release
12 months ago
 __
/\ \__
\ \ ,_\    __     _ __   ____     __    ___
 \ \ \/  /'__`\  /\`'__\/',__\  /'__`\ /'___\
  \ \ \_/\ \L\.\_\ \ \//\__, `\/\  __//\ \__/
   \ \__\ \__/.\_\\ \_\\/\____/\ \____\ \____\
    \/__/\/__/\/_/ \/_/ \/___/  \/____/\/____/

A parser combinator library for TypeScript, inspired by Parsec.

Install

npm install tarsec

Hello world

import { getResults, str, seq, space } from "tarsec";

// define a parser
const parser = seq([
    str("hello"),
    space,
    str("world")
], getResults);

// then use it
parser("hello world"); // success
parser("hello there"); // failure

Learning tarsec

Features

  • tarsec is entirely TypeScript. There's nothing to compile.
  • Derived types: tarsec will generate TypeScript types for your parser
  • Debug mode that prints what's happening step-by-step
  • Tools to debug your parser's performance
  • Partial backtracking support
  • A way to make your parser more secure.

Examples

Read more about use cases for tarsec.

Contributing

PRs for documentation, tests, and bug fixes are welcome.

0.0.17

12 months ago

0.0.18

12 months ago

0.0.16

1 year ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago