libdash 0.4.0__tar.gz → 0.5.0__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 (97) hide show
  1. {libdash-0.4.0/libdash.egg-info → libdash-0.5.0}/PKG-INFO +1 -1
  2. {libdash-0.4.0 → libdash-0.5.0}/libdash/ast.py +32 -0
  3. {libdash-0.4.0 → libdash-0.5.0/libdash.egg-info}/PKG-INFO +1 -1
  4. {libdash-0.4.0 → libdash-0.5.0}/libdash.egg-info/SOURCES.txt +0 -1
  5. {libdash-0.4.0 → libdash-0.5.0}/pyproject.toml +1 -1
  6. {libdash-0.4.0 → libdash-0.5.0}/setup.py +1 -1
  7. {libdash-0.4.0 → libdash-0.5.0}/src/main.c +11 -3
  8. {libdash-0.4.0 → libdash-0.5.0}/src/main.h +1 -0
  9. libdash-0.4.0/src/type_description.ml +0 -184
  10. {libdash-0.4.0 → libdash-0.5.0}/COPYING +0 -0
  11. {libdash-0.4.0 → libdash-0.5.0}/MANIFEST.in +0 -0
  12. {libdash-0.4.0 → libdash-0.5.0}/Makefile.am +0 -0
  13. {libdash-0.4.0 → libdash-0.5.0}/README.md +0 -0
  14. {libdash-0.4.0 → libdash-0.5.0}/autogen.sh +0 -0
  15. {libdash-0.4.0 → libdash-0.5.0}/configure.ac +0 -0
  16. {libdash-0.4.0 → libdash-0.5.0}/libdash/__init__.py +0 -0
  17. {libdash-0.4.0 → libdash-0.5.0}/libdash/_dash.py +0 -0
  18. {libdash-0.4.0 → libdash-0.5.0}/libdash/parser.py +0 -0
  19. {libdash-0.4.0 → libdash-0.5.0}/libdash/printer.py +0 -0
  20. {libdash-0.4.0 → libdash-0.5.0}/libdash.egg-info/dependency_links.txt +0 -0
  21. {libdash-0.4.0 → libdash-0.5.0}/libdash.egg-info/top_level.txt +0 -0
  22. {libdash-0.4.0 → libdash-0.5.0}/setup.cfg +0 -0
  23. {libdash-0.4.0 → libdash-0.5.0}/src/Makefile.am +0 -0
  24. {libdash-0.4.0 → libdash-0.5.0}/src/TOUR +0 -0
  25. {libdash-0.4.0 → libdash-0.5.0}/src/alias.c +0 -0
  26. {libdash-0.4.0 → libdash-0.5.0}/src/alias.h +0 -0
  27. {libdash-0.4.0 → libdash-0.5.0}/src/arith_yacc.c +0 -0
  28. {libdash-0.4.0 → libdash-0.5.0}/src/arith_yacc.h +0 -0
  29. {libdash-0.4.0 → libdash-0.5.0}/src/arith_yylex.c +0 -0
  30. {libdash-0.4.0 → libdash-0.5.0}/src/bltin/bltin.h +0 -0
  31. {libdash-0.4.0 → libdash-0.5.0}/src/bltin/echo.1 +0 -0
  32. {libdash-0.4.0 → libdash-0.5.0}/src/bltin/printf.1 +0 -0
  33. {libdash-0.4.0 → libdash-0.5.0}/src/bltin/printf.c +0 -0
  34. {libdash-0.4.0 → libdash-0.5.0}/src/bltin/test.1 +0 -0
  35. {libdash-0.4.0 → libdash-0.5.0}/src/bltin/test.c +0 -0
  36. {libdash-0.4.0 → libdash-0.5.0}/src/bltin/times.c +0 -0
  37. {libdash-0.4.0 → libdash-0.5.0}/src/builtins.def.in +0 -0
  38. {libdash-0.4.0 → libdash-0.5.0}/src/cd.c +0 -0
  39. {libdash-0.4.0 → libdash-0.5.0}/src/cd.h +0 -0
  40. {libdash-0.4.0 → libdash-0.5.0}/src/dash.1 +0 -0
  41. {libdash-0.4.0 → libdash-0.5.0}/src/error.c +0 -0
  42. {libdash-0.4.0 → libdash-0.5.0}/src/error.h +0 -0
  43. {libdash-0.4.0 → libdash-0.5.0}/src/eval.c +0 -0
  44. {libdash-0.4.0 → libdash-0.5.0}/src/eval.h +0 -0
  45. {libdash-0.4.0 → libdash-0.5.0}/src/exec.c +0 -0
  46. {libdash-0.4.0 → libdash-0.5.0}/src/exec.h +0 -0
  47. {libdash-0.4.0 → libdash-0.5.0}/src/expand.c +0 -0
  48. {libdash-0.4.0 → libdash-0.5.0}/src/expand.h +0 -0
  49. {libdash-0.4.0 → libdash-0.5.0}/src/funcs/cmv +0 -0
  50. {libdash-0.4.0 → libdash-0.5.0}/src/funcs/dirs +0 -0
  51. {libdash-0.4.0 → libdash-0.5.0}/src/funcs/kill +0 -0
  52. {libdash-0.4.0 → libdash-0.5.0}/src/funcs/login +0 -0
  53. {libdash-0.4.0 → libdash-0.5.0}/src/funcs/newgrp +0 -0
  54. {libdash-0.4.0 → libdash-0.5.0}/src/funcs/popd +0 -0
  55. {libdash-0.4.0 → libdash-0.5.0}/src/funcs/pushd +0 -0
  56. {libdash-0.4.0 → libdash-0.5.0}/src/funcs/suspend +0 -0
  57. {libdash-0.4.0 → libdash-0.5.0}/src/histedit.c +0 -0
  58. {libdash-0.4.0 → libdash-0.5.0}/src/init.h +0 -0
  59. {libdash-0.4.0 → libdash-0.5.0}/src/input.c +0 -0
  60. {libdash-0.4.0 → libdash-0.5.0}/src/input.h +0 -0
  61. {libdash-0.4.0 → libdash-0.5.0}/src/jobs.c +0 -0
  62. {libdash-0.4.0 → libdash-0.5.0}/src/jobs.h +0 -0
  63. {libdash-0.4.0 → libdash-0.5.0}/src/machdep.h +0 -0
  64. {libdash-0.4.0 → libdash-0.5.0}/src/mail.c +0 -0
  65. {libdash-0.4.0 → libdash-0.5.0}/src/mail.h +0 -0
  66. {libdash-0.4.0 → libdash-0.5.0}/src/memalloc.c +0 -0
  67. {libdash-0.4.0 → libdash-0.5.0}/src/memalloc.h +0 -0
  68. {libdash-0.4.0 → libdash-0.5.0}/src/miscbltin.c +0 -0
  69. {libdash-0.4.0 → libdash-0.5.0}/src/miscbltin.h +0 -0
  70. {libdash-0.4.0 → libdash-0.5.0}/src/mkbuiltins +0 -0
  71. {libdash-0.4.0 → libdash-0.5.0}/src/mkinit.c +0 -0
  72. {libdash-0.4.0 → libdash-0.5.0}/src/mknodes.c +0 -0
  73. {libdash-0.4.0 → libdash-0.5.0}/src/mksignames.c +0 -0
  74. {libdash-0.4.0 → libdash-0.5.0}/src/mksyntax.c +0 -0
  75. {libdash-0.4.0 → libdash-0.5.0}/src/mktokens +0 -0
  76. {libdash-0.4.0 → libdash-0.5.0}/src/myhistedit.h +0 -0
  77. {libdash-0.4.0 → libdash-0.5.0}/src/mystring.c +0 -0
  78. {libdash-0.4.0 → libdash-0.5.0}/src/mystring.h +0 -0
  79. {libdash-0.4.0 → libdash-0.5.0}/src/nodes.c.pat +0 -0
  80. {libdash-0.4.0 → libdash-0.5.0}/src/nodetypes +0 -0
  81. {libdash-0.4.0 → libdash-0.5.0}/src/options.c +0 -0
  82. {libdash-0.4.0 → libdash-0.5.0}/src/options.h +0 -0
  83. {libdash-0.4.0 → libdash-0.5.0}/src/output.c +0 -0
  84. {libdash-0.4.0 → libdash-0.5.0}/src/output.h +0 -0
  85. {libdash-0.4.0 → libdash-0.5.0}/src/parser.c +0 -0
  86. {libdash-0.4.0 → libdash-0.5.0}/src/parser.h +0 -0
  87. {libdash-0.4.0 → libdash-0.5.0}/src/redir.c +0 -0
  88. {libdash-0.4.0 → libdash-0.5.0}/src/redir.h +0 -0
  89. {libdash-0.4.0 → libdash-0.5.0}/src/shell.h +0 -0
  90. {libdash-0.4.0 → libdash-0.5.0}/src/show.c +0 -0
  91. {libdash-0.4.0 → libdash-0.5.0}/src/show.h +0 -0
  92. {libdash-0.4.0 → libdash-0.5.0}/src/system.c +0 -0
  93. {libdash-0.4.0 → libdash-0.5.0}/src/system.h +0 -0
  94. {libdash-0.4.0 → libdash-0.5.0}/src/trap.c +0 -0
  95. {libdash-0.4.0 → libdash-0.5.0}/src/trap.h +0 -0
  96. {libdash-0.4.0 → libdash-0.5.0}/src/var.c +0 -0
  97. {libdash-0.4.0 → libdash-0.5.0}/src/var.h +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: libdash
3
- Version: 0.4.0
3
+ Version: 0.5.0
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>
@@ -8,6 +8,7 @@ CTLESC = 129
8
8
  CTLVAR = 130
9
9
  CTLENDVAR = 131
10
10
  CTLBACKQ = 132
11
+ CTLMBCHAR = 133
11
12
  CTLARI = 134
12
13
  CTLENDARI = 135
13
14
  CTLQUOTEMARK = 136
@@ -385,6 +386,37 @@ def parse_arg (s, bqlist, stack):
385
386
 
386
387
  bqlist = bqlist.contents.next
387
388
 
389
+ # (* CTLMBCHAR *)
390
+ # | '\133'::s,_ ->
391
+ elif s[-1] == CTLMBCHAR:
392
+ s.pop()
393
+
394
+ # sometimes there is a CTLESC
395
+ char_ctor = "C"
396
+ if s[-1] == CTLESC:
397
+ s.pop()
398
+ char_ctor = "E"
399
+
400
+ # encoded multi-byte length
401
+ ml = s.pop()
402
+ assert 1 <= ml and ml <= 4
403
+
404
+ # extract bytes, decode to UTF-8, record in acc
405
+ mb_ords = []
406
+ count = ml
407
+ while count > 0:
408
+ mb_ords.append(s.pop())
409
+ count -= 1
410
+
411
+ mb = bytes(mb_ords).decode()
412
+ acc.extend([(char_ctor, ord(c)) for c in mb])
413
+
414
+ # clear out second ml and CTLMBCHAR
415
+ ml2 = s.pop()
416
+ assert ml == ml2
417
+ ctlmbchar = s.pop()
418
+ assert ctlmbchar == CTLMBCHAR
419
+
388
420
  # (* CTLARI *)
389
421
  # | '\134'::s,_ ->
390
422
  elif (s [-1] == CTLARI):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: libdash
3
- Version: 0.4.0
3
+ Version: 0.5.0
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>
@@ -75,7 +75,6 @@ src/system.c
75
75
  src/system.h
76
76
  src/trap.c
77
77
  src/trap.h
78
- src/type_description.ml
79
78
  src/var.c
80
79
  src/var.h
81
80
  src/bltin/bltin.h
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "libdash"
3
- version = "0.4.0"
3
+ version = "0.5.0"
4
4
  authors = [
5
5
  { name="Michael Greenberg", email="michael@greenberg.science" },
6
6
  { name="PaSh contributors" },
@@ -61,7 +61,7 @@ class libdash_build_py(build_py):
61
61
  setup(name='libdash',
62
62
  packages=['libdash'],
63
63
  cmdclass={'build_py': libdash_build_py},
64
- version='0.4.0',
64
+ version='0.5.0',
65
65
  long_description=long_description,
66
66
  long_description_content_type='text/markdown',
67
67
  include_package_data=True,
@@ -79,7 +79,7 @@ STATIC void read_profile(const char *);
79
79
  STATIC char *find_dot_file(char *);
80
80
  static int cmdloop(int);
81
81
 
82
- //libdash
82
+ // libdash
83
83
  void
84
84
  initialize_dash_errno()
85
85
  {
@@ -88,6 +88,13 @@ initialize_dash_errno()
88
88
  #endif
89
89
  }
90
90
 
91
+ // libdash
92
+ void
93
+ initialize_dash_setlocale()
94
+ {
95
+ setlocale(LC_ALL, "");
96
+ }
97
+
91
98
  #ifdef MAIN // libdash
92
99
  int main(int, char **);
93
100
  #endif //MAIN // libdash
@@ -100,7 +107,7 @@ int main(int, char **);
100
107
  * is used to figure out how far we had gotten.
101
108
  */
102
109
 
103
- #ifdef MAIN //libdash
110
+ #ifdef MAIN // libdash
104
111
  int
105
112
  main(int argc, char **argv)
106
113
  {
@@ -117,7 +124,8 @@ main(int argc, char **argv)
117
124
  monitor(4, etext, profile_buf, sizeof profile_buf, 50);
118
125
  #endif
119
126
 
120
- setlocale(LC_ALL, "");
127
+ // libdash
128
+ initialize_dash_setlocale();
121
129
 
122
130
  state = 0;
123
131
  if (unlikely(setjmp(main_handler.loc))) {
@@ -51,6 +51,7 @@ extern int *dash_errno;
51
51
  #define errno (*dash_errno)
52
52
  #endif
53
53
  void initialize_dash_errno(); // libdash
54
+ void initialize_dash_setlocale(); // libdash
54
55
 
55
56
  void readcmdfile(char *);
56
57
  int dotcmd(int, char **);
@@ -1,184 +0,0 @@
1
- open Ctypes
2
-
3
- module Types (F : Ctypes.TYPE) = struct
4
- open F
5
-
6
- (* stackmarks [used for string allocation in dash] *)
7
- type stackmark
8
-
9
- let stackmark : stackmark structure typ = structure "stackmark"
10
- let stackp = field stackmark "stackp" (ptr void)
11
- let nxt = field stackmark "nxt" string
12
- let size = field stackmark "stacknleft" F.size_t
13
- let () = seal stackmark
14
-
15
- (* AST nodes *)
16
-
17
- (* define the node type... *)
18
- type node
19
- let node : node union typ = union "node"
20
- let node_type = field node "type" int
21
- (* ...but don't seal it yet! *)
22
-
23
- type nodelist
24
- let nodelist : nodelist structure typ = structure "nodelist"
25
- let nodelist_next = field nodelist "next" (ptr nodelist)
26
- let nodelist_n = field nodelist "n" (ptr node)
27
- let () = seal nodelist
28
-
29
- type ncmd
30
-
31
- let ncmd : ncmd structure typ = structure "ncmd"
32
- let ncmd_type = field ncmd "type" int
33
- let ncmd_linno = field ncmd "linno" int
34
- let ncmd_assign = field ncmd "assign" (ptr node)
35
- let ncmd_args = field ncmd "args" (ptr node)
36
- let ncmd_redirect = field ncmd "redirect" (ptr node)
37
- let () = seal ncmd
38
-
39
- let node_ncmd = field node "ncmd" ncmd
40
-
41
- type npipe
42
-
43
- let npipe : npipe structure typ = structure "npipe"
44
- let npipe_type = field npipe "type" int
45
- let npipe_backgnd = field npipe "backgnd" int
46
- let npipe_cmdlist = field npipe "cmdlist" (ptr nodelist)
47
- let () = seal npipe
48
-
49
- let node_npipe = field node "npipe" npipe
50
-
51
- type nredir
52
-
53
- let nredir : nredir structure typ = structure "nredir"
54
- let nredir_type = field nredir "type" int
55
- let nredir_linno = field nredir "linno" int
56
- let nredir_n = field nredir "n" (ptr node)
57
- let nredir_redirect = field nredir "redirect" (ptr node)
58
- let () = seal nredir
59
-
60
- let node_nredir = field node "nredir" nredir
61
-
62
- type nbinary
63
-
64
- let nbinary : nbinary structure typ = structure "nbinary"
65
- let nbinary_type = field nbinary "type" int
66
- let nbinary_ch1 = field nbinary "ch1" (ptr node)
67
- let nbinary_ch2 = field nbinary "ch2" (ptr node)
68
- let () = seal nbinary
69
-
70
- let node_nbinary = field node "nbinary" nbinary
71
-
72
- type nif
73
-
74
- let nif : nif structure typ = structure "nif"
75
- let nif_type = field nif "type" int
76
- let nif_test = field nif "test" (ptr node)
77
- let nif_ifpart = field nif "ifpart" (ptr node)
78
- let nif_elsepart = field nif "elsepart" (ptr node)
79
- let () = seal nif
80
-
81
- let node_nif = field node "nif" nif
82
-
83
- type nfor
84
-
85
- let nfor : nfor structure typ = structure "nfor"
86
- let nfor_type = field nfor "type" int
87
- let nfor_linno = field nfor "linno" int
88
- let nfor_args = field nfor "args" (ptr node)
89
- let nfor_body = field nfor "body" (ptr node)
90
- let nfor_var = field nfor "var" string
91
- let () = seal nfor
92
-
93
- let node_nfor = field node "nfor" nfor
94
-
95
- type ncase
96
-
97
- let ncase : ncase structure typ = structure "ncase"
98
- let ncase_type = field ncase "type" int
99
- let ncase_linno = field ncase "linno" int
100
- let ncase_expr = field ncase "expr" (ptr node)
101
- let ncase_cases = field ncase "cases" (ptr node)
102
- let () = seal ncase
103
-
104
- let node_ncase = field node "ncase" ncase
105
-
106
- type nclist
107
-
108
- let nclist : nclist structure typ = structure "nclist"
109
- let nclist_type = field nclist "type" int
110
- let nclist_next = field nclist "next" (ptr node)
111
- let nclist_pattern = field nclist "pattern" (ptr node)
112
- let nclist_body = field nclist "body" (ptr node)
113
- let () = seal nclist
114
-
115
- let node_nclist = field node "nclist" nclist
116
-
117
- type ndefun
118
-
119
- let ndefun : ndefun structure typ = structure "ndefun"
120
- let ndefun_type = field ndefun "type" int
121
- let ndefun_linno = field ndefun "linno" int
122
- let ndefun_text = field ndefun "text" string
123
- let ndefun_body = field ndefun "body" (ptr node)
124
- let () = seal ndefun
125
-
126
- let node_ndefun = field node "ndefun" ndefun
127
-
128
- type narg
129
-
130
- let narg : narg structure typ = structure "narg"
131
- let narg_type = field narg "type" int
132
- let narg_next = field narg "next" (ptr node)
133
- let narg_text = field narg "text" string
134
- let narg_backquote = field narg "backquote" (ptr nodelist)
135
- let () = seal narg
136
-
137
- let node_narg = field node "narg" narg
138
-
139
- type nfile
140
-
141
- let nfile : nfile structure typ = structure "nfile"
142
- let nfile_type = field nfile "type" int
143
- let nfile_next = field nfile "next" (ptr node)
144
- let nfile_fd = field nfile "fd" int
145
- let nfile_fname = field nfile "fname" (ptr node)
146
- let nfile_expfname = field nfile "expfname" string
147
- let () = seal nfile
148
-
149
- let node_nfile = field node "nfile" nfile
150
-
151
- type ndup
152
-
153
- let ndup : ndup structure typ = structure "ndup"
154
- let ndup_type = field ndup "type" int
155
- let ndup_next = field ndup "next" (ptr node)
156
- let ndup_fd = field ndup "fd" int
157
- let ndup_dupfd = field ndup "dupfd" int
158
- let ndup_vname = field ndup "vname" (ptr node)
159
- let () = seal ndup
160
-
161
- let node_ndup = field node "ndup" ndup
162
-
163
- type nhere
164
-
165
- let nhere : nhere structure typ = structure "nhere"
166
- let nhere_type = field nhere "type" int
167
- let nhere_next = field nhere "next" (ptr node)
168
- let nhere_fd = field nhere "fd" int
169
- let nhere_doc = field nhere "doc" (ptr node)
170
- let () = seal nhere
171
-
172
- let node_nhere = field node "nhere" nhere
173
-
174
- type nnot
175
-
176
- let nnot : nnot structure typ = structure "nnot"
177
- let nnot_type = field nnot "type" int
178
- let nnot_com = field nnot "com" (ptr node)
179
- let () = seal nnot
180
-
181
- let node_nnot = field node "nnot" nnot
182
- let () = seal node
183
-
184
- end
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