bare-script 3.8.20__tar.gz → 3.8.22__tar.gz

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 (36) hide show
  1. {bare_script-3.8.20/src/bare_script.egg-info → bare_script-3.8.22}/PKG-INFO +1 -1
  2. {bare_script-3.8.20 → bare_script-3.8.22}/setup.cfg +1 -1
  3. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/library.py +9 -4
  4. {bare_script-3.8.20 → bare_script-3.8.22/src/bare_script.egg-info}/PKG-INFO +1 -1
  5. {bare_script-3.8.20 → bare_script-3.8.22}/LICENSE +0 -0
  6. {bare_script-3.8.20 → bare_script-3.8.22}/README.md +0 -0
  7. {bare_script-3.8.20 → bare_script-3.8.22}/pyproject.toml +0 -0
  8. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/__init__.py +0 -0
  9. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/__main__.py +0 -0
  10. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/bare.py +0 -0
  11. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/baredoc.py +0 -0
  12. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/data.py +0 -0
  13. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/include/__init__.py +0 -0
  14. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/include/args.bare +0 -0
  15. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/include/baredoc.bare +0 -0
  16. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/include/dataLineChart.bare +0 -0
  17. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/include/dataTable.bare +0 -0
  18. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/include/diff.bare +0 -0
  19. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/include/elementModel.bare +0 -0
  20. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/include/forms.bare +0 -0
  21. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/include/markdownUp.bare +0 -0
  22. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/include/pager.bare +0 -0
  23. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/include/qrcode.bare +0 -0
  24. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/include/schemaDoc.bare +0 -0
  25. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/include/unittest.bare +0 -0
  26. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/include/unittestMock.bare +0 -0
  27. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/model.py +0 -0
  28. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/options.py +0 -0
  29. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/parser.py +0 -0
  30. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/runtime.py +0 -0
  31. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/value.py +0 -0
  32. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script.egg-info/SOURCES.txt +0 -0
  33. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script.egg-info/dependency_links.txt +0 -0
  34. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script.egg-info/entry_points.txt +0 -0
  35. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script.egg-info/requires.txt +0 -0
  36. {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bare-script
3
- Version: 3.8.20
3
+ Version: 3.8.22
4
4
  Summary: bare-script
5
5
  Home-page: https://github.com/craigahobbs/bare-script
6
6
  Author: Craig A. Hobbs
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = bare-script
3
- version = 3.8.20
3
+ version = 3.8.22
4
4
  url = https://github.com/craigahobbs/bare-script
5
5
  author = Craig A. Hobbs
6
6
  author_email = craigahobbs@gmail.com
@@ -403,18 +403,19 @@ _ARRAY_SORT_ARGS = value_args_model([
403
403
  # $doc: Evaluate a [BareScript expression model](../model/#var.vName='Expression')
404
404
  # $arg expr: The [BareScript expression model](../model/#var.vName='Expression')
405
405
  # $arg locals: Optional (default is null). The local variables object.
406
- # $arg builtins: Optional (default is true). If true, include the [built-in expression functions](expression.html).
406
+ # $arg globals: Optional (default is null). The global variables object.
407
407
  # $return: The expression result
408
408
  def _barescript_evaluate_expression(args, options):
409
- expr, locals_, builtins = value_args_validate(_BARESCRIPT_EVALUATE_EXPRESSION_ARGS, args)
409
+ expr, locals_, globals_ = value_args_validate(_BARESCRIPT_EVALUATE_EXPRESSION_ARGS, args)
410
410
  validate_expression(expr)
411
+ evaluate_options = options if globals_ is None else {**options, 'globals': globals_}
411
412
  evaluate_expression = _import_evaluate_expression()
412
- return evaluate_expression(expr, options, locals_, builtins)
413
+ return evaluate_expression(expr, evaluate_options, locals_, False)
413
414
 
414
415
  _BARESCRIPT_EVALUATE_EXPRESSION_ARGS = value_args_model([
415
416
  {'name': 'expr', 'type': 'object'},
416
417
  {'name': 'locals', 'type': 'object', 'nullable': True},
417
- {'name': 'builtins', 'type': 'boolean', 'default': True}
418
+ {'name': 'globals', 'type': 'object', 'nullable': True}
418
419
  ])
419
420
 
420
421
 
@@ -1499,6 +1500,9 @@ def _regex_new(args, unused_options):
1499
1500
  # Translate JavaScript named group syntax to Python
1500
1501
  pattern = _R_REGEX_NEW_NAMED.sub(r'(?P<\1>', pattern)
1501
1502
 
1503
+ # Translate JavaScript backreference syntax to Python
1504
+ pattern = _R_REGEX_NEW_BACKREF.sub(r'(?P=\1)', pattern)
1505
+
1502
1506
  # Compute the flags mask
1503
1507
  flags_mask = 0
1504
1508
  if flags is not None:
@@ -1521,6 +1525,7 @@ _REGEX_NEW_ARGS = value_args_model([
1521
1525
 
1522
1526
 
1523
1527
  _R_REGEX_NEW_NAMED = re.compile(r'\(\?<(\w+)>')
1528
+ _R_REGEX_NEW_BACKREF = re.compile(r'\\k<(\w+)>')
1524
1529
 
1525
1530
 
1526
1531
  # $function: regexReplace
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bare-script
3
- Version: 3.8.20
3
+ Version: 3.8.22
4
4
  Summary: bare-script
5
5
  Home-page: https://github.com/craigahobbs/bare-script
6
6
  Author: Craig A. Hobbs
File without changes
File without changes