• R/O
  • SSH
  • HTTPS

yash: Commit


Commit MetaInfo

Revision3899 (tree)
Time2018-09-30 02:20:06
Authormagicant

Log Message

Reject invalid semicolon after alias substitution

This is a fix-up for r3710 and r3809. Invalid semicolons have been
rejected since r3710, but r3809 failed to consider the case where alias
substitution occurs after a newline.

Change Summary

Incremental Difference

--- yash/trunk/NEWS (revision 3898)
+++ yash/trunk/NEWS (revision 3899)
@@ -21,6 +21,9 @@
2121 begins with a blank.
2222 * The "do" keyword in a for loop is no longer subject to alias
2323 substitution.
24+ * An invalid semicolon that appears at the beginning of a line as a
25+ result of alias substitution in a for loop is now correctly
26+ rejected.
2427 . Updated the sample initialization script (yashrc):
2528 = The prompt strings are now defined with the $YASH_PS...
2629 variables.
--- yash/trunk/parser.c (revision 3898)
+++ yash/trunk/parser.c (revision 3899)
@@ -2420,8 +2420,9 @@
24202420 }
24212421 next_token(ps);
24222422
2423-parse_in:;
2424- bool on_next_line = parse_newline_list(ps);
2423+ bool on_next_line = false;
2424+parse_in:
2425+ on_next_line |= parse_newline_list(ps);
24252426 if (ps->tokentype == TT_IN) {
24262427 next_token(ps);
24272428 result->c_forwords = parse_words(ps, false);
Show on old repository browser