@tinta-lang/syntax 0.1.0-dev.0 → 0.1.19
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 +17 -0
- package/dist/index.js +7 -7
- package/dist/registry.d.ts +7 -7
- package/package.json +12 -3
package/README.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# @tinta-lang/syntax
|
|
2
|
+
|
|
3
|
+
Parse ordinary Markdown or tinta source while preserving original text positions. You can also create a separate tinta version of an existing Markdown document with `enrichMarkdown`.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { parse } from "@tinta-lang/syntax";
|
|
7
|
+
|
|
8
|
+
const result = parse({
|
|
9
|
+
uri: "tinta:example",
|
|
10
|
+
profile: "tinta",
|
|
11
|
+
text: "# Hello\n",
|
|
12
|
+
});
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
A successful parse confirms syntax only. To check names, types and calculations, use `@tinta-lang/engine`. The parser does not render HTML or read files.
|
|
16
|
+
|
|
17
|
+
See the [syntax API](https://github.com/planta7/tinta/blob/main/docs/10_SYNTAX_API.md) and [language guide](https://github.com/planta7/tinta/blob/main/docs/CHEATSHEET.md).
|
package/dist/index.js
CHANGED
|
@@ -8091,10 +8091,10 @@ var registry = {
|
|
|
8091
8091
|
E_EXPRESSION_SYNTAX: "Invalid/unfinished expression token sequence.",
|
|
8092
8092
|
E_NAME_RESERVED: "Reserved or invalid identifier.",
|
|
8093
8093
|
E_NAME_DUPLICATE: "Document name declared more than once.",
|
|
8094
|
-
E_NAME_UNKNOWN: "
|
|
8094
|
+
E_NAME_UNKNOWN: "This name has not been defined in the document.",
|
|
8095
8095
|
E_ROW_SCOPE: "row.field used outside a supported row context.",
|
|
8096
8096
|
E_COLUMN_UNKNOWN: "Referenced table column does not exist.",
|
|
8097
|
-
E_TYPE: "
|
|
8097
|
+
E_TYPE: "This value has the wrong type for this operation.",
|
|
8098
8098
|
E_FUNCTION_ARITY: "Incorrect number of function arguments.",
|
|
8099
8099
|
E_CONST_DEPENDENCY: "Constant depends on nonconstant state/data.",
|
|
8100
8100
|
E_CYCLE: "Dependency cycle detected.",
|
|
@@ -8103,7 +8103,7 @@ var registry = {
|
|
|
8103
8103
|
E_DIGITS_RANGE: "Formatting/rounding digits are outside integer 0\u201310.",
|
|
8104
8104
|
E_EMPTY_MEAN: "Mean requested for an empty table/view.",
|
|
8105
8105
|
E_STATE_NAME: "Update names an unknown/non-control symbol.",
|
|
8106
|
-
E_STATE_DOMAIN: "
|
|
8106
|
+
E_STATE_DOMAIN: "The control value is outside its allowed range or choices.",
|
|
8107
8107
|
E_DATA_HEADER: "Invalid or duplicate typed table header.",
|
|
8108
8108
|
E_DATA_ARITY: "Row cell count differs from the schema.",
|
|
8109
8109
|
E_DATA_VALUE: "Cell is not a valid scalar for its declared type.",
|
|
@@ -8122,11 +8122,11 @@ var registry = {
|
|
|
8122
8122
|
E_ASSET_PATH: "Unsafe resource or ZIP entry path.",
|
|
8123
8123
|
E_BUNDLE: "Malformed bundle, duplicate keys/entries, CRC or manifest mismatch.",
|
|
8124
8124
|
E_HASH_MISMATCH: "Source/resource hash does not match its envelope.",
|
|
8125
|
-
E_SNAPSHOT: "
|
|
8125
|
+
E_SNAPSHOT: "The saved answers do not match this document and its controls.",
|
|
8126
8126
|
E_EXPORT_INVALID: "Export requested for invalid/stale source or an invalid state.",
|
|
8127
8127
|
E_OUTPUT_EXISTS: "Output already exists and replacement is not authorized.",
|
|
8128
|
-
E_IO: "
|
|
8129
|
-
E_WORKER_TIMEOUT: "
|
|
8128
|
+
E_IO: "Could not read or write the selected file.",
|
|
8129
|
+
E_WORKER_TIMEOUT: "The document took too long to process.",
|
|
8130
8130
|
E_PROTOCOL: "Malformed or unauthorized host protocol message; stale valid results are ignored.",
|
|
8131
8131
|
E_INTERNAL: "Unexpected engine fault; not a document syntax diagnosis."
|
|
8132
8132
|
},
|
|
@@ -8135,7 +8135,7 @@ var registry = {
|
|
|
8135
8135
|
W_HTML_INERT: "Raw author HTML displayed as text.",
|
|
8136
8136
|
W_LINK_LOCAL_UNSUPPORTED: "Local document navigation is not implemented.",
|
|
8137
8137
|
W_LINK_UNSAFE: "Unsafe/unsupported link disabled.",
|
|
8138
|
-
W_ASSET_UNAVAILABLE: "
|
|
8138
|
+
W_ASSET_UNAVAILABLE: "A document image is unavailable. Exports require all images they include.",
|
|
8139
8139
|
W_RECOVERY_UNAVAILABLE: "Local browser recovery is unavailable.",
|
|
8140
8140
|
W_MARKDOWN_COLLISION: "Enrichment proposes escapes for Tinta-looking literal text."
|
|
8141
8141
|
}
|
package/dist/registry.d.ts
CHANGED
|
@@ -93,10 +93,10 @@ export declare const registry: {
|
|
|
93
93
|
readonly E_EXPRESSION_SYNTAX: "Invalid/unfinished expression token sequence.";
|
|
94
94
|
readonly E_NAME_RESERVED: "Reserved or invalid identifier.";
|
|
95
95
|
readonly E_NAME_DUPLICATE: "Document name declared more than once.";
|
|
96
|
-
readonly E_NAME_UNKNOWN: "
|
|
96
|
+
readonly E_NAME_UNKNOWN: "This name has not been defined in the document.";
|
|
97
97
|
readonly E_ROW_SCOPE: "row.field used outside a supported row context.";
|
|
98
98
|
readonly E_COLUMN_UNKNOWN: "Referenced table column does not exist.";
|
|
99
|
-
readonly E_TYPE: "
|
|
99
|
+
readonly E_TYPE: "This value has the wrong type for this operation.";
|
|
100
100
|
readonly E_FUNCTION_ARITY: "Incorrect number of function arguments.";
|
|
101
101
|
readonly E_CONST_DEPENDENCY: "Constant depends on nonconstant state/data.";
|
|
102
102
|
readonly E_CYCLE: "Dependency cycle detected.";
|
|
@@ -105,7 +105,7 @@ export declare const registry: {
|
|
|
105
105
|
readonly E_DIGITS_RANGE: "Formatting/rounding digits are outside integer 0–10.";
|
|
106
106
|
readonly E_EMPTY_MEAN: "Mean requested for an empty table/view.";
|
|
107
107
|
readonly E_STATE_NAME: "Update names an unknown/non-control symbol.";
|
|
108
|
-
readonly E_STATE_DOMAIN: "
|
|
108
|
+
readonly E_STATE_DOMAIN: "The control value is outside its allowed range or choices.";
|
|
109
109
|
readonly E_DATA_HEADER: "Invalid or duplicate typed table header.";
|
|
110
110
|
readonly E_DATA_ARITY: "Row cell count differs from the schema.";
|
|
111
111
|
readonly E_DATA_VALUE: "Cell is not a valid scalar for its declared type.";
|
|
@@ -124,11 +124,11 @@ export declare const registry: {
|
|
|
124
124
|
readonly E_ASSET_PATH: "Unsafe resource or ZIP entry path.";
|
|
125
125
|
readonly E_BUNDLE: "Malformed bundle, duplicate keys/entries, CRC or manifest mismatch.";
|
|
126
126
|
readonly E_HASH_MISMATCH: "Source/resource hash does not match its envelope.";
|
|
127
|
-
readonly E_SNAPSHOT: "
|
|
127
|
+
readonly E_SNAPSHOT: "The saved answers do not match this document and its controls.";
|
|
128
128
|
readonly E_EXPORT_INVALID: "Export requested for invalid/stale source or an invalid state.";
|
|
129
129
|
readonly E_OUTPUT_EXISTS: "Output already exists and replacement is not authorized.";
|
|
130
|
-
readonly E_IO: "
|
|
131
|
-
readonly E_WORKER_TIMEOUT: "
|
|
130
|
+
readonly E_IO: "Could not read or write the selected file.";
|
|
131
|
+
readonly E_WORKER_TIMEOUT: "The document took too long to process.";
|
|
132
132
|
readonly E_PROTOCOL: "Malformed or unauthorized host protocol message; stale valid results are ignored.";
|
|
133
133
|
readonly E_INTERNAL: "Unexpected engine fault; not a document syntax diagnosis.";
|
|
134
134
|
};
|
|
@@ -137,7 +137,7 @@ export declare const registry: {
|
|
|
137
137
|
readonly W_HTML_INERT: "Raw author HTML displayed as text.";
|
|
138
138
|
readonly W_LINK_LOCAL_UNSUPPORTED: "Local document navigation is not implemented.";
|
|
139
139
|
readonly W_LINK_UNSAFE: "Unsafe/unsupported link disabled.";
|
|
140
|
-
readonly W_ASSET_UNAVAILABLE: "
|
|
140
|
+
readonly W_ASSET_UNAVAILABLE: "A document image is unavailable. Exports require all images they include.";
|
|
141
141
|
readonly W_RECOVERY_UNAVAILABLE: "Local browser recovery is unavailable.";
|
|
142
142
|
readonly W_MARKDOWN_COLLISION: "Enrichment proposes escapes for Tinta-looking literal text.";
|
|
143
143
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinta-lang/syntax",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19",
|
|
4
|
+
"description": "Parse Markdown and tinta source, and enrich existing Markdown documents.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"tinta",
|
|
7
|
+
"markdown",
|
|
8
|
+
"parser",
|
|
9
|
+
"syntax"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://github.com/planta7/tinta/blob/main/packages/syntax/README.md",
|
|
4
12
|
"private": false,
|
|
5
13
|
"type": "module",
|
|
6
14
|
"license": "MIT",
|
|
@@ -9,7 +17,7 @@
|
|
|
9
17
|
},
|
|
10
18
|
"publishConfig": {
|
|
11
19
|
"access": "public",
|
|
12
|
-
"tag": "
|
|
20
|
+
"tag": "latest"
|
|
13
21
|
},
|
|
14
22
|
"exports": {
|
|
15
23
|
".": {
|
|
@@ -18,7 +26,7 @@
|
|
|
18
26
|
}
|
|
19
27
|
},
|
|
20
28
|
"dependencies": {
|
|
21
|
-
"@tinta-lang/types": "0.1.
|
|
29
|
+
"@tinta-lang/types": "0.1.19",
|
|
22
30
|
"micromark": "4.0.3",
|
|
23
31
|
"mdast-util-from-markdown": "2.1.0",
|
|
24
32
|
"micromark-extension-gfm-table": "2.1.2",
|
|
@@ -31,6 +39,7 @@
|
|
|
31
39
|
},
|
|
32
40
|
"files": [
|
|
33
41
|
"LICENSE",
|
|
42
|
+
"README.md",
|
|
34
43
|
"THIRD_PARTY_NOTICES.txt",
|
|
35
44
|
"dist/directive.d.ts",
|
|
36
45
|
"dist/editing.d.ts",
|