@larkup/sandbox 0.1.14 → 0.1.15

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @larkup/sandbox
2
2
 
3
+ ## 0.1.15
4
+
5
+ ### Patch Changes
6
+
7
+ - 95093cc: Preserve escaped Python source on strict tokenizers and refine shared data browsing, source artwork, groups, and controls.
8
+
3
9
  ## 0.1.14
4
10
 
5
11
  ### Patch Changes
@@ -22,11 +22,15 @@ except SyntaxError as _larkup_original_error:
22
22
  for _larkup_line in _larkup_lines:
23
23
  _larkup_offsets.append(_larkup_offsets[-1] + len(_larkup_line))
24
24
  _larkup_protected = set()
25
+ # Keep offsets stable without feeding escaped separators to strict tokenizers.
26
+ _larkup_token_source = _larkup_source.replace(chr(92) + 'n', ' ')
25
27
  try:
26
28
  _larkup_fstring_depth = 0
27
- for _larkup_token in _larkup_tokenize.generate_tokens(_larkup_io.StringIO(_larkup_source).readline):
29
+ for _larkup_token in _larkup_tokenize.generate_tokens(_larkup_io.StringIO(_larkup_token_source).readline):
28
30
  _larkup_kind = _larkup_tokenize.tok_name[_larkup_token.type]
29
31
  if _larkup_kind == 'FSTRING_START':
32
+ if _larkup_fstring_depth == 0:
33
+ _larkup_fstring_start = _larkup_offsets[_larkup_token.start[0] - 1] + _larkup_token.start[1]
30
34
  _larkup_fstring_depth += 1
31
35
  if _larkup_token.type in (_larkup_tokenize.STRING, _larkup_tokenize.COMMENT) or _larkup_fstring_depth:
32
36
  _larkup_start = _larkup_offsets[_larkup_token.start[0] - 1] + _larkup_token.start[1]
@@ -34,6 +38,8 @@ except SyntaxError as _larkup_original_error:
34
38
  _larkup_protected.update(range(_larkup_start, _larkup_end))
35
39
  if _larkup_kind == 'FSTRING_END':
36
40
  _larkup_fstring_depth -= 1
41
+ if _larkup_fstring_depth == 0:
42
+ _larkup_protected.update(range(_larkup_fstring_start, _larkup_end))
37
43
  except (_larkup_tokenize.TokenError, IndentationError):
38
44
  raise _larkup_original_error
39
45
  _larkup_repaired = []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@larkup/sandbox",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -44,9 +44,9 @@
44
44
  },
45
45
  "optionalDependencies": {
46
46
  "e2b": "^2.39.0",
47
- "@vercel/sandbox": "^3.0.0",
47
+ "@vercel/sandbox": "^4.0.0",
48
48
  "modal": "^0.11.0",
49
- "@daytona/sdk": "^0.227.3",
49
+ "@daytona/sdk": "^2.0.0",
50
50
  "@browserbasehq/sdk": "^2.17.0",
51
51
  "playwright-core": "^1.62.1",
52
52
  "@fly/sprites": "^0.2.0",