@nextera.one/tes-parser
v1.0.0
Published
TES (Temporal Expression Standard) parser — tokenizes and parses TES URI strings into a validated AST
Maintainers
Readme
@nextera.one/tes-parser
TES (Temporal Expression Standard) Parser
Lexer and parser that tokenizes tes:// URI strings into a validated AST (Abstract Syntax Tree).
Install
npm install @nextera.one/tes-parserUsage
import { parse, stringify } from "@nextera.one/tes-parser";
const ast = parse("tes://2026/April[5^50]@10:00!weekend");
// {
// kind: 'span',
// year: 2026,
// monthIndex: 3,
// monthName: 'April',
// startDay: 5,
// durationDays: 50,
// time: { h: 10, m: 0, s: 0 },
// excludes: ['weekend']
// }
const str = stringify(ast);
// 'tes://2026/April[5^50]@10:00!weekend'Grammar
TES = "tes://" Year "/" Expression ;
Expression = Month "[" Body "]" [Time] [Filter] ;
Body = Number | Number "^" Number ;
Time = "@" HH ":" mm [ ":" ss ] ;
Filter = "!" FilterList ;
FilterList = FilterItem { "," FilterItem } ;License
MIT — Nextera.one
