svelte-common 4.22.7 → 4.22.8

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/attribute.mjs +24 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-common",
3
- "version": "4.22.7",
3
+ "version": "4.22.8",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/attribute.mjs CHANGED
@@ -14,25 +14,40 @@ export function* tokens(string) {
14
14
  if (identifier.length) {
15
15
  yield identifier;
16
16
  identifier = "";
17
+ }
18
+ if(last) {
19
+ yield last;
20
+ last = undefined;
17
21
  }
18
22
  break;
19
23
 
20
24
  case "!":
21
25
  case ">":
22
- case "<": last = c;
26
+ case "<":
27
+ if(last) {
28
+ yield last;
29
+ }
30
+ last = c;
23
31
  break;
24
32
 
25
33
  case "=":
26
34
  if(last) {
27
35
  yield last + c;
28
36
  last = undefined;
29
- // delete last;
30
37
  break;
31
38
  }
32
39
 
40
+ case "+":
41
+ case "-":
33
42
  case ".":
43
+ case "(":
44
+ case ")":
34
45
  case "[":
35
46
  case "]":
47
+ if(last) {
48
+ yield last;
49
+ last = undefined;
50
+ }
36
51
  if (identifier.length) {
37
52
  yield identifier;
38
53
  identifier = "";
@@ -40,19 +55,20 @@ export function* tokens(string) {
40
55
  yield c;
41
56
  break;
42
57
  default:
58
+ if(last) {
59
+ yield last;
60
+ last = undefined;
61
+ }
43
62
  identifier += c;
44
63
  }
45
-
46
- if(last) {
47
- yield last;
48
- last = undefined;
49
- // delete last;
50
- }
51
64
  }
52
65
 
53
66
  if (identifier.length) {
54
67
  yield identifier;
55
68
  }
69
+ if(last) {
70
+ yield last;
71
+ }
56
72
  }
57
73
 
58
74
  /**