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.
Files changed (30) hide show
  1. {bare_script-3.5.2/src/bare_script.egg-info → bare_script-3.5.3}/PKG-INFO +1 -1
  2. {bare_script-3.5.2 → bare_script-3.5.3}/setup.cfg +1 -1
  3. {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/parser.py +25 -17
  4. {bare_script-3.5.2 → bare_script-3.5.3/src/bare_script.egg-info}/PKG-INFO +1 -1
  5. {bare_script-3.5.2 → bare_script-3.5.3}/LICENSE +0 -0
  6. {bare_script-3.5.2 → bare_script-3.5.3}/README.md +0 -0
  7. {bare_script-3.5.2 → bare_script-3.5.3}/pyproject.toml +0 -0
  8. {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/__init__.py +0 -0
  9. {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/__main__.py +0 -0
  10. {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/bare.py +0 -0
  11. {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/baredoc.py +0 -0
  12. {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/data.py +0 -0
  13. {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/include/__init__.py +0 -0
  14. {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/include/args.bare +0 -0
  15. {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/include/diff.bare +0 -0
  16. {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/include/forms.bare +0 -0
  17. {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/include/markdownUp.bare +0 -0
  18. {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/include/pager.bare +0 -0
  19. {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/include/unittest.bare +0 -0
  20. {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/include/unittestMock.bare +0 -0
  21. {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/library.py +0 -0
  22. {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/model.py +0 -0
  23. {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/options.py +0 -0
  24. {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/runtime.py +0 -0
  25. {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script/value.py +0 -0
  26. {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script.egg-info/SOURCES.txt +0 -0
  27. {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script.egg-info/dependency_links.txt +0 -0
  28. {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script.egg-info/entry_points.txt +0 -0
  29. {bare_script-3.5.2 → bare_script-3.5.3}/src/bare_script.egg-info/requires.txt +0 -0
  30. {bare_script-3.5.2 → bare_script-3.5.3}/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.5.2
3
+ Version: 3.5.3
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.5.2
3
+ version = 3.5.3
4
4
  url = https://github.com/craigahobbs/bare-script
5
5
  author = Craig A. Hobbs
6
6
  author_email = craigahobbs@gmail.com
@@ -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*:\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\s*$')
417
- _R_SCRIPT_LABEL = re.compile(r'^\s*(?P<name>[A-Za-z_]\w*)\s*:\s*$')
418
- _R_SCRIPT_JUMP = re.compile(r'^(?P<jump>\s*(?:jump|jumpif\s*\((?P<expr>.+)\)))\s+(?P<name>[A-Za-z_]\w*)\s*$')
419
- _R_SCRIPT_RETURN = re.compile(r'^(?P<return>\s*return(?:\s+(?P<expr>.+))?)\s*$')
420
- _R_SCRIPT_INCLUDE = re.compile(r'^\s*include\s+(?P<delim>\')(?P<url>(?:\\\'|[^\'])*)\'\s*$')
421
- _R_SCRIPT_INCLUDE_SYSTEM = re.compile(r'^\s*include\s+(?P<delim><)(?P<url>[^>]*)>\s*$')
422
- _R_SCRIPT_IF_BEGIN = re.compile(r'^\s*if\s+(?P<expr>.+)\s*:\s*$')
423
- _R_SCRIPT_IF_ELSE_IF = re.compile(r'^\s*elif\s+(?P<expr>.+)\s*:\s*$')
424
- _R_SCRIPT_IF_ELSE = re.compile(r'^\s*else\s*:\s*$')
425
- _R_SCRIPT_IF_END = re.compile(r'^\s*endif\s*$')
426
- _R_SCRIPT_FOR_BEGIN = re.compile(r'^\s*for\s+(?P<value>[A-Za-z_]\w*)(?:\s*,\s*(?P<index>[A-Za-z_]\w*))?\s+in\s+(?P<values>.+)\s*:\s*$')
427
- _R_SCRIPT_FOR_END = re.compile(r'^\s*endfor\s*$')
428
- _R_SCRIPT_WHILE_BEGIN = re.compile(r'^\s*while\s+(?P<expr>.+)\s*:\s*$')
429
- _R_SCRIPT_WHILE_END = re.compile(r'^\s*endwhile\s*$')
430
- _R_SCRIPT_BREAK = re.compile(r'^\s*break\s*$')
431
- _R_SCRIPT_CONTINUE = re.compile(r'^\s*continue\s*$')
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*\(')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bare-script
3
- Version: 3.5.2
3
+ Version: 3.5.3
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
File without changes