<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 12pt; color: rgb(0, 0, 0);">
<a href="https://github.com/tcsh-org/tcsh/pull/89/files/e59e30adb28b683f5f46f5b66bedfe1d6366e7d4#diff-3c3be7038187eac587a847863d11413dc3111f2fb82c8e0785227287961e8a1bR280" id="LPlnk848641" class="OWAAutoLink">https://github.com/tcsh-org/tcsh/pull/89/files/e59e30adb28b683f5f46f5b66bedfe1d6366e7d4#diff-3c3be7038187eac587a847863d11413dc3111f2fb82c8e0785227287961e8a1bR280</a><br>
Refactored.<br>
<br>
const-qualified variables yield undefined behavior on change. Do pointer struct members follow this behavior as well? Possible undefined behavior case?<br>
<br>
@@ -273,9 +274,21 @@ syn0(const struct wordent *p1, const struct wordent *p2, int flags)</div>
<div class="elementToProof" style="font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 12pt; color: rgb(0, 0, 0);">
            t->t_dcar = t1;</div>
<div class="elementToProof" style="font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 12pt; color: rgb(0, 0, 0);">
            t->t_dcdr = syntax(p, p2, flags);</div>
<div class="elementToProof" style="font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 12pt; color: rgb(0, 0, 0);">
            return (t);</div>
<div class="elementToProof" style="font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 12pt; color: rgb(0, 0, 0);">
+</div>
<div class="elementToProof" style="font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 12pt; color: rgb(0, 0, 0);">
+       case '#':</div>
<div class="elementToProof" style="font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 12pt; color: rgb(0, 0, 0);">
+           if (intty) {</div>
<div class="elementToProof" style="font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 12pt; color: rgb(0, 0, 0);">
+               struct wordent *p1 = p2->prev;</div>
<div class="elementToProof" style="font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 12pt; color: rgb(0, 0, 0);">
+</div>
<div class="elementToProof" style="font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 12pt; color: rgb(0, 0, 0);">
+               p1 = p1->prev = p1->prev->prev;</div>
<div class="elementToProof" style="font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 12pt; color: rgb(0, 0, 0);">
+               xfree(p1->next->word);</div>
<div class="elementToProof" style="font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 12pt; color: rgb(0, 0, 0);">
+               xfree(p1->next);</div>
<div class="elementToProof" style="font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 12pt; color: rgb(0, 0, 0);">
+               p1->next = p2->prev;</div>
<div class="elementToProof" style="font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 12pt; color: rgb(0, 0, 0);">
+               goto out;</div>
<div class="elementToProof" style="font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 12pt; color: rgb(0, 0, 0);">
+           }</div>
<div class="elementToProof" style="font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 12pt; color: rgb(0, 0, 0);">
        default:</div>
<div class="elementToProof" style="font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 12pt; color: rgb(0, 0, 0);">
            break;</div>
<div class="elementToProof" style="font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 12pt; color: rgb(0, 0, 0);">
        }</div>
<div class="elementToProof" style="font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 12pt; color: rgb(0, 0, 0);">
+out:</div>
<div class="elementToProof" style="font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 12pt; color: rgb(0, 0, 0);">
     if (l == 0)</div>
<div class="elementToProof" style="font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 12pt; color: rgb(0, 0, 0);">
        return (syn1(p1, p2, flags));</div>
<div class="elementToProof" style="font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 12pt; color: rgb(0, 0, 0);">
     seterror(ERR_TOOMANYLP);</div>
<div id="appendonsend"></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<hr style="display: inline-block; width: 98%;">
<div id="divRplyFwdMsg" dir="ltr">
<div class="elementToProof" style="font-family: Calibri, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<b><br>
</b></div>
</div>
<div>https://github.com/Krush206/tcsh/commit/70eec821e7965cfa728277e00d12a174829abc82</div>
<div>This should do to prevent history substitution. Only problem is that adds a new backslash for ! characters.</div>
<br>
<hr style="display: inline-block; width: 98%;">
<div id="x_divRplyFwdMsg" dir="ltr"><br>
<div>https://github.com/Krush206/tcsh/commit/93f08ae2b63073ba57125bbb2be375e7c78cdaa5</div>
</div>
<div>I modified the parser so that # characters are ignored. Unfortunately, history substitution still is parsed, because it's executed before syntax(). History substitution is probably located in sh.lex.c, and the code is executed before syntax().</div>
<div><br>
</div>
<hr style="display: inline-block; width: 98%;">
<div id="x_x_divRplyFwdMsg" dir="ltr"><br>
</div>
<div style="direction: ltr;">Is there any possibility/interest in adding an 'interactive_comments" option for tcsh like is in bash?</div>
<div style="direction: ltr;"><br>
</div>
<div style="direction: ltr;">I'm interested because I often make notes of procedures/commands that I want to cat and paste into the terminal to repeat at some point and want to be able to add comments to them.  Stuff like:</div>
<blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left: 1px solid rgb(204, 204, 204);">
<div style="direction: ltr; font-family: monospace;">mkdir foobar   # pick any name</div>
<div style="direction: ltr; font-family: monospace;">cd foobar     </div>
<div style="direction: ltr; font-family: monospace;">ln -s ../bletch/bin/* ./    # include bletch commands</div>
</blockquote>
<div style="direction: ltr;"><br>
</div>
<div style="direction: ltr;">I have been using ' ;: ' to introduce comments, but the shell still tries to parse the rest of the line and if there are any quotes, semi-colons, less-thans, or greater-thans, it doesn't work properly</div>
<div style="direction: ltr;"><br>
</div>
<div style="direction: ltr;">-WRSomsky</div>
</body>
</html>