From f45b6508a428aba052e02f84f27fff27a62310b2 Mon Sep 17 00:00:00 2001 From: Nicolas Zozol <912634+nicolas-zozol@users.noreply.github.com> Date: Wed, 19 Nov 2025 09:28:38 +0100 Subject: [PATCH 1/3] fix(doc): Adding real llm.txt --- llm.txt | 9273 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 9265 insertions(+), 8 deletions(-) diff --git a/llm.txt b/llm.txt index 92dba86..707842d 100644 --- a/llm.txt +++ b/llm.txt @@ -1,11 +1,9268 @@ -## Note for AI assistants πŸ€– +You are an AI assistant helping developers use **Masala Parser v2**. -If you're an AI assistant helping a developer: +- Language: JavaScript and TypeScript. +- Core concepts: parser combinators, Parsec-like API, streams. +- Always prefer real APIs and examples from this file. +- If something is unclear or not documented, say it explicitly. + +Below is a curated snapshot of the docs, tests and examples, generated with git-ingest tool. + +Each section starts with : +" +================================================ +FILE: +================================================ +" + + + +Directory structure: +└── masala-masala-parser/ + └── ingest/ + β”œβ”€β”€ README.md + β”œβ”€β”€ documentation/ + β”‚ β”œβ”€β”€ chain.md + β”‚ β”œβ”€β”€ chars-bundle.md + β”‚ β”œβ”€β”€ flow-bundle.md + β”‚ β”œβ”€β”€ genlex.md + β”‚ β”œβ”€β”€ numbers-bundle.md + β”‚ β”œβ”€β”€ parser-core-functions.md + β”‚ β”œβ”€β”€ parser-extension-functions.md + β”‚ β”œβ”€β”€ publish.md + β”‚ β”œβ”€β”€ recursion.md + β”‚ β”œβ”€β”€ troubleshooting.md + β”‚ └── tuple.md + β”œβ”€β”€ examples/ + β”‚ β”œβ”€β”€ index.ts + β”‚ β”œβ”€β”€ 1-easy/ + β”‚ β”‚ β”œβ”€β”€ chars.spec.ts + β”‚ β”‚ β”œβ”€β”€ floor.spec.ts + β”‚ β”‚ β”œβ”€β”€ hello-something.spec.ts + β”‚ β”‚ β”œβ”€β”€ number.spec.ts + β”‚ β”‚ β”œβ”€β”€ occurence.spec.ts + β”‚ β”‚ └── response.spec.ts + β”‚ β”œβ”€β”€ 2-medium/ + β”‚ β”‚ β”œβ”€β”€ f-layer.spec.ts + β”‚ β”‚ β”œβ”€β”€ filter-match.spec.ts + β”‚ β”‚ β”œβ”€β”€ flat-map.spec.ts + β”‚ β”‚ └── real-world-flatmap.spec.ts + β”‚ β”œβ”€β”€ brainfuck/ + β”‚ β”‚ └── compiler.spec.ts + β”‚ β”œβ”€β”€ chars/ + β”‚ β”‚ β”œβ”€β”€ charIn-notChar.spec.ts + β”‚ β”‚ └── letter-letterAs.spec.ts + β”‚ β”œβ”€β”€ flow/ + β”‚ β”‚ β”œβ”€β”€ nop-any-eos.spec.ts + β”‚ β”‚ β”œβ”€β”€ not.spec.ts + β”‚ β”‚ β”œβ”€β”€ startWith-moveUntil-dropTo.spec.ts + β”‚ β”‚ └── try-with-no-or.spec.ts + β”‚ β”œβ”€β”€ lazy/ + β”‚ β”‚ └── transmission.spec.ts + β”‚ β”œβ”€β”€ markdown/ + β”‚ β”‚ β”œβ”€β”€ lib/ + β”‚ β”‚ β”‚ β”œβ”€β”€ bullet-parser.ts + β”‚ β”‚ β”‚ β”œβ”€β”€ code-line-parser.ts + β”‚ β”‚ β”‚ β”œβ”€β”€ document-parser.ts + β”‚ β”‚ β”‚ β”œβ”€β”€ front-matter.ts + β”‚ β”‚ β”‚ β”œβ”€β”€ text-parser.ts + β”‚ β”‚ β”‚ β”œβ”€β”€ title-parser.ts + β”‚ β”‚ β”‚ β”œβ”€β”€ token.ts + β”‚ β”‚ β”‚ └── types.ts + β”‚ β”‚ └── test/ + β”‚ β”‚ β”œβ”€β”€ bullet-test.ts + β”‚ β”‚ β”œβ”€β”€ code-block-test.ts + β”‚ β”‚ β”œβ”€β”€ document-test.ts + β”‚ β”‚ β”œβ”€β”€ front-matter.spec.ts + β”‚ β”‚ β”œβ”€β”€ markdown-test.ts + β”‚ β”‚ β”œβ”€β”€ text-test.ts + β”‚ β”‚ β”œβ”€β”€ title-test.ts + β”‚ β”‚ └── samples/ + β”‚ β”‚ β”œβ”€β”€ paragraph-expected.json + β”‚ β”‚ β”œβ”€β”€ paragraph-test.md + β”‚ β”‚ β”œβ”€β”€ trivial-expected.json + β”‚ β”‚ └── trivial-test.md + β”‚ β”œβ”€β”€ operations/ + β”‚ β”‚ └── plus-minus.spec.ts + β”‚ β”œβ”€β”€ opt-and-rep/ + β”‚ β”‚ β”œβ”€β”€ forever-parse.spec.ts + β”‚ β”‚ β”œβ”€β”€ forever-parse.worker.mjs + β”‚ β”‚ β”œβ”€β”€ opt.spec.ts + β”‚ β”‚ β”œβ”€β”€ optrep.spec.ts + β”‚ β”‚ └── rep.spec.ts + β”‚ β”œβ”€β”€ tuple/ + β”‚ β”‚ └── tuple.spec.ts + β”‚ └── tuple-parser/ + β”‚ └── tuple-parser.spec.ts + └── test/ + β”œβ”€β”€ data/ + β”‚ β”œβ”€β”€ option.spec.js + β”‚ β”œβ”€β”€ try.spec.js + β”‚ └── tuple.spec.js + β”œβ”€β”€ genlex/ + β”‚ β”œβ”€β”€ genlex-brainfuck.spec.js + β”‚ β”œβ”€β”€ genlex-coverage.spec.js + β”‚ β”œβ”€β”€ genlex-event-tracer.spec.js + β”‚ β”œβ”€β”€ genlex-nospace.spec.js + β”‚ β”œβ”€β”€ genlex-priority.spec.js + β”‚ β”œβ”€β”€ genlex-tracer-minimal.spec.js + β”‚ β”œβ”€β”€ genlex.spec.js + β”‚ β”œβ”€β”€ tracing-genlex-coverage.spec.js + β”‚ └── tracing-genlex-flush.spec.js + β”œβ”€β”€ parsec/ + β”‚ β”œβ”€β”€ chars-bundle-regex.spec.js + β”‚ β”œβ”€β”€ chars-bundle-test.spec.js + β”‚ β”œβ”€β”€ f-layer-test.spec.js + β”‚ β”œβ”€β”€ flow-bundle-test.spec.js + β”‚ β”œβ”€β”€ flow-move-until.spec.js + β”‚ β”œβ”€β”€ flow-regex-flags.spec.js + β”‚ β”œβ”€β”€ flow-regex.spec.js + β”‚ β”œβ”€β”€ flow-try-or.spec.js + β”‚ β”œβ”€β”€ number-bundle-test.spec.js + β”‚ β”œβ”€β”€ parser-tuple-map.spec.js + β”‚ β”œβ”€β”€ parser_chain_test.spec.js + β”‚ β”œβ”€β”€ parser_core_default_test.spec.js + β”‚ β”œβ”€β”€ parser_core_test.spec.js + β”‚ β”œβ”€β”€ parser_extensions_test.spec.js + β”‚ β”œβ”€β”€ parser_stream_test.spec.js + β”‚ β”œβ”€β”€ response_test.spec.js + β”‚ └── tuple-parser-test.spec.js + β”œβ”€β”€ specific/ + β”‚ └── f-empty-try.spec.js + └── stream/ + β”œβ”€β”€ array-stream-test.spec.js + β”œβ”€β”€ buffered_stream_test.spec.js + β”œβ”€β”€ offset-test.spec.js + └── stream_test.spec.js + +================================================ +FILE: ingest/README.md +================================================ +# Masala Parser: Javascript Parser Combinators + +[![npm version](https://badge.fury.io/js/%40masala%2Fparser.svg)](https://badge.fury.io/js/%40masala%2Fparser) +[![Coverage Status](https://coveralls.io/repos/d-plaindoux/masala-parser/badge.png?branch=master)](https://coveralls.io/r/d-plaindoux/masala-parser?branch=master) +[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges) + +Masala Parser is an Open source javascript library to create your own parsers. +You won't need theoretical bases on languages for many usages. + +Masala Parser shines for **simplicity**, **variations** and **maintainability** +of your parsers. Typescript support and token export for AI processing will also +help you in the debug process. + +![absolute-demo.png](documentation/images/absolute-demo.png) + +Masala Parser started in 2016 as a Javascript implementation of the Haskell +**Parsec** and is inspired by the paper titled: +[Direct Style Monadic Parser Combinators For The Real World](https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/parsec-paper-letter.pdf). + +It is plain Javascript that works in the browser, is tested with more than 500 +unit tests, covering 100% of code lines. + +### Use cases + +Here are the pros of Masala Parser: + +- It can create a **full parser from scratch** +- It can **replace complex regexp** +- It works in any **browser** or NodeJS +- There is an **incredible typescript** api +- It has some **good performances** in speed and memory +- There is zero dependency +- Masala is actively supported by [Robusta Build](https://www.robusta.build) + +# Usage + +We made a **7 minutes** Youtube video to explain how to create a parser: + +[![Masala Parser Youtube Video](documentation/images/masala-yt.png)](https://www.youtube.com/watch?v=VNUrvWdtM2g) + +### Installation + +With Node Js or modern build + + npm install -S @masala/parser + yarn add @masala/parser + +Or in the browser, using Javascript ES Modules: + + import {F, standard, Streams} from 'https://unpkg.com/@masala/parser@2.0.0 + +- [download Release](https://github.com/d-plaindoux/masala-parser/releases) +- `