pacc 6.7.0 → 6.7.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 CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (C) 2023-2025 by arlac77
1
+ Copyright (C) 2023-2026 by arlac77
2
2
 
3
3
  Permission to use, copy, modify, and/or distribute this software for any
4
4
  purpose with or without fee is hereby granted.
package/README.md CHANGED
@@ -81,6 +81,7 @@ const result = getAttribute({ a: [0,{ b: 4 }]}, "a[1].b");
81
81
  * [title\_attribute\_writable](#title_attribute_writable)
82
82
  * [priority\_attribute](#priority_attribute)
83
83
  * [duration\_attribute](#duration_attribute)
84
+ * [duration\_attribute\_writable](#duration_attribute_writable)
84
85
  * [duration\_ms\_attribute](#duration_ms_attribute)
85
86
  * [timeout\_attribute](#timeout_attribute)
86
87
  * [language\_attribute](#language_attribute)
@@ -412,6 +413,10 @@ Type: [AttributeDefinition](#attributedefinition)
412
413
 
413
414
  Type: [AttributeDefinition](#attributedefinition)
414
415
 
416
+ ## duration\_attribute\_writable
417
+
418
+ Type: [AttributeDefinition](#attributedefinition)
419
+
415
420
  ## duration\_ms\_attribute
416
421
 
417
422
  Type: [AttributeDefinition](#attributedefinition)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pacc",
3
- "version": "6.7.0",
3
+ "version": "6.7.2",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
package/src/tokens.mjs CHANGED
@@ -63,7 +63,7 @@ export /** @type {Token} */ const EOF = createToken("EOF", -1, "eof");
63
63
  * @yields {Token}
64
64
  */
65
65
  export function* tokens(string) {
66
- let state, value, hex, divider;
66
+ let state, value, hex, divider, quote;
67
67
 
68
68
  function maybeKeyword() {
69
69
  switch (value) {
@@ -106,6 +106,8 @@ export function* tokens(string) {
106
106
  }
107
107
 
108
108
  switch (c) {
109
+ case "\n":
110
+ case "\r":
109
111
  case "\t":
110
112
  case " ":
111
113
  switch (state) {
@@ -145,20 +147,27 @@ export function* tokens(string) {
145
147
  case undefined:
146
148
  value = "";
147
149
  state = "string";
150
+ quote = c;
148
151
  break;
149
152
  case "string":
150
- yield [value];
151
- state = undefined;
153
+ if (c === quote) {
154
+ yield [value];
155
+ state = undefined;
156
+ } else {
157
+ value += c;
158
+ }
152
159
  break;
153
160
  case "identifier":
154
161
  yield maybeKeyword();
155
162
  value = "";
156
163
  state = "string";
164
+ quote = c;
157
165
  break;
158
166
  default:
159
167
  yield lookup[state];
160
168
  value = "";
161
169
  state = "string";
170
+ quote = c;
162
171
  }
163
172
  break;
164
173
  case "!":
@@ -315,10 +324,7 @@ export function* tokens(string) {
315
324
  case undefined:
316
325
  break;
317
326
  case "string":
318
- const error = new Error("unterminated string");
319
- // @ts-ignore
320
- error.expression = string;
321
- throw error;
327
+ throw new Error("unterminated string", { cause: string });
322
328
  case "number-fraction":
323
329
  case "number":
324
330
  yield [value];