bare-script 3.0.14__tar.gz → 3.0.16__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 (22) hide show
  1. {bare_script-3.0.14/src/bare_script.egg-info → bare_script-3.0.16}/PKG-INFO +1 -1
  2. {bare_script-3.0.14 → bare_script-3.0.16}/setup.cfg +1 -1
  3. {bare_script-3.0.14 → bare_script-3.0.16}/src/bare_script/library.py +20 -0
  4. {bare_script-3.0.14 → bare_script-3.0.16}/src/bare_script/value.py +6 -6
  5. {bare_script-3.0.14 → bare_script-3.0.16/src/bare_script.egg-info}/PKG-INFO +1 -1
  6. {bare_script-3.0.14 → bare_script-3.0.16}/LICENSE +0 -0
  7. {bare_script-3.0.14 → bare_script-3.0.16}/README.md +0 -0
  8. {bare_script-3.0.14 → bare_script-3.0.16}/pyproject.toml +0 -0
  9. {bare_script-3.0.14 → bare_script-3.0.16}/src/bare_script/__init__.py +0 -0
  10. {bare_script-3.0.14 → bare_script-3.0.16}/src/bare_script/__main__.py +0 -0
  11. {bare_script-3.0.14 → bare_script-3.0.16}/src/bare_script/bare.py +0 -0
  12. {bare_script-3.0.14 → bare_script-3.0.16}/src/bare_script/baredoc.py +0 -0
  13. {bare_script-3.0.14 → bare_script-3.0.16}/src/bare_script/data.py +0 -0
  14. {bare_script-3.0.14 → bare_script-3.0.16}/src/bare_script/model.py +0 -0
  15. {bare_script-3.0.14 → bare_script-3.0.16}/src/bare_script/options.py +0 -0
  16. {bare_script-3.0.14 → bare_script-3.0.16}/src/bare_script/parser.py +0 -0
  17. {bare_script-3.0.14 → bare_script-3.0.16}/src/bare_script/runtime.py +0 -0
  18. {bare_script-3.0.14 → bare_script-3.0.16}/src/bare_script.egg-info/SOURCES.txt +0 -0
  19. {bare_script-3.0.14 → bare_script-3.0.16}/src/bare_script.egg-info/dependency_links.txt +0 -0
  20. {bare_script-3.0.14 → bare_script-3.0.16}/src/bare_script.egg-info/entry_points.txt +0 -0
  21. {bare_script-3.0.14 → bare_script-3.0.16}/src/bare_script.egg-info/requires.txt +0 -0
  22. {bare_script-3.0.14 → bare_script-3.0.16}/src/bare_script.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bare-script
3
- Version: 3.0.14
3
+ Version: 3.0.16
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.0.14
3
+ version = 3.0.16
4
4
  url = https://github.com/craigahobbs/bare-script
5
5
  author = Craig A. Hobbs
6
6
  author_email = craigahobbs@gmail.com
@@ -46,6 +46,25 @@ _ARRAY_COPY_ARGS = value_args_model([
46
46
  ])
47
47
 
48
48
 
49
+ # $function: arrayDelete
50
+ # $group: Array
51
+ # $doc: Delete an array element
52
+ # $arg array: The array
53
+ # $arg index: The array element's index
54
+ # $return: The array element
55
+ def _array_delete(args, unused_options):
56
+ array, index = value_args_validate(_ARRAY_DELETE_ARGS, args)
57
+ if index >= len(array):
58
+ raise ValueArgsError('index', index)
59
+
60
+ del array[int(index)]
61
+
62
+ _ARRAY_DELETE_ARGS = value_args_model([
63
+ {'name': 'array', 'type': 'array'},
64
+ {'name': 'index', 'type': 'number', 'integer': True, 'gte': 0}
65
+ ])
66
+
67
+
49
68
  # $function: arrayExtend
50
69
  # $group: Array
51
70
  # $doc: Extend one array with another
@@ -1988,6 +2007,7 @@ _URL_ENCODE_COMPONENT_ARGS = value_args_model([
1988
2007
  # The built-in script functions
1989
2008
  SCRIPT_FUNCTIONS = {
1990
2009
  'arrayCopy': _array_copy,
2010
+ 'arrayDelete': _array_delete,
1991
2011
  'arrayExtend': _array_extend,
1992
2012
  'arrayGet': _array_get,
1993
2013
  'arrayIndexOf': _array_index_of,
@@ -376,25 +376,25 @@ struct FunctionArgument
376
376
  optional bool nullable
377
377
 
378
378
  # The default argument value
379
- optional object default
379
+ optional any default
380
380
 
381
381
  # If true, this argument is the array of remaining arguments
382
- optional object lastArgArray
382
+ optional bool lastArgArray
383
383
 
384
384
  # If true, the number argument must be an integer
385
385
  optional bool integer
386
386
 
387
387
  # The number argument must be less-than
388
- optional object lt
388
+ optional any lt
389
389
 
390
390
  # The number argument must be less-than-or-equal-to
391
- optional object lte
391
+ optional any lte
392
392
 
393
393
  # The number argument must be greater-than
394
- optional object gt
394
+ optional any gt
395
395
 
396
396
  # The number argument must be greater-than-or-equal-to
397
- optional object gte
397
+ optional any gte
398
398
 
399
399
 
400
400
  # The function argument types
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bare-script
3
- Version: 3.0.14
3
+ Version: 3.0.16
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