@hyperfixi/engine 7.5.1 → 7.6.0
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/CHANGELOG.md +103 -0
- package/README.md +109 -30
- package/dist/additions.d.ts +11 -4
- package/dist/common.js +247 -201
- package/dist/common.min.js +9 -9
- package/dist/core.js +55 -3
- package/dist/core.min.js +9 -9
- package/dist/engine.d.ts +9 -1
- package/dist/ext/socket.d.ts +32 -0
- package/dist/ext/socket.dev.js +139 -0
- package/dist/ext/socket.esm.js +127 -0
- package/dist/ext/socket.js +1 -0
- package/dist/ext/tailwind.d.ts +16 -0
- package/dist/ext/tailwind.dev.js +30 -0
- package/dist/ext/tailwind.esm.js +16 -0
- package/dist/ext/tailwind.js +1 -0
- package/dist/full.js +82 -12
- package/dist/full.min.js +15 -15
- package/dist/hyperfixi-hs.dev.js +82 -12
- package/dist/hyperfixi-hs.js +15 -15
- package/dist/index.d.ts +1 -2
- package/dist/index.js +68 -12
- package/dist/kit.d.ts +13 -0
- package/dist/minimal.js +56 -10
- package/dist/minimal.min.js +8 -8
- package/dist/parser.d.ts +15 -2
- package/dist/statements.d.ts +1 -1
- package/package.json +8 -1
package/dist/parser.d.ts
CHANGED
|
@@ -23,8 +23,20 @@ export type CommandRule = (p: Parser, keyword: string, start: number) => Cmd | u
|
|
|
23
23
|
export type FeatureRule = (p: Parser, start: number) => Feature;
|
|
24
24
|
export type LeafRule = (p: Parser) => Expr | undefined;
|
|
25
25
|
export type ChainRule = (p: Parser, root: Expr) => Expr | undefined;
|
|
26
|
+
/** A position `Parser.mark` returns: the token, the last one consumed, the follow set's depth. */
|
|
27
|
+
export interface Mark {
|
|
28
|
+
readonly i: number;
|
|
29
|
+
readonly last: Token;
|
|
30
|
+
readonly follows: number;
|
|
31
|
+
}
|
|
26
32
|
export interface Grammar {
|
|
27
33
|
commands: Record<string, CommandRule>;
|
|
34
|
+
/**
|
|
35
|
+
* More readings of a command, for syntax upstream does not have (`additions.ts`): tried in
|
|
36
|
+
* order, from just after the keyword, only when the command's own rule fails to parse. One
|
|
37
|
+
* returns `undefined` to decline. So a fallback cannot change what the rule itself reads.
|
|
38
|
+
*/
|
|
39
|
+
fallbacks: Record<string, CommandRule[]>;
|
|
28
40
|
features: Record<string, FeatureRule>;
|
|
29
41
|
/** Tried in order; the symbol rule goes last so it does not swallow keywords. */
|
|
30
42
|
leaves: LeafRule[];
|
|
@@ -38,8 +50,6 @@ export interface Grammar {
|
|
|
38
50
|
collections: ChainRule[];
|
|
39
51
|
/** A bare call used as a command: `foo()`, `me.focus()`. */
|
|
40
52
|
pseudo?: (p: Parser, start: number) => Cmd | undefined;
|
|
41
|
-
/** `toggle <element>`, with no `between`: not upstream's (`additions.ts`). */
|
|
42
|
-
toggleElement?: (p: Parser, target: Expr, start: number) => Cmd;
|
|
43
53
|
}
|
|
44
54
|
export declare const createGrammar: () => Grammar;
|
|
45
55
|
export declare class Parser {
|
|
@@ -59,6 +69,9 @@ export declare class Parser {
|
|
|
59
69
|
hasMore(): boolean;
|
|
60
70
|
/** Start offset of the current token — what a rule records as its node's `start`. */
|
|
61
71
|
pos(): number;
|
|
72
|
+
/** Where the parser is, for `reset`: a command's fallback reads again from here. */
|
|
73
|
+
mark(): Mark;
|
|
74
|
+
reset(mark: Mark): void;
|
|
62
75
|
/** End offset of the last consumed token — a node's `end`. */
|
|
63
76
|
endPos(): number;
|
|
64
77
|
text(node: {
|
package/dist/statements.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Follows upstream `core/kernel.js`.
|
|
7
7
|
*/
|
|
8
8
|
import type { Cmd, Expr, Feature, Handlers, Program } from './ast';
|
|
9
|
-
import type
|
|
9
|
+
import { type Parser } from './parser';
|
|
10
10
|
export interface UnlessNode extends Cmd {
|
|
11
11
|
type: 'unlessStatementModifier';
|
|
12
12
|
command: Cmd;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperfixi/engine",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.6.0",
|
|
4
4
|
"description": "A small, typed hyperscript engine, faithful to upstream _hyperscript: its test suite is the acceptance oracle. Ships hyperfixi-hs.js, the script-tag bundle",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -13,6 +13,12 @@
|
|
|
13
13
|
},
|
|
14
14
|
"./browser": "./dist/hyperfixi-hs.js",
|
|
15
15
|
"./dist/hyperfixi-hs.js": "./dist/hyperfixi-hs.js",
|
|
16
|
+
"./ext/*": {
|
|
17
|
+
"types": "./dist/ext/*.d.ts",
|
|
18
|
+
"import": "./dist/ext/*.esm.js",
|
|
19
|
+
"default": "./dist/ext/*.esm.js"
|
|
20
|
+
},
|
|
21
|
+
"./dist/ext/*": "./dist/ext/*",
|
|
16
22
|
"./package.json": "./package.json"
|
|
17
23
|
},
|
|
18
24
|
"files": [
|
|
@@ -39,6 +45,7 @@
|
|
|
39
45
|
"test:upstream": "node upstream-suite/run.mjs --bundle dist/full.js --check",
|
|
40
46
|
"test:upstream:update": "node upstream-suite/run.mjs --bundle dist/full.js --update",
|
|
41
47
|
"test:own": "node upstream-suite/run.mjs --bundle dist/full.js --own",
|
|
48
|
+
"check:claims": "tsx tools/claims.mts",
|
|
42
49
|
"cost": "node cost.mjs"
|
|
43
50
|
},
|
|
44
51
|
"author": "LokaScript Contributors",
|