libdash 0.5.0__tar.gz → 0.5.2__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 (96) hide show
  1. {libdash-0.5.0/libdash.egg-info → libdash-0.5.2}/PKG-INFO +1 -1
  2. {libdash-0.5.0 → libdash-0.5.2}/libdash/_dash.py +13 -8
  3. {libdash-0.5.0 → libdash-0.5.2}/libdash/parser.py +15 -15
  4. {libdash-0.5.0 → libdash-0.5.2/libdash.egg-info}/PKG-INFO +1 -1
  5. {libdash-0.5.0 → libdash-0.5.2}/pyproject.toml +1 -1
  6. {libdash-0.5.0 → libdash-0.5.2}/setup.py +2 -10
  7. {libdash-0.5.0 → libdash-0.5.2}/COPYING +0 -0
  8. {libdash-0.5.0 → libdash-0.5.2}/MANIFEST.in +0 -0
  9. {libdash-0.5.0 → libdash-0.5.2}/Makefile.am +0 -0
  10. {libdash-0.5.0 → libdash-0.5.2}/README.md +0 -0
  11. {libdash-0.5.0 → libdash-0.5.2}/autogen.sh +0 -0
  12. {libdash-0.5.0 → libdash-0.5.2}/configure.ac +0 -0
  13. {libdash-0.5.0 → libdash-0.5.2}/libdash/__init__.py +0 -0
  14. {libdash-0.5.0 → libdash-0.5.2}/libdash/ast.py +0 -0
  15. {libdash-0.5.0 → libdash-0.5.2}/libdash/printer.py +0 -0
  16. {libdash-0.5.0 → libdash-0.5.2}/libdash.egg-info/SOURCES.txt +0 -0
  17. {libdash-0.5.0 → libdash-0.5.2}/libdash.egg-info/dependency_links.txt +0 -0
  18. {libdash-0.5.0 → libdash-0.5.2}/libdash.egg-info/top_level.txt +0 -0
  19. {libdash-0.5.0 → libdash-0.5.2}/setup.cfg +0 -0
  20. {libdash-0.5.0 → libdash-0.5.2}/src/Makefile.am +0 -0
  21. {libdash-0.5.0 → libdash-0.5.2}/src/TOUR +0 -0
  22. {libdash-0.5.0 → libdash-0.5.2}/src/alias.c +0 -0
  23. {libdash-0.5.0 → libdash-0.5.2}/src/alias.h +0 -0
  24. {libdash-0.5.0 → libdash-0.5.2}/src/arith_yacc.c +0 -0
  25. {libdash-0.5.0 → libdash-0.5.2}/src/arith_yacc.h +0 -0
  26. {libdash-0.5.0 → libdash-0.5.2}/src/arith_yylex.c +0 -0
  27. {libdash-0.5.0 → libdash-0.5.2}/src/bltin/bltin.h +0 -0
  28. {libdash-0.5.0 → libdash-0.5.2}/src/bltin/echo.1 +0 -0
  29. {libdash-0.5.0 → libdash-0.5.2}/src/bltin/printf.1 +0 -0
  30. {libdash-0.5.0 → libdash-0.5.2}/src/bltin/printf.c +0 -0
  31. {libdash-0.5.0 → libdash-0.5.2}/src/bltin/test.1 +0 -0
  32. {libdash-0.5.0 → libdash-0.5.2}/src/bltin/test.c +0 -0
  33. {libdash-0.5.0 → libdash-0.5.2}/src/bltin/times.c +0 -0
  34. {libdash-0.5.0 → libdash-0.5.2}/src/builtins.def.in +0 -0
  35. {libdash-0.5.0 → libdash-0.5.2}/src/cd.c +0 -0
  36. {libdash-0.5.0 → libdash-0.5.2}/src/cd.h +0 -0
  37. {libdash-0.5.0 → libdash-0.5.2}/src/dash.1 +0 -0
  38. {libdash-0.5.0 → libdash-0.5.2}/src/error.c +0 -0
  39. {libdash-0.5.0 → libdash-0.5.2}/src/error.h +0 -0
  40. {libdash-0.5.0 → libdash-0.5.2}/src/eval.c +0 -0
  41. {libdash-0.5.0 → libdash-0.5.2}/src/eval.h +0 -0
  42. {libdash-0.5.0 → libdash-0.5.2}/src/exec.c +0 -0
  43. {libdash-0.5.0 → libdash-0.5.2}/src/exec.h +0 -0
  44. {libdash-0.5.0 → libdash-0.5.2}/src/expand.c +0 -0
  45. {libdash-0.5.0 → libdash-0.5.2}/src/expand.h +0 -0
  46. {libdash-0.5.0 → libdash-0.5.2}/src/funcs/cmv +0 -0
  47. {libdash-0.5.0 → libdash-0.5.2}/src/funcs/dirs +0 -0
  48. {libdash-0.5.0 → libdash-0.5.2}/src/funcs/kill +0 -0
  49. {libdash-0.5.0 → libdash-0.5.2}/src/funcs/login +0 -0
  50. {libdash-0.5.0 → libdash-0.5.2}/src/funcs/newgrp +0 -0
  51. {libdash-0.5.0 → libdash-0.5.2}/src/funcs/popd +0 -0
  52. {libdash-0.5.0 → libdash-0.5.2}/src/funcs/pushd +0 -0
  53. {libdash-0.5.0 → libdash-0.5.2}/src/funcs/suspend +0 -0
  54. {libdash-0.5.0 → libdash-0.5.2}/src/histedit.c +0 -0
  55. {libdash-0.5.0 → libdash-0.5.2}/src/init.h +0 -0
  56. {libdash-0.5.0 → libdash-0.5.2}/src/input.c +0 -0
  57. {libdash-0.5.0 → libdash-0.5.2}/src/input.h +0 -0
  58. {libdash-0.5.0 → libdash-0.5.2}/src/jobs.c +0 -0
  59. {libdash-0.5.0 → libdash-0.5.2}/src/jobs.h +0 -0
  60. {libdash-0.5.0 → libdash-0.5.2}/src/machdep.h +0 -0
  61. {libdash-0.5.0 → libdash-0.5.2}/src/mail.c +0 -0
  62. {libdash-0.5.0 → libdash-0.5.2}/src/mail.h +0 -0
  63. {libdash-0.5.0 → libdash-0.5.2}/src/main.c +0 -0
  64. {libdash-0.5.0 → libdash-0.5.2}/src/main.h +0 -0
  65. {libdash-0.5.0 → libdash-0.5.2}/src/memalloc.c +0 -0
  66. {libdash-0.5.0 → libdash-0.5.2}/src/memalloc.h +0 -0
  67. {libdash-0.5.0 → libdash-0.5.2}/src/miscbltin.c +0 -0
  68. {libdash-0.5.0 → libdash-0.5.2}/src/miscbltin.h +0 -0
  69. {libdash-0.5.0 → libdash-0.5.2}/src/mkbuiltins +0 -0
  70. {libdash-0.5.0 → libdash-0.5.2}/src/mkinit.c +0 -0
  71. {libdash-0.5.0 → libdash-0.5.2}/src/mknodes.c +0 -0
  72. {libdash-0.5.0 → libdash-0.5.2}/src/mksignames.c +0 -0
  73. {libdash-0.5.0 → libdash-0.5.2}/src/mksyntax.c +0 -0
  74. {libdash-0.5.0 → libdash-0.5.2}/src/mktokens +0 -0
  75. {libdash-0.5.0 → libdash-0.5.2}/src/myhistedit.h +0 -0
  76. {libdash-0.5.0 → libdash-0.5.2}/src/mystring.c +0 -0
  77. {libdash-0.5.0 → libdash-0.5.2}/src/mystring.h +0 -0
  78. {libdash-0.5.0 → libdash-0.5.2}/src/nodes.c.pat +0 -0
  79. {libdash-0.5.0 → libdash-0.5.2}/src/nodetypes +0 -0
  80. {libdash-0.5.0 → libdash-0.5.2}/src/options.c +0 -0
  81. {libdash-0.5.0 → libdash-0.5.2}/src/options.h +0 -0
  82. {libdash-0.5.0 → libdash-0.5.2}/src/output.c +0 -0
  83. {libdash-0.5.0 → libdash-0.5.2}/src/output.h +0 -0
  84. {libdash-0.5.0 → libdash-0.5.2}/src/parser.c +0 -0
  85. {libdash-0.5.0 → libdash-0.5.2}/src/parser.h +0 -0
  86. {libdash-0.5.0 → libdash-0.5.2}/src/redir.c +0 -0
  87. {libdash-0.5.0 → libdash-0.5.2}/src/redir.h +0 -0
  88. {libdash-0.5.0 → libdash-0.5.2}/src/shell.h +0 -0
  89. {libdash-0.5.0 → libdash-0.5.2}/src/show.c +0 -0
  90. {libdash-0.5.0 → libdash-0.5.2}/src/show.h +0 -0
  91. {libdash-0.5.0 → libdash-0.5.2}/src/system.c +0 -0
  92. {libdash-0.5.0 → libdash-0.5.2}/src/system.h +0 -0
  93. {libdash-0.5.0 → libdash-0.5.2}/src/trap.c +0 -0
  94. {libdash-0.5.0 → libdash-0.5.2}/src/trap.h +0 -0
  95. {libdash-0.5.0 → libdash-0.5.2}/src/var.c +0 -0
  96. {libdash-0.5.0 → libdash-0.5.2}/src/var.h +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: libdash
3
- Version: 0.5.0
3
+ Version: 0.5.2
4
4
  Summary: Bindings for the dash shell as a library
5
5
  Author: PaSh contributors
6
6
  Author-email: Michael Greenberg <michael@greenberg.science>
@@ -223,8 +223,8 @@ class strpush (Structure):
223
223
  # struct alias *ap; /* if push was associated with an alias */
224
224
  # char *string; /* remember the string since it may change */
225
225
  #
226
- # /* Remember last two characters for pungetc. */
227
- # int lastc[2];
226
+ # /* Delay freeing so we can stop nested aliases. */
227
+ # struct strpush *spfree;
228
228
  #
229
229
  # /* Number of outstanding calls to pungetc. */
230
230
  # int unget;
@@ -234,7 +234,7 @@ strpush._fields_ = [("prev", POINTER (strpush)),
234
234
  ("prevnleft", c_int),
235
235
  ("ap", c_void_p),
236
236
  ("string", c_char_p),
237
- ("lastc", 2 * c_int),
237
+ ("spfree", POINTER (strpush)),
238
238
  ("unget", c_int)];
239
239
 
240
240
  class parsefile (Structure):
@@ -245,14 +245,18 @@ class parsefile (Structure):
245
245
  # int linno; /* current line */
246
246
  # int fd; /* file descriptor (or -1 if string) */
247
247
  # int nleft; /* number of chars left in this line */
248
- # int lleft; /* number of chars left in this buffer */
248
+ # int eof; /* do not read again once we hit EOF */
249
249
  # char *nextc; /* next char in buffer */
250
250
  # char *buf; /* input buffer */
251
251
  # struct strpush *strpush; /* for pushing strings at this level */
252
252
  # struct strpush basestrpush; /* so pushing one is fast */
253
253
  #
254
- # /* Remember last two characters for pungetc. */
255
- # int lastc[2];
254
+ # /* Delay freeing so we can stop nested aliases. */
255
+ # struct strpush *spfree;
256
+ #
257
+ # #ifndef SMALL
258
+ # int lleft; /* number of chars left in this buffer */
259
+ # #endif
256
260
  #
257
261
  # /* Number of outstanding calls to pungetc. */
258
262
  # int unget;
@@ -261,12 +265,13 @@ parsefile._fields_ = [("prev", POINTER (parsefile)),
261
265
  ("linno", c_int),
262
266
  ("fd", c_int),
263
267
  ("nleft", c_int),
264
- ("lleft", c_int),
268
+ ("eof", c_int),
265
269
  ("nextc", POINTER (c_char)), # NOT c_char_p!
266
270
  ("buf", c_char_p),
267
271
  ("strpush", POINTER (strpush)),
268
272
  ("basestrpush", strpush),
269
- ("lastc", 2 * c_int),
273
+ ("spfree", POINTER (strpush)),
274
+ ("lleft", c_int),
270
275
  ("unget", c_int)];
271
276
 
272
277
 
@@ -16,7 +16,8 @@ def libdash_library_path():
16
16
  LIBDASH_LIBRARY_PATH = os.path.join(FILE_PATH, "libdash.so")
17
17
  return LIBDASH_LIBRARY_PATH
18
18
 
19
- EOF_NLEFT = -99; # libdash/src/input.c
19
+ # parsefile->eof bit 1: set by preadbuffer at EOF, never cleared by pungetc.
20
+ PARSEFILE_EOF = 2;
20
21
 
21
22
  class ParsingException(Exception):
22
23
  def __init__(self, message='ParseError'):
@@ -64,7 +65,7 @@ def parse(inputPath, init=True):
64
65
  n_ptr_C = parsecmd_safe (libdash, False)
65
66
 
66
67
  linno_after = parsefile_var.contents.linno - 1; # libdash is 1-indexed
67
- nleft_after = parsefile_var.contents.nleft
68
+ eof_after = parsefile_var.contents.eof
68
69
 
69
70
  if (n_ptr_C == None): # Dash.Null
70
71
  pass
@@ -73,19 +74,18 @@ def parse(inputPath, init=True):
73
74
  elif (n_ptr_C == NERR): # Dash.Error
74
75
  raise ParsingException()
75
76
  else:
76
- if (nleft_after == EOF_NLEFT):
77
- linno_after = linno_after + 1; # The last line wasn't counted
78
-
79
- if (inputPath != "-"):
80
- ## Both of these assertions check "our" assumption with respect to the final parser state
81
- ## and are therefore not necessary if they become an issue.
82
- assert ((linno_after == len (lines)) or (linno_after == len (lines) + 1))
83
-
84
- # Last line did not have a newline
85
- assert (len (lines [-1]) > 0 and (lines [-1][-1] != '\n'))
86
- elif nleft_after != 0:
87
- # we formerly asserted that `nleft_after != 0`, but this no longer holds
88
- linno_after = linno_after + 1; # The last line wasn't counted
77
+ ## dash bumps `linno` on newline, so an unterminated last line is
78
+ ## never counted. Only adjust at EOF; otherwise every node would
79
+ ## swallow the next one's first line.
80
+ if (eof_after & PARSEFILE_EOF):
81
+ if (inputPath == "-"):
82
+ ## no lines to check against; trust the flag
83
+ linno_after = linno_after + 1
84
+ elif (lines and (lines [-1][-1:] != '\n')):
85
+ linno_after = len (lines)
86
+
87
+ if (inputPath != "-"):
88
+ linno_after = min (linno_after, len (lines))
89
89
 
90
90
  n_ptr = cast (n_ptr_C, POINTER (union_node))
91
91
  new_ast = of_node (n_ptr)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: libdash
3
- Version: 0.5.0
3
+ Version: 0.5.2
4
4
  Summary: Bindings for the dash shell as a library
5
5
  Author: PaSh contributors
6
6
  Author-email: Michael Greenberg <michael@greenberg.science>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "libdash"
3
- version = "0.5.0"
3
+ version = "0.5.2"
4
4
  authors = [
5
5
  { name="Michael Greenberg", email="michael@greenberg.science" },
6
6
  { name="PaSh contributors" },
@@ -22,8 +22,6 @@ class libdash_build_py(build_py):
22
22
  build_py.run(self)
23
23
 
24
24
  if sys.platform == 'darwin':
25
- libtoolize = "glibtoolize"
26
-
27
25
  target_arch = os.environ.get("ARCHFLAGS")
28
26
  build_arch = platform.machine()
29
27
  if not target_arch:
@@ -38,19 +36,13 @@ class libdash_build_py(build_py):
38
36
  os.environ["LDFLAGS"] = f'{os.environ.get("LDFLAGS", "")} {target_arch}'.strip()
39
37
 
40
38
  print(f'ARCHFLAGS: {target_arch} MACOSX_DEPLOYMENT_TARGET: {os.environ.get("MACOSX_DEPLOYMENT_TARGET", "")} CFLAGS: {os.environ.get("CFLAGS")} LDFLAGS: {os.environ.get("LDFLAGS")}')
41
- else:
42
- libtoolize = "libtoolize"
43
39
 
44
40
  # cibuildwheel builds every wheel in the same source tree; objects
45
41
  # left over from a previous build may target a different arch
46
42
  if os.path.exists('Makefile'):
47
43
  subprocess.run(['make', 'distclean'])
48
44
 
49
- try_exec(libtoolize)
50
- try_exec('aclocal')
51
- try_exec('autoheader')
52
- try_exec('automake', '--add-missing')
53
- try_exec('autoconf')
45
+ try_exec('autoreconf', '--install', '--force')
54
46
  try_exec('./configure')
55
47
  try_exec('make')
56
48
 
@@ -61,7 +53,7 @@ class libdash_build_py(build_py):
61
53
  setup(name='libdash',
62
54
  packages=['libdash'],
63
55
  cmdclass={'build_py': libdash_build_py},
64
- version='0.5.0',
56
+ version='0.5.2',
65
57
  long_description=long_description,
66
58
  long_description_content_type='text/markdown',
67
59
  include_package_data=True,
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
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
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