@danielsimonjr/mathts-parser 0.1.19 → 0.1.20
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/README.md +38 -38
- package/dist/index.d.ts +25 -2
- package/dist/index.d.ts.map +1 -0
- package/package.json +61 -61
package/README.md
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
# @danielsimonjr/mathts-parser
|
|
2
|
-
|
|
3
|
-
Standalone expression parser for [MathTS](https://github.com/danielsimonjr/mathts).
|
|
4
|
-
|
|
5
|
-
This package is a focused entry point over the parser that lives in
|
|
6
|
-
[`@danielsimonjr/mathts-expression`](https://www.npmjs.com/package/@danielsimonjr/mathts-expression).
|
|
7
|
-
It re-exports the parser surface so you can install and consume just the parser
|
|
8
|
-
(mirroring the other MathTS packages — `expression`, `matrix`, `parallel`,
|
|
9
|
-
`functions`, …). The implementation is not duplicated; it is re-exported.
|
|
10
|
-
|
|
11
|
-
## Install
|
|
12
|
-
|
|
13
|
-
```sh
|
|
14
|
-
npm install @danielsimonjr/mathts-parser
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## What it exports
|
|
18
|
-
|
|
19
|
-
- `createParse` — factory for the `parse` function (string → AST).
|
|
20
|
-
- `createParserClass` — factory for the `Parser` class (stateful, scope-aware).
|
|
21
|
-
- `createParser` — factory for the `parser()` instance (a `Parser` with its own scope).
|
|
22
|
-
- AST node constructors produced by parsing: `createNode`, `createConstantNode`,
|
|
23
|
-
`createOperatorNode`, `createSymbolNode`, `createFunctionNode`, … and the rest.
|
|
24
|
-
- Operator/keyword metadata: `keywords`, `properties`, `getPrecedence`,
|
|
25
|
-
`getAssociativity`, `isAssociativeWith`, `getOperator`.
|
|
26
|
-
- The associated TypeScript types (AST node types, parser/operator types).
|
|
27
|
-
|
|
28
|
-
These are MathTS **factory functions**: wire them into a MathTS instance via
|
|
29
|
-
`create()` / `typed-function`, exactly as you would when importing them from
|
|
30
|
-
`@danielsimonjr/mathts-expression`.
|
|
31
|
-
|
|
32
|
-
```ts
|
|
33
|
-
import { createParse, createParserClass } from '@danielsimonjr/mathts-parser';
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## License
|
|
37
|
-
|
|
38
|
-
MIT © Daniel Simon Jr.
|
|
1
|
+
# @danielsimonjr/mathts-parser
|
|
2
|
+
|
|
3
|
+
Standalone expression parser for [MathTS](https://github.com/danielsimonjr/mathts).
|
|
4
|
+
|
|
5
|
+
This package is a focused entry point over the parser that lives in
|
|
6
|
+
[`@danielsimonjr/mathts-expression`](https://www.npmjs.com/package/@danielsimonjr/mathts-expression).
|
|
7
|
+
It re-exports the parser surface so you can install and consume just the parser
|
|
8
|
+
(mirroring the other MathTS packages — `expression`, `matrix`, `parallel`,
|
|
9
|
+
`functions`, …). The implementation is not duplicated; it is re-exported.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
npm install @danielsimonjr/mathts-parser
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## What it exports
|
|
18
|
+
|
|
19
|
+
- `createParse` — factory for the `parse` function (string → AST).
|
|
20
|
+
- `createParserClass` — factory for the `Parser` class (stateful, scope-aware).
|
|
21
|
+
- `createParser` — factory for the `parser()` instance (a `Parser` with its own scope).
|
|
22
|
+
- AST node constructors produced by parsing: `createNode`, `createConstantNode`,
|
|
23
|
+
`createOperatorNode`, `createSymbolNode`, `createFunctionNode`, … and the rest.
|
|
24
|
+
- Operator/keyword metadata: `keywords`, `properties`, `getPrecedence`,
|
|
25
|
+
`getAssociativity`, `isAssociativeWith`, `getOperator`.
|
|
26
|
+
- The associated TypeScript types (AST node types, parser/operator types).
|
|
27
|
+
|
|
28
|
+
These are MathTS **factory functions**: wire them into a MathTS instance via
|
|
29
|
+
`create()` / `typed-function`, exactly as you would when importing them from
|
|
30
|
+
`@danielsimonjr/mathts-expression`.
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { createParse, createParserClass } from '@danielsimonjr/mathts-parser';
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## License
|
|
37
|
+
|
|
38
|
+
MIT © Daniel Simon Jr.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @danielsimonjr/mathts-parser
|
|
3
|
+
*
|
|
4
|
+
* Standalone expression parser for MathTS. This package re-exports the parser
|
|
5
|
+
* surface from {@link @danielsimonjr/mathts-expression} — the `parse` function
|
|
6
|
+
* factory and the `Parser` class factory, along with the AST node constructors
|
|
7
|
+
* that parsing produces and the operator/keyword metadata the parser relies on —
|
|
8
|
+
* so it can be installed and consumed on its own (mirroring the other MathTS
|
|
9
|
+
* packages: expression, matrix, parallel, functions, …).
|
|
10
|
+
*
|
|
11
|
+
* The implementation lives in `@danielsimonjr/mathts-expression`; this package is
|
|
12
|
+
* a focused entry point, not a copy.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { createParse, createParserClass } from '@danielsimonjr/mathts-parser';
|
|
17
|
+
* // wire the factory into your MathTS instance via create()/typed-function,
|
|
18
|
+
* // exactly as you would when consuming it from @danielsimonjr/mathts-expression.
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @packageDocumentation
|
|
22
|
+
*/
|
|
23
|
+
export { createParse, createParserClass, createParser, createNode, createAccessorNode, createArrayNode, createAssignmentNode, createBlockNode, createConditionalNode, createConstantNode, createFunctionAssignmentNode, createFunctionNode, createIndexNode, createObjectNode, createOperatorNode, createParenthesisNode, createRangeNode, createRelationalNode, createSymbolNode, keywords, properties, getPrecedence, getAssociativity, isAssociativeWith, getOperator, } from '@danielsimonjr/mathts-expression';
|
|
24
|
+
export type * from '@danielsimonjr/mathts-expression';
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAEL,WAAW,EACX,iBAAiB,EACjB,YAAY,EAGZ,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,4BAA4B,EAC5B,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAGhB,QAAQ,EACR,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,GACZ,MAAM,kCAAkC,CAAC;AAG1C,mBAAmB,kCAAkC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@danielsimonjr/mathts-parser",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Standalone expression parser for MathTS
|
|
5
|
-
"author": "Daniel Simon Jr.",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"type": "module",
|
|
8
|
-
"main": "./dist/index.js",
|
|
9
|
-
"module": "./dist/index.js",
|
|
10
|
-
"types": "./dist/index.d.ts",
|
|
11
|
-
"exports": {
|
|
12
|
-
".": {
|
|
13
|
-
"import": "./dist/index.js",
|
|
14
|
-
"types": "./dist/index.d.ts"
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
"files": [
|
|
18
|
-
"dist",
|
|
19
|
-
"README.md"
|
|
20
|
-
],
|
|
21
|
-
"scripts": {
|
|
22
|
-
"build": "tsup src/index.ts --format esm --dts
|
|
23
|
-
"dev": "tsup src/index.ts --format esm --dts --watch",
|
|
24
|
-
"test": "
|
|
25
|
-
"test:watch": "vitest",
|
|
26
|
-
"test:coverage": "
|
|
27
|
-
"typecheck": "tsc --noEmit",
|
|
28
|
-
"lint": "
|
|
29
|
-
"lint:fix": "
|
|
30
|
-
"clean": "rm -rf dist",
|
|
31
|
-
"build:prod": "tsup src/index.ts --format esm --dts --clean --minify --treeshake"
|
|
32
|
-
},
|
|
33
|
-
"dependencies": {
|
|
34
|
-
"@danielsimonjr/mathts-core": "^0.
|
|
35
|
-
"@danielsimonjr/mathts-expression": "^0.
|
|
36
|
-
"typed-function": "^4.0.0"
|
|
37
|
-
},
|
|
38
|
-
"devDependencies": {
|
|
39
|
-
"@types/node": "^
|
|
40
|
-
"tsup": "^8.0.0",
|
|
41
|
-
"typescript": "^
|
|
42
|
-
"vitest": "^
|
|
43
|
-
},
|
|
44
|
-
"publishConfig": {
|
|
45
|
-
"access": "public"
|
|
46
|
-
},
|
|
47
|
-
"repository": {
|
|
48
|
-
"type": "git",
|
|
49
|
-
"url": "git+https://github.com/danielsimonjr/MathTS.git",
|
|
50
|
-
"directory": "parser"
|
|
51
|
-
},
|
|
52
|
-
"keywords": [
|
|
53
|
-
"math",
|
|
54
|
-
"typescript",
|
|
55
|
-
"parser",
|
|
56
|
-
"parse",
|
|
57
|
-
"expression",
|
|
58
|
-
"ast",
|
|
59
|
-
"tokenizer"
|
|
60
|
-
]
|
|
61
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@danielsimonjr/mathts-parser",
|
|
3
|
+
"version": "0.1.20",
|
|
4
|
+
"description": "Standalone expression parser for MathTS \u2014 the parse function and Parser class, re-exported as a focused package",
|
|
5
|
+
"author": "Daniel Simon Jr.",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"module": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsup src/index.ts --format esm --clean && tsc -p tsconfig.dts.json",
|
|
23
|
+
"dev": "tsup src/index.ts --format esm --dts --watch",
|
|
24
|
+
"test": "bun test",
|
|
25
|
+
"test:watch": "vitest",
|
|
26
|
+
"test:coverage": "bun test --coverage",
|
|
27
|
+
"typecheck": "tsc --noEmit",
|
|
28
|
+
"lint": "oxlint src",
|
|
29
|
+
"lint:fix": "oxlint src --fix",
|
|
30
|
+
"clean": "rm -rf dist",
|
|
31
|
+
"build:prod": "tsup src/index.ts --format esm --dts --clean --minify --treeshake"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@danielsimonjr/mathts-core": "^0.15.0",
|
|
35
|
+
"@danielsimonjr/mathts-expression": "^0.8.0",
|
|
36
|
+
"typed-function": "^4.0.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@types/node": "^26.4.0",
|
|
40
|
+
"tsup": "^8.0.0",
|
|
41
|
+
"typescript": "^7.0.2",
|
|
42
|
+
"vitest": "^5.0.0"
|
|
43
|
+
},
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public"
|
|
46
|
+
},
|
|
47
|
+
"repository": {
|
|
48
|
+
"type": "git",
|
|
49
|
+
"url": "git+https://github.com/danielsimonjr/MathTS.git",
|
|
50
|
+
"directory": "parser"
|
|
51
|
+
},
|
|
52
|
+
"keywords": [
|
|
53
|
+
"math",
|
|
54
|
+
"typescript",
|
|
55
|
+
"parser",
|
|
56
|
+
"parse",
|
|
57
|
+
"expression",
|
|
58
|
+
"ast",
|
|
59
|
+
"tokenizer"
|
|
60
|
+
]
|
|
61
|
+
}
|