bare-script 3.5.2__tar.gz → 3.5.3__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.5.2/src/bare_script.egg-info → bare_script-3.5.3}/PKG-INFO +1 -1
- {bare_script-3.5.2 → bare_script-3.5.3}/setup.cfg +1 -1
- {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/parser.py +25 -17
- {bare_script-3.5.2 → bare_script-3.5.3/src/bare_script.egg-info}/PKG-INFO +1 -1
- {bare_script-3.5.2 → bare_script-3.5.3}/LICENSE +0 -0
- {bare_script-3.5.2 → bare_script-3.5.3}/README.md +0 -0
- {bare_script-3.5.2 → bare_script-3.5.3}/pyproject.toml +0 -0
- {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/__init__.py +0 -0
- {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/__main__.py +0 -0
- {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/bare.py +0 -0
- {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/baredoc.py +0 -0
- {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/data.py +0 -0
- {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/include/__init__.py +0 -0
- {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/include/args.bare +0 -0
- {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/include/diff.bare +0 -0
- {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/include/forms.bare +0 -0
- {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/include/markdownUp.bare +0 -0
- {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/include/pager.bare +0 -0
- {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/include/unittest.bare +0 -0
- {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/include/unittestMock.bare +0 -0
- {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/library.py +0 -0
- {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/model.py +0 -0
- {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/options.py +0 -0
- {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/runtime.py +0 -0
- {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/value.py +0 -0
- {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script.egg-info/SOURCES.txt +0 -0
- {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script.egg-info/dependency_links.txt +0 -0
- {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script.egg-info/entry_points.txt +0 -0
- {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script.egg-info/requires.txt +0 -0
- {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script.egg-info/top_level.txt +0 -0
|
@@ -408,27 +408,30 @@ _R_SCRIPT_LINE_SPLIT = re.compile(r'\r?\n')
|
|
|
408
408
|
_R_SCRIPT_CONTINUATION = re.compile(r'\\\s*$')
|
|
409
409
|
_R_SCRIPT_COMMENT = re.compile(r'^\s*(?:#.*)?$')
|
|
410
410
|
_R_SCRIPT_ASSIGNMENT = re.compile(r'^\s*(?P<name>[A-Za-z_]\w*)\s*=\s*(?P<expr>.+)$')
|
|
411
|
+
_R_PART_COMMENT = r'\s*(#.*)?$'
|
|
411
412
|
_R_SCRIPT_FUNCTION_BEGIN = re.compile(
|
|
412
413
|
r'^(?P<async>\s*async)?\s*function\s+(?P<name>[A-Za-z_]\w*)\s*\('
|
|
413
|
-
r'\s*(?P<args>[A-Za-z_]\w*(?:\s*,\s*[A-Za-z_]\w*)*)?(?P<lastArgArray>\s*\.\.\.)?\s*\)\s
|
|
414
|
+
r'\s*(?P<args>[A-Za-z_]\w*(?:\s*,\s*[A-Za-z_]\w*)*)?(?P<lastArgArray>\s*\.\.\.)?\s*\)\s*:' + _R_PART_COMMENT
|
|
414
415
|
)
|
|
415
416
|
_R_SCRIPT_FUNCTION_ARG_SPLIT = re.compile(r'\s*,\s*')
|
|
416
|
-
_R_SCRIPT_FUNCTION_END = re.compile(r'^\s*endfunction
|
|
417
|
-
_R_SCRIPT_LABEL = re.compile(r'^\s*(?P<name>[A-Za-z_]\w*)\s
|
|
418
|
-
_R_SCRIPT_JUMP = re.compile(r'^(?P<jump>\s*(?:jump|jumpif\s*\((?P<expr>.+)\)))\s+(?P<name>[A-Za-z_]\w*)
|
|
419
|
-
_R_SCRIPT_RETURN = re.compile(r'^(?P<return>\s*return(?:\s+(?P<expr>.+))?)
|
|
420
|
-
_R_SCRIPT_INCLUDE = re.compile(r
|
|
421
|
-
_R_SCRIPT_INCLUDE_SYSTEM = re.compile(r'^\s*include\s+(?P<delim><)(?P<url>[^>]*)
|
|
422
|
-
_R_SCRIPT_IF_BEGIN = re.compile(r'^\s*if\s+(?P<expr>.+)\s
|
|
423
|
-
_R_SCRIPT_IF_ELSE_IF = re.compile(r'^\s*elif\s+(?P<expr>.+)\s
|
|
424
|
-
_R_SCRIPT_IF_ELSE = re.compile(r'^\s*else\s
|
|
425
|
-
_R_SCRIPT_IF_END = re.compile(r'^\s*endif
|
|
426
|
-
_R_SCRIPT_FOR_BEGIN = re.compile(
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
417
|
+
_R_SCRIPT_FUNCTION_END = re.compile(r'^\s*endfunction' + _R_PART_COMMENT)
|
|
418
|
+
_R_SCRIPT_LABEL = re.compile(r'^\s*(?P<name>[A-Za-z_]\w*)\s*:' + _R_PART_COMMENT)
|
|
419
|
+
_R_SCRIPT_JUMP = re.compile(r'^(?P<jump>\s*(?:jump|jumpif\s*\((?P<expr>.+)\)))\s+(?P<name>[A-Za-z_]\w*)' + _R_PART_COMMENT)
|
|
420
|
+
_R_SCRIPT_RETURN = re.compile(r'^(?P<return>\s*return(?:\s+(?P<expr>.+))?)' + _R_PART_COMMENT)
|
|
421
|
+
_R_SCRIPT_INCLUDE = re.compile(r"^\s*include\s+(?P<delim>')(?P<url>(?:\\'|[^'])*)'" + _R_PART_COMMENT)
|
|
422
|
+
_R_SCRIPT_INCLUDE_SYSTEM = re.compile(r'^\s*include\s+(?P<delim><)(?P<url>[^>]*)>' + _R_PART_COMMENT)
|
|
423
|
+
_R_SCRIPT_IF_BEGIN = re.compile(r'^\s*if\s+(?P<expr>.+)\s*:' + _R_PART_COMMENT)
|
|
424
|
+
_R_SCRIPT_IF_ELSE_IF = re.compile(r'^\s*elif\s+(?P<expr>.+)\s*:' + _R_PART_COMMENT)
|
|
425
|
+
_R_SCRIPT_IF_ELSE = re.compile(r'^\s*else\s*:' + _R_PART_COMMENT)
|
|
426
|
+
_R_SCRIPT_IF_END = re.compile(r'^\s*endif' + _R_PART_COMMENT)
|
|
427
|
+
_R_SCRIPT_FOR_BEGIN = re.compile(
|
|
428
|
+
r'^\s*for\s+(?P<value>[A-Za-z_]\w*)(?:\s*,\s*(?P<index>[A-Za-z_]\w*))?\s+in\s+(?P<values>.+)\s*:' + _R_PART_COMMENT
|
|
429
|
+
)
|
|
430
|
+
_R_SCRIPT_FOR_END = re.compile(r'^\s*endfor' + _R_PART_COMMENT)
|
|
431
|
+
_R_SCRIPT_WHILE_BEGIN = re.compile(r'^\s*while\s+(?P<expr>.+)\s*:' + _R_PART_COMMENT)
|
|
432
|
+
_R_SCRIPT_WHILE_END = re.compile(r'^\s*endwhile' + _R_PART_COMMENT)
|
|
433
|
+
_R_SCRIPT_BREAK = re.compile(r'^\s*break' + _R_PART_COMMENT)
|
|
434
|
+
_R_SCRIPT_CONTINUE = re.compile(r'^\s*continue' + _R_PART_COMMENT)
|
|
432
435
|
|
|
433
436
|
|
|
434
437
|
def parse_expression(expr_text):
|
|
@@ -463,6 +466,10 @@ def _parse_binary_expression(expr_text, bin_left_expr=None):
|
|
|
463
466
|
# Match a binary operator - if not found, return the left expression
|
|
464
467
|
match_binary_op = _R_EXPR_BINARY_OP.match(bin_text)
|
|
465
468
|
if match_binary_op is None:
|
|
469
|
+
# End-of-line comment?
|
|
470
|
+
if _R_EXPR_COMMENT.match(bin_text):
|
|
471
|
+
bin_text = ''
|
|
472
|
+
|
|
466
473
|
return [left_expr, bin_text]
|
|
467
474
|
bin_op = match_binary_op.group(1)
|
|
468
475
|
right_text = bin_text[len(match_binary_op.group(0)):]
|
|
@@ -596,6 +603,7 @@ def _parse_unary_expression(expr_text):
|
|
|
596
603
|
|
|
597
604
|
|
|
598
605
|
# BareScript expression regex
|
|
606
|
+
_R_EXPR_COMMENT = re.compile(r'^\s*#.*$')
|
|
599
607
|
_R_EXPR_BINARY_OP = re.compile(r'^\s*(\*\*|\*|\/|%|\+|-|<<|>>|<=|<|>=|>|==|!=|&&|\|\||&|\^|\|)')
|
|
600
608
|
_R_EXPR_UNARY_OP = re.compile(r'^\s*(!|-|~)')
|
|
601
609
|
_R_EXPR_FUNCTION_OPEN = re.compile(r'^\s*([A-Za-z_]\w+)\s*\(')
|
|
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
|