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.
- {bare_script-3.8.20/src/bare_script.egg-info → bare_script-3.8.22}/PKG-INFO +1 -1
- {bare_script-3.8.20 → bare_script-3.8.22}/setup.cfg +1 -1
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/library.py +9 -4
- {bare_script-3.8.20 → bare_script-3.8.22/src/bare_script.egg-info}/PKG-INFO +1 -1
- {bare_script-3.8.20 → bare_script-3.8.22}/LICENSE +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/README.md +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/pyproject.toml +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/__init__.py +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/__main__.py +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/bare.py +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/baredoc.py +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/data.py +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/include/__init__.py +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/include/args.bare +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/include/baredoc.bare +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/include/dataLineChart.bare +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/include/dataTable.bare +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/include/diff.bare +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/include/elementModel.bare +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/include/forms.bare +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/include/markdownUp.bare +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/include/pager.bare +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/include/qrcode.bare +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/include/schemaDoc.bare +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/include/unittest.bare +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/include/unittestMock.bare +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/model.py +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/options.py +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/parser.py +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/runtime.py +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script/value.py +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script.egg-info/SOURCES.txt +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script.egg-info/dependency_links.txt +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script.egg-info/entry_points.txt +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script.egg-info/requires.txt +0 -0
- {bare_script-3.8.20 → bare_script-3.8.22}/src/bare_script.egg-info/top_level.txt +0 -0
|
@@ -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
|
|
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_,
|
|
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,
|
|
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': '
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|