@temperlang/std 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/regex.js.map CHANGED
@@ -1 +1 @@
1
- { "version": 3, "file": "OUTPUT_ROOT/temper-std/js/regex.js", "sources": [ "std/regex.temper.md" ], "sourcesContent": [ "# Regex Data Model and Functionality\n\nThe structural data model for regex patterns enables direct construction, and\nthe Temper regex dialect compiles static regex text patterns to these objects.\n\nA focus here is on providing tools people can actually reach for when they need\nto do text processing. The execution should be faster on backends like Python\nthan writing raw code, and the implementation in backends like C should\napproximate what you'd like to have written manually.\n\nDue to inadequate and distinct Unicode handling in backend regex engines, the\ninitial feature set avoids character classes and properties but is still aware\nof code points. Parsing focused on limited sets of delimiters works best for\nnow.\n\nThe core feature set here focuses on both the data model and utility functions,\nsuch as matching regexes against strings.\n\n## Regex Data Model\n\nAll regexes are composed hierarchically of `Regex` nodes. Regexes are a\nsequence of component parts. For example, `/hi./` is a sequence of\n[CodePoint](#codepoint) `/h/` and `/i/` and dot `/./`.\n\nAnd perhaps the most fundamental `Regex` is the [Sequence](#sequence),\nbecause it enables multiple regex components to be strung together.\n\n```\nexport /*sealed*/ interface Regex {\n```\n\nBefore a regex is used, it must be compiled. Some helper functions compile on\nthe fly, although it is faster to reuse a pre-compiled regex.\n\n```\n // TODO(tjp, regex): Make this into a macro behind the scenes.\n // TODO(tjp, regex): `compiled\u003cT\u003e(): CompiledRegex\u003cT\u003e`\n public compiled(): CompiledRegex { new CompiledRegex(this) }\n```\n\nThe simplest use of a regular expression is if it is found in a string.\nRepeatedly calling these methods on a single `Regex` instance is inefficient.\nBetter for reuse is to compile in advance.\n\n```\n public found(text: String): Boolean { compiled().found(text) }\n```\n\nYou can also return match details or perform text replacement. The returned\ngroups map contains an entry for each key in the order defined in the regex\npattern. If no \u0022full\u0022 group is defined, one is added automatically to capture\nthe full matched text.\n\nIn the future, we intend to support customized match types with fields to match\ncapture groups, statically checked where possible.\n\n```\n // TODO(tjp, regex): Also macro because reification.\n // TODO(tjp, regex): `find\u003cT = Map\u003cString, Group\u003e\u003e(): T | NoResult`\n public find(text: String): Map\u003cString, Group\u003e | NoResult {\n compiled().find(text)\n }\n\n public replace(\n text: String, format: fn (Map\u003cString, Group\u003e): String\n ): String {\n compiled().replace(text, format)\n }\n```\n\nThat's it for what you can do with regex patterns in Temper today, but there's\nmuch more to say on what kinds of regexes can be built.\n\n```\n}\n```\n\n## Regex Item Types\n\nA `Regex` is composed of a potential variety of subtypes.\n\n### Groups\n\nMultiple types of groups exist:\n\n- [Capture](#capture) `/(?\u003cname\u003e...)/` to remember match groups for later use.\n- Non-capturing group syntax `/(?:...)/`, which is simply a [Regex](#regex)\n instance in the data model.\n\n### Capture\n\nTODO(tjp, regex): Change to named captures only!\n\n`Capture` is a [group](#groups) that remembers the matched text for later\naccess. Temper supports only named matches, with current intended syntax\n`/(?name = ...)/`.\n\n```\nexport class Capture extends Regex {\n public name: String;\n public /*early*/ item: Regex;\n}\n```\n\n### CodePart\n\nA component of a [CodeSet][#codeset], aka character class, which applies to a\nsubset of regex data types.\n\nHere, \u0022code\u0022 is short for \u0022code point\u0022 although \u0022char\u0022 might work better,\ndepending on expectations.\n\n```\nexport /*sealed*/ interface CodePart extends Regex {}\n```\n\n### CodePoints\n\nOne or more verbatim code points, where the sequence matters if within a\n[Regex](#regex) or not if within a [CodeSet](#codeset). Some escapes in\ntextual regex source, such as `/\\t/`, can be stored as raw code points.\n\nThe `String` here can enable more efficient storage than individual code\npoints, although the source text may require non-capture grouping. For example,\n`/(?:abc)?/` optionally matches the string `\u0022abc\u0022`, whereas `/abc?/` matches\n`\u0022ab\u0022` with an optional `\u0022c\u0022`.\n\n```\nexport class CodePoints extends CodePart {\n public value: String;\n}\n```\n\n### Specials\n\nA number of special match forms exist. In the data model, these are empty\nclasses.\n\n- `.` - `Dot` In default mode, matches any Unicode code point except newline.\n- `^` - `Begin` in default mode matches zero-length at the beginning of a\n string.\n- `\u0024` - `End` in default mode matches zero-length at the end of a string.\n- `\\b` - `WordBoundary` matches zero-length at the boundary between word and\n non-word code points. More sophisticated Unicode compliance is TBD.\n- `\\s` (negated as `\\S`) - `Space` matches any horizontal space code point.\n Details are TBD.\n- `\\w` (negated as `\\W`) - `Word` matches any word code point. Details are TBD.\n This is currently defined in terms of old ASCII definitions because those are\n clear. Perhaps this will stay that way, and Unicode properties like `\\p{L}`\n will be used for human language needs.\n- `\\X` - `GraphemeCluster` might not be supported, but [here is some discussion\n of how to implement it](\n https://github.com/rust-lang/regex/issues/54#issuecomment-661905060).\n\n\u003cdetails\u003e\n\n```\nexport /*sealed*/ interface Special extends Regex {}\nexport let Begin = do { class Begin extends Special {}; new Begin() };\nexport let Dot = do { class Dot extends Special {}; new Dot() };\nexport let End = do { class End extends Special {}; new End() };\n// TODO(tjp, regex): We can't easily support this at present across backends.\n// export let GraphemeCluster = do {\n// class GraphemeCluster extends Special {}; new GraphemeCluster()\n// };\nexport let WordBoundary = do {\n class WordBoundary extends Special {}; new WordBoundary()\n};\n\nexport /*sealed*/ interface SpecialSet extends CodePart \u0026 Special {}\nexport let Digit = do { class Digit extends SpecialSet {}; new Digit() };\nexport let Space = do { class Space extends SpecialSet {}; new Space() };\nexport let Word = do { class Word extends SpecialSet {}; new Word() };\n```\n\n\u003c/details\u003e\n\n### CodeRange\n\nA code point range matches any code point in its inclusive bounds, such as\n`/[a-c]/`. In source, `-` is included in a code set either by escaping or by\nincluding it as the first or last character. A `CodeRange` is usually contained\ninside a [CodeSet](#codeset), and syntactically always is.\n\n```\nexport class CodeRange extends CodePart {\n public min: Int;\n public max: Int;\n}\n```\n\n### CodeSet\n\nA set of code points, any of which can match, such as `/[abc]/` matching any of\n`\u0022a\u0022`, `\u0022b\u0022`, or `\u0022c\u0022`. Alternatively, a negated set is the inverse of the code\npoints given, such as `/[^abc]/`, matching any code point that's not any of\nthese. This is also often called a character class.\n\nFurther, a subset of [specials](#specials) can also be used in code sets. A\nnegated code set of just a special set often has custom syntax. For example,\nnon-space can be said as either `/[^\\s]/` or `/\\S/`.\n\n```\nexport class CodeSet extends Regex {\n public items: List\u003cCodePart\u003e;\n public negated: Boolean = false;\n}\n```\n\n### Or\n\n`Or` matches any one of multiple options, such as `/ab|cd|e*/`.\n\n```\nexport class Or extends Regex {\n public /*early*/ items: List\u003cRegex\u003e;\n}\n```\n\n### Repeat\n\n`Repeat` matches from an minimum to a maximum number of repeats of a\nsubregex. This can be represented in regex source in a number of ways:\n\n- `?` matches 0 or 1.\n- `*` matches 0 or more.\n- `+` matches 1 or more.\n- `{m}` matches exactly `m` repetitions.\n- `{m,n}` matches between `m` and `n`. Missing `n` is a max of infinity. For\n example, `{0,1}` is equivalent to `?`, and `{1,}` is equivalent to `+`.\n\nBy default, repetitions are greedy, matching as many repetitions as possible.\nIn regex source, any of the above can have `?` appended to indicated reluctant\n(aka non-greedy), matching as few repetitions as possible.\n\n```\nexport class Repeat extends Regex {\n public /*early*/ item: Regex;\n public min: Int;\n public max: Int | Null; // where null means infinite\n public reluctant: Boolean = false;\n}\n```\n\nWe also have convenience builders.\n\n```\nexport let entire(item: Regex): Regex {\n new Sequence([Begin, item, End])\n}\n\nexport let oneOrMore(item: Regex, reluctant: Boolean = false): Repeat {\n { item, min: 1, max: null, reluctant }\n}\n\nexport let optional(item: Regex, reluctant: Boolean = false): Repeat {\n { item, min: 0, max: 1, reluctant }\n}\n```\n\n### Sequence\n\n`Sequence` strings along multiple other regexes in order.\n\n```\nexport class Sequence extends Regex {\n public /*early*/ items: List\u003cRegex\u003e;\n}\n```\n\n## Match Objects\n\nFor detailed match results, call `find` on a regex to get a `Map` object from\n`String` keys to `Group` values.\n\n```\n// TODO Go back to a `Match` object with `groups` as a member so we can also\n// TODO easily return metadata alongside groups? Or is simpler better?\n// export class Match { // interface ... \u003cT = Map\u003cString, Group\u003e\u003e {\n// public let groups: Map\u003cString, Group\u003e;\n// }\n\nexport class Group {\n public let name: String;\n public let value: String;\n public let codePointsBegin: Int;\n}\n```\n\n## Compiled Regex Objects\n\nThe compiled form of a regex is mostly opaque, but it can be cached for more\nefficient reuse than working from a source [Regex](#regex-data-model).\n\n\u003cdetails\u003e\n\n```\n// Provides a workaround for access to std/regex from extension methods.\nclass RegexRefs {\n public let codePoints: CodePoints = new CodePoints(\u0022\u0022);\n public let group: Group = { name: \u0022\u0022, value: \u0022\u0022, codePointsBegin: 0 }\n public let orObject: Or = new Or([]);\n}\n\nlet regexRefs = new RegexRefs();\n```\n\n\u003c/details\u003e\n\n```\n// TODO(tjp, regex): Generate subtypes of this interface later.\nexport class CompiledRegex { // interface ... \u003cT\u003e {\n```\n\nThe source `Regex` data is still available on compiled objects in case it's\nneeded for composition or other purposes.\n\n```\n public let data: Regex;\n\n public constructor(data: Regex) {\n this.data = data;\n compiled = compileFormatted(format());\n }\n```\n\nA compiled regex exposes many of the same capabilities as `Regex`, but they are\nmore efficient to use repeatedly.\n\n```\n public found(text: String): Boolean { compiledFound(compiled, text) }\n\n public find(text: String): Map\u003cString, Group\u003e | NoResult {\n compiledFind(compiled, text, regexRefs)\n }\n\n public replace(\n text: String, format: fn (Map\u003cString, Group\u003e): String\n ): String {\n compiledReplace(compiled, text, format, regexRefs)\n }\n```\n\nTODO(tjp, regex): Public method for replace with named references.\nTODO(tjp, regex): Any static checking?\n\n\u003cdetails\u003e\n\n```\n let compiled: AnyValue;\n\n // Extension functions on some backends need the private `compiled` value\n // passed in directly.\n @connected(\u0022CompiledRegex::compiledFound\u0022)\n compiledFound(compiled: AnyValue, text: String): Boolean;\n\n @connected(\u0022CompiledRegex::compiledFind\u0022)\n compiledFind(\n compiled: AnyValue, text: String, regexRefs: RegexRefs\n ): Map\u003cString, Group\u003e | NoResult;\n\n @connected(\u0022CompiledRegex::compileFormatted\u0022)\n compileFormatted(formatted: String): AnyValue;\n\n @connected(\u0022CompiledRegex::compiledReplace\u0022)\n compiledReplace(\n compiled: AnyValue,\n text: String,\n format: fn (Map\u003cString, Group\u003e): String,\n regexRefs: RegexRefs,\n ): String;\n\n @connected(\u0022CompiledRegex::format\u0022)\n format(): String { new RegexFormatter().format(data) }\n```\n\n\u003c/details\u003e\n\n```\n}\n```\n\n## Private implementation matters\n\nSome regex logic can be shared across backends. These features aren't directly\nexported to the user, however.\n\nThe intent is that these support features only get included in compiled Temper\ncode if usage depends on dynamically constructed regexes. If all regex building\nis done as stable values, we hope to generated backend compiled regexes purely\nat Temper compile time.\n\n### RegexFormatter\n\n\u003cdetails\u003e\n\n```\nclass RegexFormatter {\n let out: ListBuilder\u003cString\u003e = new ListBuilder\u003cString\u003e();\n\n public format(regex: Regex): String {\n pushRegex(regex)\n out.join(\u0022\u0022) { (x);; x }\n }\n\n pushRegex(regex: Regex): Void {\n match (regex) {\n // Aggregate types.\n is Capture -\u003e pushCapture(regex);\n is CodePoints -\u003e pushCodePoints(regex, false);\n is CodeRange -\u003e pushCodeRange(regex);\n is CodeSet -\u003e pushCodeSet(regex);\n is Or -\u003e pushOr(regex);\n is Repeat -\u003e pushRepeat(regex);\n is Sequence -\u003e pushSequence(regex);\n // Specials.\n // Some of these will need to be customized on future backends.\n Begin -\u003e out.add(\u0022^\u0022);\n Dot -\u003e out.add(\u0022.\u0022);\n End -\u003e out.add(\u0022\u0024\u0022);\n WordBoundary -\u003e out.add(\u0022\\\\b\u0022);\n // Special sets.\n Digit -\u003e out.add(\u0022\\\\d\u0022);\n Space -\u003e out.add(\u0022\\\\s\u0022);\n Word -\u003e out.add(\u0022\\\\w\u0022);\n // ...\n }\n }\n\n pushCapture(capture: Capture): Void {\n out.add(\u0022(\u0022);\n // TODO(tjp, regex): Consistent name validation rules for all backends???\n // TODO(tjp, regex): Validate here or in `Capture` constructor???\n // TODO(tjp, regex): Validate here or where against reused names???\n pushCaptureName(out, capture.name);\n pushRegex(capture.item);\n out.add(\u0022)\u0022);\n }\n\n @connected(\u0022RegexFormatter::pushCaptureName\u0022)\n pushCaptureName(out: ListBuilder\u003cString\u003e, name: String): Void {\n // All so far except Python use this form.\n out.add(\u0022?\u003c\u0024{name}\u003e\u0022);\n }\n\n pushCode(code: Int, insideCodeSet: Boolean): Void {\n // Expose private property to extension.\n pushCodeTo(out, code, insideCodeSet);\n // TODO(tjp, regex): Implement more in Temper once we can.\n // if (escapeCodes[code] \u0026\u0026 false) {\n // out.add(\u0022\\\\\u0022);\n // // TODO(tjp, regex): How to convert back to strings?\n // }\n }\n\n @connected(\u0022RegexFormatter::pushCodeTo\u0022)\n pushCodeTo(out: ListBuilder\u003cString\u003e, code: Int, insideCodeSet: Boolean): Void;\n\n pushCodePoints(codePoints: CodePoints, insideCodeSet: Boolean): Void {\n for (\n var slice = codePoints.value.codePoints;\n !slice.isEmpty;\n slice = slice.advance(1)\n ) {\n pushCode(slice.read(), insideCodeSet);\n }\n }\n\n pushCodeRange(codeRange: CodeRange): Void {\n out.add(\u0022[\u0022);\n pushCodeRangeUnwrapped(codeRange);\n out.add(\u0022]\u0022);\n }\n\n pushCodeRangeUnwrapped(codeRange: CodeRange): Void {\n pushCode(codeRange.min, true);\n out.add(\u0022-\u0022);\n pushCode(codeRange.max, true);\n }\n\n pushCodeSet(codeSet: CodeSet): Void {\n let adjusted = adjustCodeSet(codeSet, regexRefs);\n match (adjusted) {\n is CodeSet -\u003e do {\n out.add(\u0022[\u0022);\n if (adjusted.negated) {\n out.add(\u0022^\u0022);\n }\n for (var i = 0; i \u003c adjusted.items.length; i += 1) {\n pushCodeSetItem(adjusted.items[i]);\n }\n out.add(\u0022]\u0022);\n }\n else -\u003e pushRegex(adjusted);\n }\n }\n\n @connected(\u0022RegexFormatter::adjustCodeSet\u0022)\n adjustCodeSet(codeSet: CodeSet, regexRefs: RegexRefs): Regex { codeSet }\n\n pushCodeSetItem(codePart: CodePart): Void {\n match (codePart) {\n is CodePoints -\u003e pushCodePoints(codePart, true);\n is CodeRange -\u003e pushCodeRangeUnwrapped(codePart);\n is SpecialSet -\u003e pushRegex(codePart);\n }\n }\n\n pushOr(or: Or): Void {\n if (!or.items.isEmpty) {\n out.add(\u0022(?:\u0022);\n // TODO(tjp, regex): See #822. Until `this` works better, no this in funs.\n // TODO(tjp, regex): So just manually loop here. Sometimes faster, anyway?\n pushRegex(or.items[0]);\n for (var i = 1; i \u003c or.items.length; i += 1) {\n out.add(\u0022|\u0022);\n pushRegex(or.items[i]);\n }\n out.add(\u0022)\u0022);\n }\n }\n\n pushRepeat(repeat: Repeat): Void {\n // Always wrap the main sub-pattern here to make life easy\n out.add(\u0022(?:\u0022);\n pushRegex(repeat.item);\n out.add(\u0022)\u0022);\n // Then add the repetition part.\n let min = repeat.min;\n let max = repeat.max;\n if (false) {\n } else if (min == 0 \u0026\u0026 max == 1) {\n out.add(\u0022?\u0022);\n } else if (min == 0 \u0026\u0026 max == null) {\n out.add(\u0022*\u0022);\n } else if (min == 1 \u0026\u0026 max == null) {\n out.add(\u0022+\u0022);\n } else {\n out.add(\u0022{\u0024{min.toString()}\u0022);\n if (min != max) {\n out.add(\u0022,\u0022);\n if (max != null) {\n out.add(max.as\u003cInt\u003e().toString());\n }\n }\n out.add(\u0022}\u0022);\n }\n if (repeat.reluctant) {\n out.add(\u0022?\u0022);\n }\n }\n\n pushSequence(sequence: Sequence): Void {\n // TODO(tjp, regex): Foreach loop/function would be nice.\n for (var i = 0; i \u003c sequence.items.length; i += 1) {\n pushRegex(sequence.items[i]);\n }\n }\n\n // Put this here instead of the data model for now because I'm not sure this\n // makes sense to be part of the public api right now.\n public maxCode(codePart: CodePart): Int | Null {\n match (codePart) {\n is CodePoints -\u003e do {\n // Iterating code points is the hardest of the current cases.\n let value = codePart.value;\n if (value.isEmpty) {\n null\n } else {\n // My kingdom for a fold, or even just a max, in builtins.\n var max = 0;\n for (\n var slice = value.codePoints;\n !slice.isEmpty;\n slice = slice.advance(1)\n ) {\n let next = slice.read();\n if (next \u003e max) {\n max = next;\n }\n }\n max\n }\n }\n // Others below are easy for now.\n is CodeRange -\u003e codePart.max;\n Digit -\u003e \u00229\u0022.codePoints.read();\n Space -\u003e \u0022 \u0022.codePoints.read();\n Word -\u003e \u0022z\u0022.codePoints.read();\n // Actually unexpected, ever, but eh.\n else -\u003e null;\n }\n }\n}\n\n// // TODO(tjp, regex): Delete all the below (comment included) if unused.\n// // TODO(tjp, regex): Replace all this with a compile-time regex once we can.\n// let escapeCodeList = [\n// \u0022\\\\\u0022.codePoints.read(),\n// \u0022^\u0022.codePoints.read(),\n// \u0022\u0024\u0022.codePoints.read(),\n// \u0022{\u0022.codePoints.read(),\n// \u0022[\u0022.codePoints.read(),\n// \u0022(\u0022.codePoints.read(),\n// \u0022}\u0022.codePoints.read(),\n// \u0022]\u0022.codePoints.read(),\n// \u0022)\u0022.codePoints.read(),\n// \u0022|\u0022.codePoints.read(),\n// \u0022+\u0022.codePoints.read(),\n// \u0022?\u0022.codePoints.read(),\n// \u0022/\u0022.codePoints.read(),\n// \u0022*\u0022.codePoints.read(),\n// ];\n// let escapeCodes = new DenseBitVector(128);\n// // This `for` loop has to be after type definitions for now because\n// // https://github.com/temper-lang/temper/issues/817\n// for (var i = 0; i \u003c escapeCodeList.length; i += 1) {\n// escapeCodes[i] = true;\n// }\n```\n\n\u003c/details\u003e\n" ], "names": [ "return", "CompiledRegex", "text", "format", "Regex", "compiled", "found", "find", "replace", "Capture", "name", "item", "CodePart", "CodePoints", "value", "Special", "SpecialSet", "CodeRange", "min", "max", "CodeSet", "items", "negated", "Or", "Repeat", "reluctant", "Sequence", "Group", "codePointsBegin", "RegexRefs", "codePoints", "group", "orObject", "data", "regexRefs", "RegexFormatter", "out", "regex", "fn", "x", "Begin", "Dot", "End", "WordBoundary", "Digit", "Space", "Word", "capture", "code", "insideCodeSet", "slice", "codeRange", "codeSet", "adjusted", "i", "codePart", "or", "repeat", "sequence", "next", "entire", "oneOrMore", "optional" ], "mappings": "AA4BA;AAAA;AAAA;AASS,QAAqD,iBAAA,AAArD,EAAqD,AAA3B,EAAA;AAAd,MAAAA,SAAa;AAAG,UAAuB,EAAA,AAAvB,IAAI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f,IAAI,CAAA6B,aAAS,EAAE,CAAA;AAA3B,4BAAS;AAAb,KAAI,CAAAK,aAAS,EAAG,MAAe,CAAA;AApR/B;AAAA,MAAAlC,UAAA,EAiXM,2BAAc,AAjXpB;AAqjBC,eAAAA,UAAA" }
1
+ { "version": 3, "file": "OUTPUT_ROOT/js/std/regex.js", "sources": [ "std/regex.temper.md" ], "sourcesContent": [ "# Regex Data Model and Functionality\n\nThe structural data model for regex patterns enables direct construction, and\nthe Temper regex dialect compiles static regex text patterns to these objects.\n\nA focus here is on providing tools people can actually reach for when they need\nto do text processing. The execution should be faster on backends like Python\nthan writing raw code, and the implementation in backends like C should\napproximate what you'd like to have written manually.\n\nDue to inadequate and distinct Unicode handling in backend regex engines, the\ninitial feature set avoids character classes and properties but is still aware\nof code points. Parsing focused on limited sets of delimiters works best for\nnow.\n\nThe core feature set here focuses on both the data model and utility functions,\nsuch as matching regexes against strings.\n\n## Regex Data Model\n\nAll regexes are composed hierarchically of `Regex` nodes. Regexes are a\nsequence of component parts. For example, `/hi./` is a sequence of\n[CodePoint](#codepoint) `/h/` and `/i/` and dot `/./`.\n\nAnd perhaps the most fundamental `Regex` is the [Sequence](#sequence),\nbecause it enables multiple regex components to be strung together.\n\n```\nexport /*sealed*/ interface Regex {\n```\n\nBefore a regex is used, it must be compiled. Some helper functions compile on\nthe fly, although it is faster to reuse a pre-compiled regex.\n\n```\n // TODO(tjp, regex): Make this into a macro behind the scenes.\n // TODO(tjp, regex): `compiled\u003cT\u003e(): CompiledRegex\u003cT\u003e`\n public compiled(): CompiledRegex { new CompiledRegex(this) }\n```\n\nThe simplest use of a regular expression is if it is found in a string.\nRepeatedly calling these methods on a single `Regex` instance is inefficient.\nBetter for reuse is to compile in advance.\n\n```\n public found(text: String): Boolean { compiled().found(text) }\n```\n\nYou can also return match details or perform text replacement. The returned\ngroups map contains an entry for each key in the order defined in the regex\npattern. If no \u0022full\u0022 group is defined, one is added automatically to capture\nthe full matched text.\n\nIn the future, we intend to support customized match types with fields to match\ncapture groups, statically checked where possible.\n\n```\n // TODO(tjp, regex): Also macro because reification.\n\n public find(text: String): Map\u003cString, Group\u003e | Bubble {\n compiled().find(text)\n }\n\n public replace(\n text: String, format: fn (Map\u003cString, Group\u003e): String\n ): String {\n compiled().replace(text, format)\n }\n```\n\nThat's it for what you can do with regex patterns in Temper today, but there's\nmuch more to say on what kinds of regexes can be built.\n\n```\n}\n```\n\n## Regex Item Types\n\nA `Regex` is composed of a potential variety of subtypes.\n\n### Groups\n\nMultiple types of groups exist:\n\n- [Capture](#capture) `/(?\u003cname\u003e...)/` to remember match groups for later use.\n- Non-capturing group syntax `/(?:...)/`, which is simply a [Regex](#regex)\n instance in the data model.\n\n### Capture\n\nTODO(tjp, regex): Change to named captures only!\n\n`Capture` is a [group](#groups) that remembers the matched text for later\naccess. Temper supports only named matches, with current intended syntax\n`/(?name = ...)/`.\n\n```\nexport class Capture extends Regex {\n public name: String;\n public /*early*/ item: Regex;\n}\n```\n\n### CodePart\n\nA component of a [CodeSet][#codeset], aka character class, which applies to a\nsubset of regex data types.\n\nHere, \u0022code\u0022 is short for \u0022code point\u0022 although \u0022char\u0022 might work better,\ndepending on expectations.\n\n```\nexport /*sealed*/ interface CodePart extends Regex {}\n```\n\n### CodePoints\n\nOne or more verbatim code points, where the sequence matters if within a\n[Regex](#regex) or not if within a [CodeSet](#codeset). Some escapes in\ntextual regex source, such as `/\\t/`, can be stored as raw code points.\n\nThe `String` here can enable more efficient storage than individual code\npoints, although the source text may require non-capture grouping. For example,\n`/(?:abc)?/` optionally matches the string `\u0022abc\u0022`, whereas `/abc?/` matches\n`\u0022ab\u0022` with an optional `\u0022c\u0022`.\n\n```\nexport class CodePoints extends CodePart {\n public value: String;\n}\n```\n\n### Specials\n\nA number of special match forms exist. In the data model, these are empty\nclasses.\n\n- `.` - `Dot` In default mode, matches any Unicode code point except newline.\n- `^` - `Begin` in default mode matches zero-length at the beginning of a\n string.\n- `\u0024` - `End` in default mode matches zero-length at the end of a string.\n- `\\b` - `WordBoundary` matches zero-length at the boundary between word and\n non-word code points. More sophisticated Unicode compliance is TBD.\n- `\\s` (negated as `\\S`) - `Space` matches any horizontal space code point.\n Details are TBD.\n- `\\w` (negated as `\\W`) - `Word` matches any word code point. Details are TBD.\n This is currently defined in terms of old ASCII definitions because those are\n clear. Perhaps this will stay that way, and Unicode properties like `\\p{L}`\n will be used for human language needs.\n- `\\X` - `GraphemeCluster` might not be supported, but [here is some discussion\n of how to implement it](\n https://github.com/rust-lang/regex/issues/54#issuecomment-661905060).\n\n\u003cdetails\u003e\n\n```\nexport /*sealed*/ interface Special extends Regex {}\nexport let Begin = do { class Begin extends Special {}; new Begin() };\nexport let Dot = do { class Dot extends Special {}; new Dot() };\nexport let End = do { class End extends Special {}; new End() };\n// TODO(tjp, regex): We can't easily support this at present across backends.\n// export let GraphemeCluster = do {\n// class GraphemeCluster extends Special {}; new GraphemeCluster()\n// };\nexport let WordBoundary = do {\n class WordBoundary extends Special {}; new WordBoundary()\n};\n\nexport /*sealed*/ interface SpecialSet extends CodePart \u0026 Special {}\nexport let Digit = do { class Digit extends SpecialSet {}; new Digit() };\nexport let Space = do { class Space extends SpecialSet {}; new Space() };\nexport let Word = do { class Word extends SpecialSet {}; new Word() };\n```\n\n\u003c/details\u003e\n\n### CodeRange\n\nA code point range matches any code point in its inclusive bounds, such as\n`/[a-c]/`. In source, `-` is included in a code set either by escaping or by\nincluding it as the first or last character. A `CodeRange` is usually contained\ninside a [CodeSet](#codeset), and syntactically always is.\n\n```\nexport class CodeRange extends CodePart {\n public min: Int;\n public max: Int;\n}\n```\n\n### CodeSet\n\nA set of code points, any of which can match, such as `/[abc]/` matching any of\n`\u0022a\u0022`, `\u0022b\u0022`, or `\u0022c\u0022`. Alternatively, a negated set is the inverse of the code\npoints given, such as `/[^abc]/`, matching any code point that's not any of\nthese. This is also often called a character class.\n\nFurther, a subset of [specials](#specials) can also be used in code sets. A\nnegated code set of just a special set often has custom syntax. For example,\nnon-space can be said as either `/[^\\s]/` or `/\\S/`.\n\n```\nexport class CodeSet extends Regex {\n public items: List\u003cCodePart\u003e;\n public negated: Boolean = false;\n}\n```\n\n### Or\n\n`Or` matches any one of multiple options, such as `/ab|cd|e*/`.\n\n```\nexport class Or extends Regex {\n public /*early*/ items: List\u003cRegex\u003e;\n}\n```\n\n### Repeat\n\n`Repeat` matches from an minimum to a maximum number of repeats of a\nsubregex. This can be represented in regex source in a number of ways:\n\n- `?` matches 0 or 1.\n- `*` matches 0 or more.\n- `+` matches 1 or more.\n- `{m}` matches exactly `m` repetitions.\n- `{m,n}` matches between `m` and `n`. Missing `n` is a max of infinity. For\n example, `{0,1}` is equivalent to `?`, and `{1,}` is equivalent to `+`.\n\nBy default, repetitions are greedy, matching as many repetitions as possible.\nIn regex source, any of the above can have `?` appended to indicated reluctant\n(aka non-greedy), matching as few repetitions as possible.\n\n```\nexport class Repeat extends Regex {\n public /*early*/ item: Regex;\n public min: Int;\n public max: Int | Null; // where null means infinite\n public reluctant: Boolean = false;\n}\n```\n\nWe also have convenience builders.\n\n```\nexport let entire(item: Regex): Regex {\n new Sequence([Begin, item, End])\n}\n\nexport let oneOrMore(item: Regex, reluctant: Boolean = false): Repeat {\n { item, min: 1, max: null, reluctant }\n}\n\nexport let optional(item: Regex, reluctant: Boolean = false): Repeat {\n { item, min: 0, max: 1, reluctant }\n}\n```\n\n### Sequence\n\n`Sequence` strings along multiple other regexes in order.\n\n```\nexport class Sequence extends Regex {\n public /*early*/ items: List\u003cRegex\u003e;\n}\n```\n\n## Match Objects\n\nFor detailed match results, call `find` on a regex to get a `Map` object from\n`String` keys to `Group` values.\n\n```\n// TODO Go back to a `Match` object with `groups` as a member so we can also\n// TODO easily return metadata alongside groups? Or is simpler better?\n// export class Match { // interface ... \u003cT = Map\u003cString, Group\u003e\u003e {\n// public let groups: Map\u003cString, Group\u003e;\n// }\n\nexport class Group {\n public let name: String;\n public let value: String;\n public let codePointsBegin: Int;\n}\n```\n\n## Compiled Regex Objects\n\nThe compiled form of a regex is mostly opaque, but it can be cached for more\nefficient reuse than working from a source [Regex](#regex-data-model).\n\n\u003cdetails\u003e\n\n```\n// Provides a workaround for access to std/regex from extension methods.\nclass RegexRefs {\n public let codePoints: CodePoints = new CodePoints(\u0022\u0022);\n public let group: Group = { name: \u0022\u0022, value: \u0022\u0022, codePointsBegin: 0 }\n public let orObject: Or = new Or([]);\n}\n\nlet regexRefs = new RegexRefs();\n```\n\n\u003c/details\u003e\n\n```\n// TODO(tjp, regex): Generate subtypes of this interface later.\nexport class CompiledRegex { // interface ... \u003cT\u003e {\n```\n\nThe source `Regex` data is still available on compiled objects in case it's\nneeded for composition or other purposes.\n\n```\n public let data: Regex;\n\n public constructor(data: Regex) {\n this.data = data;\n compiled = compileFormatted(format());\n }\n```\n\nA compiled regex exposes many of the same capabilities as `Regex`, but they are\nmore efficient to use repeatedly.\n\n```\n public found(text: String): Boolean { compiledFound(compiled, text) }\n\n public find(text: String): Map\u003cString, Group\u003e | Bubble {\n compiledFind(compiled, text, regexRefs)\n }\n\n public replace(\n text: String, format: fn (Map\u003cString, Group\u003e): String\n ): String {\n compiledReplace(compiled, text, format, regexRefs)\n }\n```\n\nTODO(tjp, regex): Public method for replace with named references.\nTODO(tjp, regex): Any static checking?\n\n\u003cdetails\u003e\n\n```\n let compiled: AnyValue;\n\n // Extension functions on some backends need the private `compiled` value\n // passed in directly.\n @connected(\u0022CompiledRegex::compiledFound\u0022)\n compiledFound(compiled: AnyValue, text: String): Boolean;\n\n @connected(\u0022CompiledRegex::compiledFind\u0022)\n compiledFind(\n compiled: AnyValue, text: String, regexRefs: RegexRefs\n ): Map\u003cString, Group\u003e | Bubble;\n\n @connected(\u0022CompiledRegex::compileFormatted\u0022)\n compileFormatted(formatted: String): AnyValue;\n\n @connected(\u0022CompiledRegex::compiledReplace\u0022)\n compiledReplace(\n compiled: AnyValue,\n text: String,\n format: fn (Map\u003cString, Group\u003e): String,\n regexRefs: RegexRefs,\n ): String;\n\n @connected(\u0022CompiledRegex::format\u0022)\n format(): String { new RegexFormatter().format(data) }\n```\n\n\u003c/details\u003e\n\n```\n}\n```\n\n## Private implementation matters\n\nSome regex logic can be shared across backends. These features aren't directly\nexported to the user, however.\n\nThe intent is that these support features only get included in compiled Temper\ncode if usage depends on dynamically constructed regexes. If all regex building\nis done as stable values, we hope to generated backend compiled regexes purely\nat Temper compile time.\n\n### RegexFormatter\n\n\u003cdetails\u003e\n\n```\nclass RegexFormatter {\n let out: ListBuilder\u003cString\u003e = new ListBuilder\u003cString\u003e();\n\n public format(regex: Regex): String {\n pushRegex(regex)\n out.join(\u0022\u0022) { (x);; x }\n }\n\n pushRegex(regex: Regex): Void {\n match (regex) {\n // Aggregate types.\n is Capture -\u003e pushCapture(regex);\n is CodePoints -\u003e pushCodePoints(regex, false);\n is CodeRange -\u003e pushCodeRange(regex);\n is CodeSet -\u003e pushCodeSet(regex);\n is Or -\u003e pushOr(regex);\n is Repeat -\u003e pushRepeat(regex);\n is Sequence -\u003e pushSequence(regex);\n // Specials.\n // Some of these will need to be customized on future backends.\n Begin -\u003e out.add(\u0022^\u0022);\n Dot -\u003e out.add(\u0022.\u0022);\n End -\u003e out.add(\u0022\u0024\u0022);\n WordBoundary -\u003e out.add(\u0022\\\\b\u0022);\n // Special sets.\n Digit -\u003e out.add(\u0022\\\\d\u0022);\n Space -\u003e out.add(\u0022\\\\s\u0022);\n Word -\u003e out.add(\u0022\\\\w\u0022);\n // ...\n }\n }\n\n pushCapture(capture: Capture): Void {\n out.add(\u0022(\u0022);\n // TODO(tjp, regex): Consistent name validation rules for all backends???\n // TODO(tjp, regex): Validate here or in `Capture` constructor???\n // TODO(tjp, regex): Validate here or where against reused names???\n pushCaptureName(out, capture.name);\n pushRegex(capture.item);\n out.add(\u0022)\u0022);\n }\n\n @connected(\u0022RegexFormatter::pushCaptureName\u0022)\n pushCaptureName(out: ListBuilder\u003cString\u003e, name: String): Void {\n // All so far except Python use this form.\n out.add(\u0022?\u003c\u0024{name}\u003e\u0022);\n }\n\n pushCode(code: Int, insideCodeSet: Boolean): Void {\n // Expose private property to extension.\n pushCodeTo(out, code, insideCodeSet);\n // TODO(tjp, regex): Implement more in Temper once we can.\n // if (escapeCodes[code] \u0026\u0026 false) {\n // out.add(\u0022\\\\\u0022);\n // // TODO(tjp, regex): How to convert back to strings?\n // }\n }\n\n @connected(\u0022RegexFormatter::pushCodeTo\u0022)\n pushCodeTo(out: ListBuilder\u003cString\u003e, code: Int, insideCodeSet: Boolean): Void;\n\n pushCodePoints(codePoints: CodePoints, insideCodeSet: Boolean): Void {\n for (\n var slice = codePoints.value.codePoints;\n !slice.isEmpty;\n slice = slice.advance(1)\n ) {\n pushCode(slice.read(), insideCodeSet);\n }\n }\n\n pushCodeRange(codeRange: CodeRange): Void {\n out.add(\u0022[\u0022);\n pushCodeRangeUnwrapped(codeRange);\n out.add(\u0022]\u0022);\n }\n\n pushCodeRangeUnwrapped(codeRange: CodeRange): Void {\n pushCode(codeRange.min, true);\n out.add(\u0022-\u0022);\n pushCode(codeRange.max, true);\n }\n\n pushCodeSet(codeSet: CodeSet): Void {\n let adjusted = adjustCodeSet(codeSet, regexRefs);\n match (adjusted) {\n is CodeSet -\u003e do {\n out.add(\u0022[\u0022);\n if (adjusted.negated) {\n out.add(\u0022^\u0022);\n }\n for (var i = 0; i \u003c adjusted.items.length; i += 1) {\n pushCodeSetItem(adjusted.items[i]);\n }\n out.add(\u0022]\u0022);\n }\n else -\u003e pushRegex(adjusted);\n }\n }\n\n @connected(\u0022RegexFormatter::adjustCodeSet\u0022)\n adjustCodeSet(codeSet: CodeSet, regexRefs: RegexRefs): Regex { codeSet }\n\n pushCodeSetItem(codePart: CodePart): Void {\n match (codePart) {\n is CodePoints -\u003e pushCodePoints(codePart, true);\n is CodeRange -\u003e pushCodeRangeUnwrapped(codePart);\n is SpecialSet -\u003e pushRegex(codePart);\n }\n }\n\n pushOr(or: Or): Void {\n if (!or.items.isEmpty) {\n out.add(\u0022(?:\u0022);\n // TODO(tjp, regex): See #822. Until `this` works better, no this in funs.\n // TODO(tjp, regex): So just manually loop here. Sometimes faster, anyway?\n pushRegex(or.items[0]);\n for (var i = 1; i \u003c or.items.length; i += 1) {\n out.add(\u0022|\u0022);\n pushRegex(or.items[i]);\n }\n out.add(\u0022)\u0022);\n }\n }\n\n pushRepeat(repeat: Repeat): Void {\n // Always wrap the main sub-pattern here to make life easy\n out.add(\u0022(?:\u0022);\n pushRegex(repeat.item);\n out.add(\u0022)\u0022);\n // Then add the repetition part.\n let min = repeat.min;\n let max = repeat.max;\n if (false) {\n } else if (min == 0 \u0026\u0026 max == 1) {\n out.add(\u0022?\u0022);\n } else if (min == 0 \u0026\u0026 max == null) {\n out.add(\u0022*\u0022);\n } else if (min == 1 \u0026\u0026 max == null) {\n out.add(\u0022+\u0022);\n } else {\n out.add(\u0022{\u0024{min.toString()}\u0022);\n if (min != max) {\n out.add(\u0022,\u0022);\n if (max != null) {\n out.add(max.as\u003cInt\u003e().toString());\n }\n }\n out.add(\u0022}\u0022);\n }\n if (repeat.reluctant) {\n out.add(\u0022?\u0022);\n }\n }\n\n pushSequence(sequence: Sequence): Void {\n // TODO(tjp, regex): Foreach loop/function would be nice.\n for (var i = 0; i \u003c sequence.items.length; i += 1) {\n pushRegex(sequence.items[i]);\n }\n }\n\n // Put this here instead of the data model for now because I'm not sure this\n // makes sense to be part of the public api right now.\n public maxCode(codePart: CodePart): Int | Null {\n match (codePart) {\n is CodePoints -\u003e do {\n // Iterating code points is the hardest of the current cases.\n let value = codePart.value;\n if (value.isEmpty) {\n null\n } else {\n // My kingdom for a fold, or even just a max, in builtins.\n var max = 0;\n for (\n var slice = value.codePoints;\n !slice.isEmpty;\n slice = slice.advance(1)\n ) {\n let next = slice.read();\n if (next \u003e max) {\n max = next;\n }\n }\n max\n }\n }\n // Others below are easy for now.\n is CodeRange -\u003e codePart.max;\n Digit -\u003e \u00229\u0022.codePoints.read();\n Space -\u003e \u0022 \u0022.codePoints.read();\n Word -\u003e \u0022z\u0022.codePoints.read();\n // Actually unexpected, ever, but eh.\n else -\u003e null;\n }\n }\n}\n```\n\n\u003c/details\u003e\n" ], "names": [ "CompiledRegex", "text", "format", "Regex", "compiled", "found", "find", "replace", "Capture", "name", "item", "CodePart", "CodePoints", "value", "Special", "SpecialSet", "CodeRange", "min", "max", "CodeSet", "items", "negated", "Or", "Repeat", "reluctant", "Sequence", "Group", "codePointsBegin", "RegexRefs", "codePoints", "group", "orObject", "data", "regexRefs", "RegexFormatter", "out", "regex", "fn", "x", "return", "Begin", "Dot", "End", "WordBoundary", "Digit", "Space", "Word", "capture", "code", "insideCodeSet", "slice", "codeRange", "codeSet", "adjusted", "i", "codePart", "or", "repeat", "sequence", "next", "entire", "oneOrMore", "optional" ], "mappings": "AA4BA;AAAA;AAAA;AASS,QAAqD,kBAAA,AAArD,EAAqD,AAA3B;AAAE,YAAI,CAAAA,aAAa,CAAC,IAAI,CAAC;AAAA;AAQnD,QAAuD,eAAA,AAAvD,CAAMC,QAAY,CAAqC,AAA1B;AAAE,QAAW,AAAX,KAAQ,CAAA,AAAR,QAAQ,EAAE,CAAC,KAAK,CAACA,QAAI,CAAC;AAAA;AAcrD,QAEN,cAAA,AAFM,CAAKA,QAAY,CAEvB,AAFsD;AACrD,QAAW,AAAX,KAAQ,CAAA,AAAR,QAAQ,EAAE,CAAC,IAAI,CAACA,QAAI,CAAC;AAAA;AAGhB,QAIN,iBAAA,AAJM,CACLA,QAAY,CAAE,CAAAC,UAAuC,CAGtD,AAFS;AACR,QAAW,AAAX,KAAQ,CAAA,AAAR,QAAQ,EAAE,CAAC,OAAO,CAACD,QAAI,CAAE,CAAAC,UAAM,CAAC;AAAA,CACjC;AAvCyB,uPAuCzB;AAvCyB,aAAAC,KAAA,+BAuCzB,CAAA,AAvCyB,EASnB,kBAAAC,iBAAqD,EAQrD,gBAAAC,cAAuD,EAcvD,eAAAC,aAEN,EAEM,kBAAAC,gBAIN,GAAA,AAvCyB,GAuCzB,C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Af,QAAA,AAArBA,aAAqB,IAAK,AAAL,KAAK,AAAL,EAAK,IAAA;AAA1B,IAAAA,aAAqB,EAAK,AAAL,MAAK;AAAA;AACzD,YAAE,CAAAD,MAAA,CAAAb,QAAI,CAAO,EAAC,CAAO,EAAC,CAAE,CAAAc,aAAS,CAAE;AAAA,CACpC;AA+CG,4BAAS;AAAb,KAAI,CAAAS,aAAS,EAAG,IAAI,CAAAL,aAAS,EAAE" }
package/regex__preface.js CHANGED
@@ -1,3 +0,0 @@
1
- /** @type {void} */
2
- const return_0 = void 0;
3
- export default return_0;
@@ -1 +1 @@
1
- { "version": 3, "file": "OUTPUT_ROOT/temper-std/js/regex__preface.js", "sources": [ "std/regex.temper.md" ], "sourcesContent": [ "# Regex Data Model and Functionality\n\nThe structural data model for regex patterns enables direct construction, and\nthe Temper regex dialect compiles static regex text patterns to these objects.\n\nA focus here is on providing tools people can actually reach for when they need\nto do text processing. The execution should be faster on backends like Python\nthan writing raw code, and the implementation in backends like C should\napproximate what you'd like to have written manually.\n\nDue to inadequate and distinct Unicode handling in backend regex engines, the\ninitial feature set avoids character classes and properties but is still aware\nof code points. Parsing focused on limited sets of delimiters works best for\nnow.\n\nThe core feature set here focuses on both the data model and utility functions,\nsuch as matching regexes against strings.\n\n## Regex Data Model\n\nAll regexes are composed hierarchically of `Regex` nodes. Regexes are a\nsequence of component parts. For example, `/hi./` is a sequence of\n[CodePoint](#codepoint) `/h/` and `/i/` and dot `/./`.\n\nAnd perhaps the most fundamental `Regex` is the [Sequence](#sequence),\nbecause it enables multiple regex components to be strung together.\n\n```\nexport /*sealed*/ interface Regex {\n```\n\nBefore a regex is used, it must be compiled. Some helper functions compile on\nthe fly, although it is faster to reuse a pre-compiled regex.\n\n```\n // TODO(tjp, regex): Make this into a macro behind the scenes.\n // TODO(tjp, regex): `compiled\u003cT\u003e(): CompiledRegex\u003cT\u003e`\n public compiled(): CompiledRegex { new CompiledRegex(this) }\n```\n\nThe simplest use of a regular expression is if it is found in a string.\nRepeatedly calling these methods on a single `Regex` instance is inefficient.\nBetter for reuse is to compile in advance.\n\n```\n public found(text: String): Boolean { compiled().found(text) }\n```\n\nYou can also return match details or perform text replacement. The returned\ngroups map contains an entry for each key in the order defined in the regex\npattern. If no \u0022full\u0022 group is defined, one is added automatically to capture\nthe full matched text.\n\nIn the future, we intend to support customized match types with fields to match\ncapture groups, statically checked where possible.\n\n```\n // TODO(tjp, regex): Also macro because reification.\n // TODO(tjp, regex): `find\u003cT = Map\u003cString, Group\u003e\u003e(): T | NoResult`\n public find(text: String): Map\u003cString, Group\u003e | NoResult {\n compiled().find(text)\n }\n\n public replace(\n text: String, format: fn (Map\u003cString, Group\u003e): String\n ): String {\n compiled().replace(text, format)\n }\n```\n\nThat's it for what you can do with regex patterns in Temper today, but there's\nmuch more to say on what kinds of regexes can be built.\n\n```\n}\n```\n\n## Regex Item Types\n\nA `Regex` is composed of a potential variety of subtypes.\n\n### Groups\n\nMultiple types of groups exist:\n\n- [Capture](#capture) `/(?\u003cname\u003e...)/` to remember match groups for later use.\n- Non-capturing group syntax `/(?:...)/`, which is simply a [Regex](#regex)\n instance in the data model.\n\n### Capture\n\nTODO(tjp, regex): Change to named captures only!\n\n`Capture` is a [group](#groups) that remembers the matched text for later\naccess. Temper supports only named matches, with current intended syntax\n`/(?name = ...)/`.\n\n```\nexport class Capture extends Regex {\n public name: String;\n public /*early*/ item: Regex;\n}\n```\n\n### CodePart\n\nA component of a [CodeSet][#codeset], aka character class, which applies to a\nsubset of regex data types.\n\nHere, \u0022code\u0022 is short for \u0022code point\u0022 although \u0022char\u0022 might work better,\ndepending on expectations.\n\n```\nexport /*sealed*/ interface CodePart extends Regex {}\n```\n\n### CodePoints\n\nOne or more verbatim code points, where the sequence matters if within a\n[Regex](#regex) or not if within a [CodeSet](#codeset). Some escapes in\ntextual regex source, such as `/\\t/`, can be stored as raw code points.\n\nThe `String` here can enable more efficient storage than individual code\npoints, although the source text may require non-capture grouping. For example,\n`/(?:abc)?/` optionally matches the string `\u0022abc\u0022`, whereas `/abc?/` matches\n`\u0022ab\u0022` with an optional `\u0022c\u0022`.\n\n```\nexport class CodePoints extends CodePart {\n public value: String;\n}\n```\n\n### Specials\n\nA number of special match forms exist. In the data model, these are empty\nclasses.\n\n- `.` - `Dot` In default mode, matches any Unicode code point except newline.\n- `^` - `Begin` in default mode matches zero-length at the beginning of a\n string.\n- `\u0024` - `End` in default mode matches zero-length at the end of a string.\n- `\\b` - `WordBoundary` matches zero-length at the boundary between word and\n non-word code points. More sophisticated Unicode compliance is TBD.\n- `\\s` (negated as `\\S`) - `Space` matches any horizontal space code point.\n Details are TBD.\n- `\\w` (negated as `\\W`) - `Word` matches any word code point. Details are TBD.\n This is currently defined in terms of old ASCII definitions because those are\n clear. Perhaps this will stay that way, and Unicode properties like `\\p{L}`\n will be used for human language needs.\n- `\\X` - `GraphemeCluster` might not be supported, but [here is some discussion\n of how to implement it](\n https://github.com/rust-lang/regex/issues/54#issuecomment-661905060).\n\n\u003cdetails\u003e\n\n```\nexport /*sealed*/ interface Special extends Regex {}\nexport let Begin = do { class Begin extends Special {}; new Begin() };\nexport let Dot = do { class Dot extends Special {}; new Dot() };\nexport let End = do { class End extends Special {}; new End() };\n// TODO(tjp, regex): We can't easily support this at present across backends.\n// export let GraphemeCluster = do {\n// class GraphemeCluster extends Special {}; new GraphemeCluster()\n// };\nexport let WordBoundary = do {\n class WordBoundary extends Special {}; new WordBoundary()\n};\n\nexport /*sealed*/ interface SpecialSet extends CodePart \u0026 Special {}\nexport let Digit = do { class Digit extends SpecialSet {}; new Digit() };\nexport let Space = do { class Space extends SpecialSet {}; new Space() };\nexport let Word = do { class Word extends SpecialSet {}; new Word() };\n```\n\n\u003c/details\u003e\n\n### CodeRange\n\nA code point range matches any code point in its inclusive bounds, such as\n`/[a-c]/`. In source, `-` is included in a code set either by escaping or by\nincluding it as the first or last character. A `CodeRange` is usually contained\ninside a [CodeSet](#codeset), and syntactically always is.\n\n```\nexport class CodeRange extends CodePart {\n public min: Int;\n public max: Int;\n}\n```\n\n### CodeSet\n\nA set of code points, any of which can match, such as `/[abc]/` matching any of\n`\u0022a\u0022`, `\u0022b\u0022`, or `\u0022c\u0022`. Alternatively, a negated set is the inverse of the code\npoints given, such as `/[^abc]/`, matching any code point that's not any of\nthese. This is also often called a character class.\n\nFurther, a subset of [specials](#specials) can also be used in code sets. A\nnegated code set of just a special set often has custom syntax. For example,\nnon-space can be said as either `/[^\\s]/` or `/\\S/`.\n\n```\nexport class CodeSet extends Regex {\n public items: List\u003cCodePart\u003e;\n public negated: Boolean = false;\n}\n```\n\n### Or\n\n`Or` matches any one of multiple options, such as `/ab|cd|e*/`.\n\n```\nexport class Or extends Regex {\n public /*early*/ items: List\u003cRegex\u003e;\n}\n```\n\n### Repeat\n\n`Repeat` matches from an minimum to a maximum number of repeats of a\nsubregex. This can be represented in regex source in a number of ways:\n\n- `?` matches 0 or 1.\n- `*` matches 0 or more.\n- `+` matches 1 or more.\n- `{m}` matches exactly `m` repetitions.\n- `{m,n}` matches between `m` and `n`. Missing `n` is a max of infinity. For\n example, `{0,1}` is equivalent to `?`, and `{1,}` is equivalent to `+`.\n\nBy default, repetitions are greedy, matching as many repetitions as possible.\nIn regex source, any of the above can have `?` appended to indicated reluctant\n(aka non-greedy), matching as few repetitions as possible.\n\n```\nexport class Repeat extends Regex {\n public /*early*/ item: Regex;\n public min: Int;\n public max: Int | Null; // where null means infinite\n public reluctant: Boolean = false;\n}\n```\n\nWe also have convenience builders.\n\n```\nexport let entire(item: Regex): Regex {\n new Sequence([Begin, item, End])\n}\n\nexport let oneOrMore(item: Regex, reluctant: Boolean = false): Repeat {\n { item, min: 1, max: null, reluctant }\n}\n\nexport let optional(item: Regex, reluctant: Boolean = false): Repeat {\n { item, min: 0, max: 1, reluctant }\n}\n```\n\n### Sequence\n\n`Sequence` strings along multiple other regexes in order.\n\n```\nexport class Sequence extends Regex {\n public /*early*/ items: List\u003cRegex\u003e;\n}\n```\n\n## Match Objects\n\nFor detailed match results, call `find` on a regex to get a `Map` object from\n`String` keys to `Group` values.\n\n```\n// TODO Go back to a `Match` object with `groups` as a member so we can also\n// TODO easily return metadata alongside groups? Or is simpler better?\n// export class Match { // interface ... \u003cT = Map\u003cString, Group\u003e\u003e {\n// public let groups: Map\u003cString, Group\u003e;\n// }\n\nexport class Group {\n public let name: String;\n public let value: String;\n public let codePointsBegin: Int;\n}\n```\n\n## Compiled Regex Objects\n\nThe compiled form of a regex is mostly opaque, but it can be cached for more\nefficient reuse than working from a source [Regex](#regex-data-model).\n\n\u003cdetails\u003e\n\n```\n// Provides a workaround for access to std/regex from extension methods.\nclass RegexRefs {\n public let codePoints: CodePoints = new CodePoints(\u0022\u0022);\n public let group: Group = { name: \u0022\u0022, value: \u0022\u0022, codePointsBegin: 0 }\n public let orObject: Or = new Or([]);\n}\n\nlet regexRefs = new RegexRefs();\n```\n\n\u003c/details\u003e\n\n```\n// TODO(tjp, regex): Generate subtypes of this interface later.\nexport class CompiledRegex { // interface ... \u003cT\u003e {\n```\n\nThe source `Regex` data is still available on compiled objects in case it's\nneeded for composition or other purposes.\n\n```\n public let data: Regex;\n\n public constructor(data: Regex) {\n this.data = data;\n compiled = compileFormatted(format());\n }\n```\n\nA compiled regex exposes many of the same capabilities as `Regex`, but they are\nmore efficient to use repeatedly.\n\n```\n public found(text: String): Boolean { compiledFound(compiled, text) }\n\n public find(text: String): Map\u003cString, Group\u003e | NoResult {\n compiledFind(compiled, text, regexRefs)\n }\n\n public replace(\n text: String, format: fn (Map\u003cString, Group\u003e): String\n ): String {\n compiledReplace(compiled, text, format, regexRefs)\n }\n```\n\nTODO(tjp, regex): Public method for replace with named references.\nTODO(tjp, regex): Any static checking?\n\n\u003cdetails\u003e\n\n```\n let compiled: AnyValue;\n\n // Extension functions on some backends need the private `compiled` value\n // passed in directly.\n @connected(\u0022CompiledRegex::compiledFound\u0022)\n compiledFound(compiled: AnyValue, text: String): Boolean;\n\n @connected(\u0022CompiledRegex::compiledFind\u0022)\n compiledFind(\n compiled: AnyValue, text: String, regexRefs: RegexRefs\n ): Map\u003cString, Group\u003e | NoResult;\n\n @connected(\u0022CompiledRegex::compileFormatted\u0022)\n compileFormatted(formatted: String): AnyValue;\n\n @connected(\u0022CompiledRegex::compiledReplace\u0022)\n compiledReplace(\n compiled: AnyValue,\n text: String,\n format: fn (Map\u003cString, Group\u003e): String,\n regexRefs: RegexRefs,\n ): String;\n\n @connected(\u0022CompiledRegex::format\u0022)\n format(): String { new RegexFormatter().format(data) }\n```\n\n\u003c/details\u003e\n\n```\n}\n```\n\n## Private implementation matters\n\nSome regex logic can be shared across backends. These features aren't directly\nexported to the user, however.\n\nThe intent is that these support features only get included in compiled Temper\ncode if usage depends on dynamically constructed regexes. If all regex building\nis done as stable values, we hope to generated backend compiled regexes purely\nat Temper compile time.\n\n### RegexFormatter\n\n\u003cdetails\u003e\n\n```\nclass RegexFormatter {\n let out: ListBuilder\u003cString\u003e = new ListBuilder\u003cString\u003e();\n\n public format(regex: Regex): String {\n pushRegex(regex)\n out.join(\u0022\u0022) { (x);; x }\n }\n\n pushRegex(regex: Regex): Void {\n match (regex) {\n // Aggregate types.\n is Capture -\u003e pushCapture(regex);\n is CodePoints -\u003e pushCodePoints(regex, false);\n is CodeRange -\u003e pushCodeRange(regex);\n is CodeSet -\u003e pushCodeSet(regex);\n is Or -\u003e pushOr(regex);\n is Repeat -\u003e pushRepeat(regex);\n is Sequence -\u003e pushSequence(regex);\n // Specials.\n // Some of these will need to be customized on future backends.\n Begin -\u003e out.add(\u0022^\u0022);\n Dot -\u003e out.add(\u0022.\u0022);\n End -\u003e out.add(\u0022\u0024\u0022);\n WordBoundary -\u003e out.add(\u0022\\\\b\u0022);\n // Special sets.\n Digit -\u003e out.add(\u0022\\\\d\u0022);\n Space -\u003e out.add(\u0022\\\\s\u0022);\n Word -\u003e out.add(\u0022\\\\w\u0022);\n // ...\n }\n }\n\n pushCapture(capture: Capture): Void {\n out.add(\u0022(\u0022);\n // TODO(tjp, regex): Consistent name validation rules for all backends???\n // TODO(tjp, regex): Validate here or in `Capture` constructor???\n // TODO(tjp, regex): Validate here or where against reused names???\n pushCaptureName(out, capture.name);\n pushRegex(capture.item);\n out.add(\u0022)\u0022);\n }\n\n @connected(\u0022RegexFormatter::pushCaptureName\u0022)\n pushCaptureName(out: ListBuilder\u003cString\u003e, name: String): Void {\n // All so far except Python use this form.\n out.add(\u0022?\u003c\u0024{name}\u003e\u0022);\n }\n\n pushCode(code: Int, insideCodeSet: Boolean): Void {\n // Expose private property to extension.\n pushCodeTo(out, code, insideCodeSet);\n // TODO(tjp, regex): Implement more in Temper once we can.\n // if (escapeCodes[code] \u0026\u0026 false) {\n // out.add(\u0022\\\\\u0022);\n // // TODO(tjp, regex): How to convert back to strings?\n // }\n }\n\n @connected(\u0022RegexFormatter::pushCodeTo\u0022)\n pushCodeTo(out: ListBuilder\u003cString\u003e, code: Int, insideCodeSet: Boolean): Void;\n\n pushCodePoints(codePoints: CodePoints, insideCodeSet: Boolean): Void {\n for (\n var slice = codePoints.value.codePoints;\n !slice.isEmpty;\n slice = slice.advance(1)\n ) {\n pushCode(slice.read(), insideCodeSet);\n }\n }\n\n pushCodeRange(codeRange: CodeRange): Void {\n out.add(\u0022[\u0022);\n pushCodeRangeUnwrapped(codeRange);\n out.add(\u0022]\u0022);\n }\n\n pushCodeRangeUnwrapped(codeRange: CodeRange): Void {\n pushCode(codeRange.min, true);\n out.add(\u0022-\u0022);\n pushCode(codeRange.max, true);\n }\n\n pushCodeSet(codeSet: CodeSet): Void {\n let adjusted = adjustCodeSet(codeSet, regexRefs);\n match (adjusted) {\n is CodeSet -\u003e do {\n out.add(\u0022[\u0022);\n if (adjusted.negated) {\n out.add(\u0022^\u0022);\n }\n for (var i = 0; i \u003c adjusted.items.length; i += 1) {\n pushCodeSetItem(adjusted.items[i]);\n }\n out.add(\u0022]\u0022);\n }\n else -\u003e pushRegex(adjusted);\n }\n }\n\n @connected(\u0022RegexFormatter::adjustCodeSet\u0022)\n adjustCodeSet(codeSet: CodeSet, regexRefs: RegexRefs): Regex { codeSet }\n\n pushCodeSetItem(codePart: CodePart): Void {\n match (codePart) {\n is CodePoints -\u003e pushCodePoints(codePart, true);\n is CodeRange -\u003e pushCodeRangeUnwrapped(codePart);\n is SpecialSet -\u003e pushRegex(codePart);\n }\n }\n\n pushOr(or: Or): Void {\n if (!or.items.isEmpty) {\n out.add(\u0022(?:\u0022);\n // TODO(tjp, regex): See #822. Until `this` works better, no this in funs.\n // TODO(tjp, regex): So just manually loop here. Sometimes faster, anyway?\n pushRegex(or.items[0]);\n for (var i = 1; i \u003c or.items.length; i += 1) {\n out.add(\u0022|\u0022);\n pushRegex(or.items[i]);\n }\n out.add(\u0022)\u0022);\n }\n }\n\n pushRepeat(repeat: Repeat): Void {\n // Always wrap the main sub-pattern here to make life easy\n out.add(\u0022(?:\u0022);\n pushRegex(repeat.item);\n out.add(\u0022)\u0022);\n // Then add the repetition part.\n let min = repeat.min;\n let max = repeat.max;\n if (false) {\n } else if (min == 0 \u0026\u0026 max == 1) {\n out.add(\u0022?\u0022);\n } else if (min == 0 \u0026\u0026 max == null) {\n out.add(\u0022*\u0022);\n } else if (min == 1 \u0026\u0026 max == null) {\n out.add(\u0022+\u0022);\n } else {\n out.add(\u0022{\u0024{min.toString()}\u0022);\n if (min != max) {\n out.add(\u0022,\u0022);\n if (max != null) {\n out.add(max.as\u003cInt\u003e().toString());\n }\n }\n out.add(\u0022}\u0022);\n }\n if (repeat.reluctant) {\n out.add(\u0022?\u0022);\n }\n }\n\n pushSequence(sequence: Sequence): Void {\n // TODO(tjp, regex): Foreach loop/function would be nice.\n for (var i = 0; i \u003c sequence.items.length; i += 1) {\n pushRegex(sequence.items[i]);\n }\n }\n\n // Put this here instead of the data model for now because I'm not sure this\n // makes sense to be part of the public api right now.\n public maxCode(codePart: CodePart): Int | Null {\n match (codePart) {\n is CodePoints -\u003e do {\n // Iterating code points is the hardest of the current cases.\n let value = codePart.value;\n if (value.isEmpty) {\n null\n } else {\n // My kingdom for a fold, or even just a max, in builtins.\n var max = 0;\n for (\n var slice = value.codePoints;\n !slice.isEmpty;\n slice = slice.advance(1)\n ) {\n let next = slice.read();\n if (next \u003e max) {\n max = next;\n }\n }\n max\n }\n }\n // Others below are easy for now.\n is CodeRange -\u003e codePart.max;\n Digit -\u003e \u00229\u0022.codePoints.read();\n Space -\u003e \u0022 \u0022.codePoints.read();\n Word -\u003e \u0022z\u0022.codePoints.read();\n // Actually unexpected, ever, but eh.\n else -\u003e null;\n }\n }\n}\n\n// // TODO(tjp, regex): Delete all the below (comment included) if unused.\n// // TODO(tjp, regex): Replace all this with a compile-time regex once we can.\n// let escapeCodeList = [\n// \u0022\\\\\u0022.codePoints.read(),\n// \u0022^\u0022.codePoints.read(),\n// \u0022\u0024\u0022.codePoints.read(),\n// \u0022{\u0022.codePoints.read(),\n// \u0022[\u0022.codePoints.read(),\n// \u0022(\u0022.codePoints.read(),\n// \u0022}\u0022.codePoints.read(),\n// \u0022]\u0022.codePoints.read(),\n// \u0022)\u0022.codePoints.read(),\n// \u0022|\u0022.codePoints.read(),\n// \u0022+\u0022.codePoints.read(),\n// \u0022?\u0022.codePoints.read(),\n// \u0022/\u0022.codePoints.read(),\n// \u0022*\u0022.codePoints.read(),\n// ];\n// let escapeCodes = new DenseBitVector(128);\n// // This `for` loop has to be after type definitions for now because\n// // https://github.com/temper-lang/temper/issues/817\n// for (var i = 0; i \u003c escapeCodeList.length; i += 1) {\n// escapeCodes[i] = true;\n// }\n```\n\n\u003c/details\u003e\n" ], "names": [ "return" ], "mappings": "AAAA;AAAA,MAAAA,QAAA;AAAA,eAAAA,QAAA" }
1
+ { "version": 3, "file": "OUTPUT_ROOT/js/std/regex__preface.js", "sources": [], "names": [], "mappings": "" }
package/temporal.js ADDED
@@ -0,0 +1,55 @@
1
+ import {
2
+ eqGeneric as eqGeneric_70, modIntInt as modIntInt_71, neGeneric as neGeneric_72, intToString as intToString_73, stringCodePoints as stringCodePoints_74, leGeneric as leGeneric_75, listify as listify_3, strCat as strCat_9
3
+ } from "@temperlang/core";
4
+ // Type nym`std//temporal.temper.md`.Date connected to globalThis.Date
5
+ /** @type {Array<number>} */
6
+ const daysInMonth_76 = listify_3(0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
7
+ /**
8
+ * @param {number} year_78
9
+ * @returns {boolean}
10
+ */
11
+ function isLeapYear_77(year_78) {
12
+ let return_79;
13
+ let t_80;
14
+ if (eqGeneric_70(modIntInt_71(year_78, 4), 0)) {
15
+ if (neGeneric_72(modIntInt_71(year_78, 100), 0)) {
16
+ return_79 = true;
17
+ } else {
18
+ t_80 = modIntInt_71(year_78, 400);
19
+ return_79 = eqGeneric_70(t_80, 0);
20
+ }
21
+ } else {
22
+ return_79 = false;
23
+ }
24
+ return return_79;
25
+ }
26
+ /**
27
+ * @param {string} padding_82
28
+ * @param {number} num_83
29
+ * @returns {string}
30
+ */
31
+ function pad_81(padding_82, num_83) {
32
+ let return_84;
33
+ let t_85;
34
+ const decimal_86 = intToString_73(num_83, 10);
35
+ let t_87 = stringCodePoints_74(decimal_86);
36
+ let decimalCodePoints_88 = t_87;
37
+ let sign_89;
38
+ if (eqGeneric_70(decimalCodePoints_88.read(), 45)) {
39
+ sign_89 = "-";
40
+ t_85 = decimalCodePoints_88.advance(1);
41
+ decimalCodePoints_88 = t_85;
42
+ } else {
43
+ sign_89 = "";
44
+ }
45
+ const paddingCp_90 = stringCodePoints_74(padding_82);
46
+ const nNeeded_91 = paddingCp_90.length - decimalCodePoints_88.length;
47
+ if (leGeneric_75(nNeeded_91, 0)) {
48
+ return_84 = decimal_86;
49
+ } else {
50
+ const pad_92 = paddingCp_90.limit(nNeeded_91).toString();
51
+ const decimalOnly_93 = decimalCodePoints_88.toString();
52
+ return_84 = strCat_9(sign_89, pad_92, decimalOnly_93);
53
+ }
54
+ return return_84;
55
+ }
@@ -0,0 +1 @@
1
+ { "version": 3, "file": "OUTPUT_ROOT/js/std/temporal.js", "sources": [ "std/temporal.temper.md" ], "sourcesContent": [ "# Temporal\n\nWe're creating an initial Date type to help with developing\nTemper's machinery to connect to existing Date types in\ntarget languages.\n\nSome facts about the Gregorian calendar.\n\n /** Indexed by the month number: 1 = January */\n let daysInMonth = [\n 0,\n /* January */ 31,\n /* February */ 28, // Special case leap days\n /* March */ 31,\n /* April */ 30,\n /* May */ 31,\n /* June */ 30,\n /* July */ 31,\n /* August */ 31,\n /* September */ 30,\n /* October */ 31,\n /* November */ 30,\n /* December */ 31,\n ];\n\n let isLeapYear(year: Int): Boolean {\n year % 4 == 0 \u0026\u0026 (year % 100 != 0 || year % 400 == 0)\n }\n\n /**\n * If the decimal representation of \\|num\\| is longer than [padding],\n * then that representation.\n * Otherwise any sign for [num] followed by the prefix of [padding]\n * that would bring the integer portion up to the length of [padding].\n *\n * ```temper\n * pad(\u00220000\u0022, 123) == \u00220123\u0022) \u0026\u0026\n * pad(\u0022000\u0022, 123) == \u0022123\u0022) \u0026\u0026\n * pad(\u002200\u0022, 123) == \u0022123\u0022) \u0026\u0026\n * pad(\u00220000\u0022, -123) == \u0022-0123\u0022) \u0026\u0026\n * pad(\u0022000\u0022, -123) == \u0022-123\u0022) \u0026\u0026\n * pad(\u002200\u0022, -123) == \u0022-123\u0022)\n * ```\n */\n let pad(padding: String, num: Int): String {\n let decimal = num.toString(10);\n var decimalCodePoints = decimal.codePoints;\n let sign: String;\n if (decimalCodePoints.read() == 45 /* - */) {\n sign = \u0022-\u0022;\n decimalCodePoints = decimalCodePoints.advance(1);\n } else {\n sign = \u0022\u0022;\n }\n let paddingCp = padding.codePoints;\n let nNeeded = paddingCp.length - decimalCodePoints.length;\n if (nNeeded \u003c= 0) {\n decimal\n } else {\n let pad = paddingCp.limit(nNeeded).toString();\n let decimalOnly = decimalCodePoints.toString();\n \u0022\u0024{sign}\u0024{pad}\u0024{decimalOnly}\u0022\n }\n }\n\nHere's just enough of a Date type to get us started.\n\n /**\n * A Date identifies a day in the proleptic Gregorian calendar.\n * It is unconnected to a time of day or a timezone.\n */\n @connected( \u0022Date\u0022)\n export class Date {\n /** The year. 1900 means 1900. */\n @connected(\u0022Date::getYear\u0022)\n public year: Int;\n /** The month of the year in [1, 12]. */\n @connected(\u0022Date::getMonth\u0022)\n public month: Int;\n /**\n * The day of the month in [1, 31]\n * additionally constrained by the length of [month].\n */\n @connected(\u0022Date::getDay\u0022)\n public day: Int;\n\n @connected(\u0022Date::constructor\u0022)\n public constructor(year: Int, month: Int, day: Int): Void | Bubble {\n if (1 \u003c= month \u0026\u0026 month \u003c= 12 \u0026\u0026\n 1 \u003c= day \u0026\u0026 (\n (month != 2 || day != 29)\n ? day \u003c= daysInMonth[month]\n : isLeapYear(year))) {\n this.year = year;\n this.month = month;\n this.day = day;\n } else {\n bubble();\n }\n }\n\n /** An ISO 8601 Date string with dashes like \u00222000-12-31\u0022. */\n @connected(\u0022Date::toString\u0022)\n public toString(): String {\n \u0022\u0024{pad(\u00220000\u0022, year)\n }-\u0024{pad(\u002200\u0022, month)\n }-\u0024{pad(\u002200\u0022, day)}\u0022\n }\n\n /**\n * The count of whole years between the two dates.\n *\n * Think of this as floor of the magnitude of a range:\n *\n * ⌊ [start, end] ⌋\n *\n * If you think of it as subtraction, you have to reverse\n * the order of arguments.\n *\n * ⌊ end - start ⌋, NOT ⌊ start - end ⌋\n *\n * \u0022Whole year\u0022 is based on month/day calculations, not\n * day-of-year. This means that there is one full year\n * between 2020-03-01 and 2021-03-01 even though, because\n * February of 2020 has 29 days, 2020-03-01 is the 61st\n * day of 2020 but 2021-03-01 is only the 60th day of\n * that year.\n */\n @connected(\u0022Date::yearsBetween\u0022)\n public static let yearsBetween(start: Date, end: Date): Int {\n let yearDelta = end.year - start.year;\n let monthDelta = end.month - start.month;\n yearDelta - (\n // If the end month/day is before the start's then we\n // don't have a full year.\n (monthDelta \u003c 0 || monthDelta == 0 \u0026\u0026 end.day \u003c start.day)\n ? 1 : 0)\n }\n\n /** Today's date in UTC */\n // TODO: take a zone\n @connected(\u0022Date::today\u0022)\n public static let today(): Date;\n };\n\nTODO: an auto-balancing Date builder.\nParse from ISO\nOther temporal values\nDay of week\n" ], "names": [ "daysInMonth", "isLeapYear", "year", "return", "pad", "padding", "num", "decimal", "decimalCodePoints", "sign", "paddingCp", "nNeeded", "decimalOnly" ], "mappings": "AASI;AAAA;AAAA;AA+Da,sEAsEoB;AArI7B,4BAAW;AAAf,KAAI,CAAAA,cAAW,EAAG,UAAC,CACjB,CAAC,CACe,GAAE,CACF,GAAE,CACF,GAAE,CACF,GAAE,CACF,GAAE,CACF,GAAE,CACF,GAAE,CACF,GAAE,CACF,GAAE,CACF,GAAE,CACF,GAAE,CACF,GAAE,CACnB;AAED,wDAEC;AAFD,QAAI,CAAAC,aAAU,AAAd,CAAeC,OAAS,CAEvB,AAFkC,EAAA;AAAR,MAAAC,SAAO;AACM,UAAU,CAAA;AAA/C,MAAS,YAAE,CAAA,AAAN,YAAC,CAAA,AAAND,OAAI,CAAG,EAAC,EAAI,EAAC;AAAK,QAAW,YAAE,CAAA,AAAR,YAAC,CAAA,AAANA,OAAI,CAAG,IAAG,EAAI,EAAC;AAAA,MAAAC,SAAA;AAAA;AAAI,YAAU,AAAL,aAAC,CAAA,AAAND,OAAI,CAAG,IAAG,EAAA;AAAV,MAAAC,SAAA,EAAe,AAAJ,aAAE,CAAA,AAAb,IAAU,CAAI,EAAC;AAAA;AAAA;AAAC,IAAAA,SAAA;AAAA;AACvD,QAAA,AAF0B,CAAAA,SAAA;AAE1B;AAiBD,oFAmBC;AAnBD,QAAI,CAAAC,MAAG,AAAP,CAAQC,UAAe,CAAE,CAAAC,MAAQ,CAmBhC,AAnB0C,EAAA;AAAP,MAAAH,SAAM;AAMlB,UAA4B,CAAA;AALlD,OAAI,CAAAI,UAAO,EAAO,eAAQ,CAAA,AAAZD,MAAG,CAAU,GAAE,CAAC;AACN,UAAkB,EAAA,AAAV,oBAAU,CAAA,AAAlBC,UAAO,CAAW,CAAA;AAAvC,KAAC,CAAAC,oBAAiB,EAAG,KAAkB;AAC1C,KAAI,CAAAC,OAAY;AACZ,MAAyB,YAAE,CAAA,AAA3BD,oBAAiB,CAAC,IAAI,EAAE,CAAI,GAAE;AAChC,IAAAC,OAAI,AAAJ,EAAU,AAAH,IAAG;AACU,UAA4B,AAA5B,CAAAD,oBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AAAhD,IAAAA,oBAAiB,AAAjB,EAAgD,AAA5B,KAA4B;AACjD;AACC,IAAAC,OAAI,AAAJ,EAAS,AAAF,GAAE;AAAA;AAEX,OAAI,CAAAC,YAAS,EAAW,oBAAU,CAAA,AAAlBL,UAAO,CAAW;AAClC,OAAI,CAAAM,UAAO,EAAG,CAAAD,YAAS,CAAO,MAAA,AAAhB,EAAmB,CAAAF,oBAAiB,CAAO;AAAA,MAC7C,YAAE,CAAA,AAAVG,UAAO,CAAI,EAAC;AACd,IAAAR,SAAA,EAAO,AAAP,CAAAI,UAAO;AAAA;AAEP,SAAI,CAAAH,MAAG,EAA4B,AAAzB,CAAAM,YAAS,CAAC,KAAK,CAACC,UAAO,CAAC,CAAC,QAAQ,EAAE;AAC7C,SAAI,CAAAC,cAAW,EAAqB,AAAlB,CAAAJ,oBAAiB,CAAC,QAAQ,EAAE;AAC9C,IAAAL,SAAA,EAA6B,AAA7B,UAAGM,OAAI,CAAG,CAAAL,MAAG,CAAG,CAAAQ,cAAW,CAAE;AAC9B;AACF,QAAA,AAnBmC,CAAAT,SAAA;AAmBnC" }
File without changes
@@ -0,0 +1 @@
1
+ { "version": 3, "file": "OUTPUT_ROOT/js/std/temporal__preface.js", "sources": [], "names": [], "mappings": "" }
package/testing.js CHANGED
@@ -1,62 +1,229 @@
1
1
  import {
2
- globalConsole as vGlobalConsole__36_351, strCat as strCat_10, listJoin as listJoin_7, listBuilderAdd as listBuilderAdd_9, InterfaceType as InterfaceType_1
2
+ listBuilderAdd as listBuilderAdd_0, listBuilderToList as listBuilderToList_1, listJoin as listJoin_2, listify as listify_3, pairConstructor as pairConstructor_4, listMap as listMap_5, ltGeneric as ltGeneric_6, listGet as listGet_7, globalConsole as vGlobalConsole__45_8, strCat as strCat_9, bubbleException as bubbleException__65
3
3
  } from "@temperlang/core";
4
+ import {
5
+ strict as strict__19
6
+ } from "assert";
7
+ export class Test {
8
+ /**
9
+ * @param {boolean} success_11
10
+ * @param {() => string} message_12
11
+ */
12
+ assert(success_11, message_12) {
13
+ if (! success_11) {
14
+ this.#_passing_13 = false;
15
+ listBuilderAdd_0(this.#_messages_14, message_12());
16
+ } else {
17
+ void 0;
18
+ }
19
+ return;
20
+ }
21
+ /**
22
+ * @param {boolean} success_16
23
+ * @param {() => string} message_17
24
+ * @returns {void}
25
+ */
26
+ assertHard(success_16, message_17) {
27
+ this.assert(success_16, message_17);
28
+ if (! success_16) {
29
+ this.#_failedOnAssert_18 = true;
30
+ strict__19.fail(this.messagesCombined());
31
+ } else {
32
+ void 0;
33
+ }
34
+ return;
35
+ }
36
+ /** @returns {void} */
37
+ softFailToHard() {
38
+ if (this.hasUnhandledFail) {
39
+ this.#_failedOnAssert_18 = true;
40
+ strict__19.fail(this.messagesCombined());
41
+ } else {
42
+ void 0;
43
+ }
44
+ return;
45
+ }
46
+ /** @type {boolean} */
47
+ #passing_21;
48
+ /** @returns {boolean} */
49
+ get passing() {
50
+ return this.#_passing_13;
51
+ }
52
+ /** @returns {Array<string>} */
53
+ messages() {
54
+ return listBuilderToList_1(this.#_messages_14);
55
+ }
56
+ /** @type {boolean} */
57
+ #failedOnAssert_24;
58
+ /** @returns {boolean} */
59
+ get failedOnAssert() {
60
+ return this.#_failedOnAssert_18;
61
+ }
62
+ /** @type {boolean} */
63
+ #hasUnhandledFail_26;
64
+ /** @returns {boolean} */
65
+ get hasUnhandledFail() {
66
+ let t_28;
67
+ if (this.#_failedOnAssert_18) {
68
+ t_28 = true;
69
+ } else {
70
+ t_28 = this.#_passing_13;
71
+ }
72
+ return ! t_28;
73
+ }
74
+ /** @returns {string | null} */
75
+ messagesCombined() {
76
+ let return_30;
77
+ let t_31;
78
+ let t_32;
79
+ if (! this.#_messages_14.length) {
80
+ return_30 = null;
81
+ } else {
82
+ t_31 = this.#_messages_14;
83
+ function fn_33(it_34) {
84
+ return it_34;
85
+ }
86
+ t_32 = listJoin_2(t_31, ", ", fn_33);
87
+ return_30 = t_32;
88
+ }
89
+ return return_30;
90
+ }
91
+ /** @type {boolean} */
92
+ #_failedOnAssert_18;
93
+ /** @type {boolean} */
94
+ #_passing_13;
95
+ /** @type {Array<string>} */
96
+ #_messages_14;
97
+ /**
98
+ * @param {boolean} _failedOnAssert_35
99
+ * @param {boolean} _passing_36
100
+ * @param {Array<string>} _messages_37
101
+ */
102
+ constructor(_failedOnAssert_35, _passing_36, _messages_37) {
103
+ let t_38;
104
+ if (!(_failedOnAssert_35 !== void 0)) {
105
+ _failedOnAssert_35 = false;
106
+ }
107
+ if (!(_passing_36 !== void 0)) {
108
+ _passing_36 = true;
109
+ }
110
+ if (!(_messages_37 !== void 0)) {
111
+ t_38 = [];
112
+ _messages_37 = t_38;
113
+ }
114
+ this.#_failedOnAssert_18 = _failedOnAssert_35;
115
+ this.#_passing_13 = _passing_36;
116
+ this.#_messages_14 = _messages_37;
117
+ return;
118
+ }
119
+ };
120
+ /** @type {Type_39} */
121
+ export const TestName = "String: Type";
122
+ /** @type {Type_39} */
123
+ export const TestFun = "fn (Test): (Void | Bubble): Type";
124
+ /** @type {Type_39} */
125
+ export const TestCase = "Pair\u003cString, fn (Test): (Void | Bubble)\u003e: Type";
126
+ /** @type {Type_39} */
127
+ export const TestFailureMessage = "String: Type";
128
+ /** @type {Type_39} */
129
+ export const TestResult = "Pair\u003cString, List\u003cString\u003e\u003e: Type";
4
130
  /**
5
- * @typedef {{}}
6
- * TestFixtureBase
7
- */
8
- export const TestFixtureBase = new InterfaceType_1("TestFixtureBase", [], [], 1);
9
- ;
10
- /** @type {boolean} */
11
- let passing_352 = true;
12
- /** @type {Array<string>} */
13
- let t_353 = [];
14
- /** @type {Array<string>} */
15
- let messages_354 = t_353;
16
- /**
17
- * @param {string} name_355
18
- * @param {() => void} body_356
19
- * @returns {void}
131
+ * @param {Array<Pair_53<string, (arg0: Test) => void>>} testCases_40
132
+ * @returns {Array<Pair_53<string, Array<string>>>}
20
133
  */
21
- export function test(name_355, body_356) {
22
- let return_357;
23
- let t_358;
24
- let t_359;
25
- return_357 = void 0;
26
- passing_352 = true;
27
- let t_360 = [];
28
- messages_354 = t_360;
29
- body_356();
30
- if (passing_352) {
31
- vGlobalConsole__36_351.log(strCat_10(name_355, ": Passed"));
32
- } else {
33
- function fn_361(it_362) {
34
- let return_363;
35
- return_363 = it_362;
36
- return return_363;
37
- }
38
- t_358 = fn_361;
39
- t_359 = listJoin_7(messages_354, "\n", t_358);
40
- vGlobalConsole__36_351.log(strCat_10(name_355, ": Failed ", t_359));
41
- }
42
- return return_357;
134
+ export function processTestCases(testCases_40) {
135
+ function fn_41(testCase_42) {
136
+ let t_43;
137
+ let t_44;
138
+ let t_45;
139
+ const key_46 = testCase_42.key;
140
+ const fun_47 = testCase_42.value;
141
+ const test_48 = new Test();
142
+ let hadBubble_49;
143
+ try {
144
+ fun_47(test_48);
145
+ hadBubble_49 = false;
146
+ } catch {
147
+ hadBubble_49 = true;
148
+ }
149
+ const messages_50 = test_48.messages();
150
+ let failures_51;
151
+ if (test_48.passing) {
152
+ failures_51 = listify_3();
153
+ } else {
154
+ if (hadBubble_49) {
155
+ t_43 = test_48.failedOnAssert;
156
+ t_45 = ! t_43;
157
+ } else {
158
+ t_45 = false;
159
+ }
160
+ if (t_45) {
161
+ const allMessages_52 = messages_50.slice();
162
+ {
163
+ listBuilderAdd_0(allMessages_52, "Bubble");
164
+ t_44 = listBuilderToList_1(allMessages_52);
165
+ failures_51 = t_44;
166
+ }
167
+ } else {
168
+ failures_51 = messages_50;
169
+ }
170
+ }
171
+ return pairConstructor_4(key_46, failures_51);
172
+ }
173
+ return listMap_5(testCases_40, fn_41);
174
+ };
175
+ /** @param {Array<Pair_53<string, Array<string>>>} testResults_54 */
176
+ export function reportTestResults(testResults_54) {
177
+ let return_55;
178
+ let t_56;
179
+ let t_57;
180
+ let i_58 = 0;
181
+ s__1220_59: {
182
+ while (true) {
183
+ t_56 = testResults_54.length;
184
+ if (ltGeneric_6(i_58, t_56)) {
185
+ try {
186
+ t_57 = listGet_7(testResults_54, i_58);
187
+ } catch {
188
+ break;
189
+ }
190
+ const testResult_60 = t_57;
191
+ const failureMessages_61 = testResult_60.value;
192
+ if (! failureMessages_61.length) {
193
+ vGlobalConsole__45_8.log(strCat_9(testResult_60.key, ": Passed"));
194
+ } else {
195
+ function fn_62(it_63) {
196
+ return it_63;
197
+ }
198
+ const message_64 = listJoin_2(failureMessages_61, ", ", fn_62);
199
+ vGlobalConsole__45_8.log(strCat_9(testResult_60.key, ": Failed ", message_64));
200
+ }
201
+ i_58 = i_58 + 1;
202
+ } else {
203
+ return_55 = void 0;
204
+ break s__1220_59;
205
+ }
206
+ }
207
+ throw bubbleException__65;
208
+ }
209
+ return return_55;
210
+ };
211
+ /** @param {Array<Pair_53<string, (arg0: Test) => void>>} testCases_66 */
212
+ export function runTestCases(testCases_66) {
213
+ reportTestResults(processTestCases(testCases_66));
214
+ return;
43
215
  };
44
216
  /**
45
- * @param {boolean} success_364
46
- * @param {() => string} message_365
217
+ * @param {(arg0: Test) => void} testFun_67
47
218
  * @returns {void}
48
219
  */
49
- export function assert(success_364, message_365) {
50
- let return_366;
51
- let t_367;
52
- return_366 = void 0;
53
- if (! success_364) {
54
- passing_352 = false;
55
- t_367 = message_365();
56
- listBuilderAdd_9(messages_354, t_367);
57
- }
58
- return return_366;
220
+ export function runTest(testFun_67) {
221
+ let return_68;
222
+ const test_69 = new Test();
223
+ {
224
+ testFun_67(test_69);
225
+ test_69.softFailToHard();
226
+ return_68 = void 0;
227
+ }
228
+ return return_68;
59
229
  };
60
- /** @type {void} */
61
- const return_368 = void 0;
62
- export default return_368;