<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 25, 2022 at 9:43 AM <<a href="mailto:christoph.thiede@student.hpi.uni-potsdam.de">christoph.thiede@student.hpi.uni-potsdam.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><b>=============== Summary ===============</b><br>
<br>
Change Set:        UnassignedVariable<br>
Date:            25 November 2022<br>
Author:            Christoph Thiede<br>
<br>
Renames 'undeclared variable' warning to 'unassigned variable' as proposed by Eliot (emm) in [1]. Note that for now, I'd stick with the vocabulary #hasDef in ParseNodes as it a) aligns with #hasRef and b) has more than a few senders. Please report back whether you'd like to see that renamed, too.<br></blockquote><div><br></div><div class="gmail_default" style="font-size:small">Since it's my proposal I shouldn't vote.  But thankyou very much for the code!!</div><div class="gmail_default" style="font-size:small"></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<br>
[1] <a href="https://lists.squeakfoundation.org/pipermail/squeak-dev/2022-November/222668.html#:~:text=the%20language%20used%20in%20parser%3E%3E%23queryundefined" target="_blank">https://lists.squeakfoundation.org/pipermail/squeak-dev/2022-November/222668.html#:~:text=the%20language%20used%20in%20parser%3E%3E%23queryundefined</a><br>
<br>
<b>=============== Postscript ===============</b><br>
<br>
<font color="#000000">CompilerExceptionsTest </font><font color="#000080">removeSelector:</font><font color="#000000"> </font><font color="#000080">#testUndefinedVariable</font><br>
<br>
<b>=============== Diff ===============</b><br>
<br>
<b>CompilerExceptionsTest>>testUnassignedVariable {tests} · ct 11/25/2022 18:31</b><br>
<font color="#FF0000">+ testUnassignedVariable<br>
+ <br>
+     self <br>
+         compiling: 'griffle | goo | ^ goo'<br>
+         shouldRaise: UnassignedVariable<br>
+         andSelect: [(text allRangesOfRegexMatches: '(?<=\^ )goo') first]<br>
+         testing: {<br>
+             true -> [self assertSucceeded].<br>
+             false -> [self assertCanceled] }.<br>
+     self<br>
+         compiling: 'griffle [ | goo | ^ goo ] value'<br>
+         shouldRaise: UnassignedVariable<br>
+         andSelect: [(text allRangesOfRegexMatches: '(?<=\^ )goo') first]<br>
+         testing: {<br>
+             true -> [self assertSucceeded].<br>
+             false -> [self assertCanceled] }.</font><br>
<br>
<b>Parser>>primaryExpression {expression types} · ct 11/25/2022 18:30 (changed)</b><br>
primaryExpression <br>
    hereType == #word <br>
        ifTrue: <br>
            [parseNode := self variable.<br>
            (parseNode isUndefTemp<br>
             and: [(#(ifNil: ifNotNil: isNil notNil) includes: here) not<br>
             and: [self interactive]])<br>
                ifTrue:<br>
<s><font color="#0000FF">-                     [self queryUndefined].<br>
</font></s><font color="#FF0000">+                     [self queryUnassigned].<br>
</font>            parseNode nowHasRef.<br>
            ^ true].<br>
    hereType == #leftBracket<br>
        ifTrue: <br>
            [self advance.<br>
            self blockExpression.<br>
            ^true].<br>
    hereType == #leftBrace<br>
        ifTrue: <br>
            [self braceExpression.<br>
            ^true].<br>
    hereType == #leftParenthesis<br>
        ifTrue: <br>
            [self advance.<br>
            self expression ifFalse: [^self expected: 'expression'].<br>
            (self match: #rightParenthesis)<br>
                ifFalse: [^self expected: 'right parenthesis'].<br>
            ^true].<br>
    (hereType == #string or: [hereType == #number or: [hereType == #literal or: [hereType == #character]]])<br>
        ifTrue: <br>
            [parseNode := encoder encodeLiteral: self advance.<br>
            ^true].<br>
    (here == #- and: [tokenType == #number and: [1 + hereEnd = mark]])<br>
        ifTrue: <br>
            [self advance.<br>
            parseNode := encoder encodeLiteral: self advance negated.<br>
            ^true].<br>
    ^false<br>
<br>
<b>Parser>>queryUnassigned {error correction} · ct 11/25/2022 18:31</b><br>
<font color="#FF0000">+ queryUnassigned<br>
+     | varStart varName | <br>
+     varName := parseNode key.<br>
+     varStart := self endOfLastToken + requestorOffset - varName size + 1.<br>
+     self selectFrom: varStart to: varStart + varName size - 1 during: [<br>
+         (UnassignedVariable name: varName) ifFalse: [^ self fail]].</font><br>
<br>
<b>UnassignedVariable>>openMenuIn: {handling} · ct 11/25/2022 18:31</b><br>
<font color="#FF0000">+ openMenuIn: aBlock<br>
+ <br>
+     self resume: (Project uiManager<br>
+         confirm: ('{1} appears to be unassigned at this point.\Proceed anyway?' translated withCRs asText<br>
+             format: {name asText allBold})<br>
+         orCancel: [false]<br>
+         title: 'Unassigned Variable' translated).</font><br>
<br>
<font color="#808080">---<br>
</font><font color="#808080"><i>Sent from </i></font><font color="#808080"><i><a href="https://github.com/hpi-swa-lab/squeak-inbox-talk" target="_blank"><u><font color="#808080">Squeak Inbox Talk</font></u></a></i></font><br>
["UnassignedVariable.1.cs"]<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div></div>