File tree Expand file tree Collapse file tree 3 files changed +41
-4
lines changed Expand file tree Collapse file tree 3 files changed +41
-4
lines changed Original file line number Diff line number Diff line change @@ -2427,9 +2427,9 @@ def ParseCommand(self):
2427
2427
part0 = parts [0 ]
2428
2428
if part0 .tag () == word_part_e .Literal :
2429
2429
tok = cast (Token , part0 )
2430
- if (match . IsValidVarName ( lexer . LazyStr ( tok )) and
2431
- self .w_parser .LookPastSpace () == Id .Lit_Equals ):
2432
- assert tok . id == Id . Lit_Chars , tok
2430
+ if (tok . id == Id . Lit_Chars and
2431
+ self .w_parser .LookPastSpace () == Id .Lit_Equals and
2432
+ match . IsValidVarName ( lexer . LazyStr ( tok ))):
2433
2433
2434
2434
if (len (self .hay_attrs_stack ) and
2435
2435
self .hay_attrs_stack [- 1 ]):
Original file line number Diff line number Diff line change 1
-
2
1
# # compare_shells: bash dash mksh zsh ash
3
2
# # oils_failures_allowed: 0
4
3
@@ -360,3 +359,26 @@ PWNED
360
359
0
361
360
# # END
362
361
362
+ # ### printf bugs (Koiche on Zulip)
363
+ printf ' %x\n' 2147483648
364
+ printf ' %u\n' 2147483648
365
+ # # STDOUT:
366
+ 80000000
367
+ 2147483648
368
+ # # END
369
+
370
+ # ### bit shift bug (Koiche on Zulip)
371
+ case $SH in dash|ash) exit ;; esac
372
+
373
+ (( 1 << 32 ))
374
+ echo status=$?
375
+
376
+ (( 1 << 32 )) && echo yes
377
+
378
+ # # STDOUT:
379
+ status=0
380
+ yes
381
+ # # END
382
+
383
+ # # N-I dash/ash STDOUT:
384
+ # # END
Original file line number Diff line number Diff line change @@ -149,3 +149,18 @@ echo $Q
149
149
world
150
150
# # END
151
151
152
+
153
+ # ### Parsing crash - bug #2003
154
+
155
+ set +o errexit
156
+
157
+ $SH -c ' proc y (;x) { return = x }'
158
+ echo status=$?
159
+
160
+ $SH -c ' func y (;x) { return = x }'
161
+ echo status=$?
162
+
163
+ # # STDOUT:
164
+ status=2
165
+ status=2
166
+ # # END
You can’t perform that action at this time.
0 commit comments