@excom/quark-parser 0.1.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.
Files changed (32) hide show
  1. package/.rush/temp/chunked-rush-logs/quark-parser.apply-exports.chunks.jsonl +1 -0
  2. package/.rush/temp/chunked-rush-logs/quark-parser.build_package-metas.chunks.jsonl +1 -0
  3. package/.rush/temp/operation/apply-exports/all.log +1 -0
  4. package/.rush/temp/operation/apply-exports/log-chunks.jsonl +1 -0
  5. package/.rush/temp/operation/apply-exports/state.json +3 -0
  6. package/.rush/temp/operation/build_package-metas/all.log +1 -0
  7. package/.rush/temp/operation/build_package-metas/log-chunks.jsonl +1 -0
  8. package/.rush/temp/operation/build_package-metas/state.json +3 -0
  9. package/.rush/temp/shrinkwrap-deps.json +3 -0
  10. package/config/rig.json +5 -0
  11. package/index.ts +12 -0
  12. package/package.json +39 -0
  13. package/rush-logs/quark-parser.apply-exports.cache.log +1 -0
  14. package/rush-logs/quark-parser.apply-exports.log +1 -0
  15. package/rush-logs/quark-parser.build_package-metas.cache.log +1 -0
  16. package/rush-logs/quark-parser.build_package-metas.log +1 -0
  17. package/src/error.ts +24 -0
  18. package/src/parser.ts +1482 -0
  19. package/src/tables.ts +77 -0
  20. package/src/tokenizer.ts +443 -0
  21. package/src/types.ts +497 -0
  22. package/support/docs/README.md +443 -0
  23. package/support/package-meta.json +33 -0
  24. package/support/tests/grammar-docs.test.ts +109 -0
  25. package/support/tests/parser-at-rules.test.ts +430 -0
  26. package/support/tests/parser-declarations.test.ts +152 -0
  27. package/support/tests/parser-edge-cases.test.ts +296 -0
  28. package/support/tests/parser-expressions.test.ts +413 -0
  29. package/support/tests/parser-real-world.test.ts +429 -0
  30. package/support/tests/parser-selectors.test.ts +169 -0
  31. package/support/tests/tokenizer.test.ts +268 -0
  32. package/tsconfig.json +5 -0
@@ -0,0 +1 @@
1
+ {"kind":"O","text":"Invoking: cd \"$RUSH_PROJECT_FOLDER\" && node ../heft-rig/scripts/apply-exports.mjs \n"}
@@ -0,0 +1 @@
1
+ {"kind":"O","text":"Invoking: node node_modules/@excom/heft-rig/scripts/build-package-metas.mjs \n"}
@@ -0,0 +1 @@
1
+ Invoking: cd "$RUSH_PROJECT_FOLDER" && node ../heft-rig/scripts/apply-exports.mjs
@@ -0,0 +1 @@
1
+ {"kind":"O","text":"Invoking: cd \"$RUSH_PROJECT_FOLDER\" && node ../heft-rig/scripts/apply-exports.mjs \n"}
@@ -0,0 +1,3 @@
1
+ {
2
+ "nonCachedDurationMs": 36.02083700000003
3
+ }
@@ -0,0 +1 @@
1
+ Invoking: node node_modules/@excom/heft-rig/scripts/build-package-metas.mjs
@@ -0,0 +1 @@
1
+ {"kind":"O","text":"Invoking: node node_modules/@excom/heft-rig/scripts/build-package-metas.mjs \n"}
@@ -0,0 +1,3 @@
1
+ {
2
+ "nonCachedDurationMs": 90.728793
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "../../packages/quark-parser": "../../packages/quark-parser:DpFAJ6l9NZ7PxsGv74etlzI4VS4IyRu5jGEhInb3gEw=:"
3
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",
3
+ "rigPackageName": "@excom/heft-rig",
4
+ "rigProfile": "default"
5
+ }
package/index.ts ADDED
@@ -0,0 +1,12 @@
1
+ export { QuarkParseError } from "./src/error";
2
+ export { parse, parseExpression, parseSelectorList } from "./src/parser";
3
+ export type { QuarkAtRuleName } from "./src/tables";
4
+ export {
5
+ ATTR_OPERATORS,
6
+ BINARY_BP,
7
+ NOT_BP,
8
+ QUARK_AT_RULES,
9
+ SELECTOR_PSEUDOS,
10
+ } from "./src/tables";
11
+ export { tokenize } from "./src/tokenizer";
12
+ export type * from "./src/types";
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@excom/quark-parser",
3
+ "version": "0.1.0",
4
+ "description": "Fast tokenizer and AST parser for the Quark language (a derivative of CSS with member accessors)",
5
+ "license": "ISC",
6
+ "engines": {
7
+ "node": ">=24.13.0"
8
+ },
9
+ "type": "module",
10
+ "dependencies": {},
11
+ "peerDependencies": {},
12
+ "devDependencies": {
13
+ "@excom/heft-rig": "^0.1.0"
14
+ },
15
+ "repository": {
16
+ "url": "excom-dev/nucleus",
17
+ "directory": "packages/quark-parser"
18
+ },
19
+ "homepage": "https://github.com/excom-dev/nucleus/tree/main/packages/quark-parser/support/docs/README.md",
20
+ "bugs": "https://github.com/excom-dev/nucleus/issues",
21
+ "keywords": [
22
+ "quark-parser",
23
+ "quark",
24
+ "parser",
25
+ "css",
26
+ "ast"
27
+ ],
28
+ "excom": {
29
+ "packageType": "library"
30
+ },
31
+ "scripts": {
32
+ "build": "node node_modules/@excom/heft-rig/scripts/vite-build.mjs",
33
+ "build:watch": "node node_modules/@excom/heft-rig/scripts/vite-build-watch.mjs",
34
+ "format": "node node_modules/@excom/heft-rig/scripts/format.mjs",
35
+ "test": "node node_modules/@excom/heft-rig/scripts/vitest.mjs",
36
+ "coverage": "node node_modules/@excom/heft-rig/scripts/coverage.mjs",
37
+ "build:package-metas": "node node_modules/@excom/heft-rig/scripts/build-package-metas.mjs"
38
+ }
39
+ }
@@ -0,0 +1 @@
1
+ Caching has been disabled for this project's "apply-exports" command.
@@ -0,0 +1 @@
1
+ Invoking: cd "$RUSH_PROJECT_FOLDER" && node ../heft-rig/scripts/apply-exports.mjs
@@ -0,0 +1 @@
1
+ This project does not define the caching behavior of the "build:package-metas" command, so caching has been disabled.
@@ -0,0 +1 @@
1
+ Invoking: node node_modules/@excom/heft-rig/scripts/build-package-metas.mjs
package/src/error.ts ADDED
@@ -0,0 +1,24 @@
1
+ export class QuarkParseError extends SyntaxError {
2
+ position: number;
3
+ line: number;
4
+ column: number;
5
+
6
+ constructor(message: string, source: string, position: number) {
7
+ let line = 1;
8
+ let column = 1;
9
+ const max = Math.min(position, source.length);
10
+ for (let i = 0; i < max; i++) {
11
+ if (source.charCodeAt(i) === 10) {
12
+ line++;
13
+ column = 1;
14
+ } else {
15
+ column++;
16
+ }
17
+ }
18
+ super(`${message} (${line}:${column})`);
19
+ this.name = "QuarkParseError";
20
+ this.position = position;
21
+ this.line = line;
22
+ this.column = column;
23
+ }
24
+ }