@altopelago/aeon-lexer 0.9.0 → 0.9.2
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/LICENSE +21 -0
- package/README.md +24 -0
- package/package.json +28 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AltoPelago
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -15,10 +15,34 @@ import { tokenize } from '@altopelago/aeon-lexer';
|
|
|
15
15
|
|
|
16
16
|
const result = tokenize('answer = 42');
|
|
17
17
|
|
|
18
|
+
if (result.errors.length > 0) {
|
|
19
|
+
console.error(result.errors);
|
|
20
|
+
}
|
|
21
|
+
|
|
18
22
|
for (const token of result.tokens) {
|
|
19
23
|
console.log(token.kind, token.raw);
|
|
20
24
|
}
|
|
21
25
|
```
|
|
22
26
|
|
|
27
|
+
## What This Package Does
|
|
28
|
+
|
|
29
|
+
- converts AEON source text into lexer tokens
|
|
30
|
+
- preserves raw token text for diagnostics and source-aware tooling
|
|
31
|
+
- reports lexical errors without executing or interpreting document meaning
|
|
32
|
+
|
|
33
|
+
## API
|
|
34
|
+
|
|
35
|
+
- `tokenize(input, options?)`
|
|
36
|
+
- token kinds and token metadata types used by parser and editor tooling
|
|
37
|
+
|
|
38
|
+
## When To Use It
|
|
39
|
+
|
|
23
40
|
Use this package when you need direct token access for tooling, analysis, or editor features.
|
|
24
41
|
If you want the stable application-facing entry point, prefer `@altopelago/aeon-core`.
|
|
42
|
+
|
|
43
|
+
## Notes
|
|
44
|
+
|
|
45
|
+
- The lexer does not build AST nodes.
|
|
46
|
+
- The lexer does not validate AEON schemas or materialize JSON.
|
|
47
|
+
- Downstream packages such as `@altopelago/aeon-parser` and
|
|
48
|
+
`@altopelago/aeon-core` consume the token stream.
|
package/package.json
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@altopelago/aeon-lexer",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
|
+
"description": "Tokenize AEON source text for parsers, editors, and tooling.",
|
|
5
|
+
"license": "MIT",
|
|
4
6
|
"type": "module",
|
|
5
7
|
"main": "./dist/index.js",
|
|
6
8
|
"types": "./dist/index.d.ts",
|
|
@@ -17,6 +19,31 @@
|
|
|
17
19
|
"!dist/**/*.test.js",
|
|
18
20
|
"!dist/**/*.test.js.map"
|
|
19
21
|
],
|
|
22
|
+
"sideEffects": false,
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=20.0.0"
|
|
25
|
+
},
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/AltoPelago/aeon.git",
|
|
29
|
+
"directory": "implementations/typescript/packages/lexer"
|
|
30
|
+
},
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/AltoPelago/aeon/issues"
|
|
33
|
+
},
|
|
34
|
+
"homepage": "https://github.com/AltoPelago/aeon/tree/main/implementations/typescript/packages/lexer#readme",
|
|
35
|
+
"keywords": [
|
|
36
|
+
"aeon",
|
|
37
|
+
"aeonite",
|
|
38
|
+
"lexer",
|
|
39
|
+
"tokenizer",
|
|
40
|
+
"tokens",
|
|
41
|
+
"syntax",
|
|
42
|
+
"typescript"
|
|
43
|
+
],
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public"
|
|
46
|
+
},
|
|
20
47
|
"scripts": {
|
|
21
48
|
"build": "tsc -p tsconfig.json",
|
|
22
49
|
"test": "node --test dist/*.test.js",
|