undeclared bindings; ArrayConstructorNodes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

undeclared bindings; ArrayConstructorNodes

S11001001
I've been trying to load I18N with Compiler loaded in 2.3.1, using
compiler-cascade.diff from earlier.  (This patch works fine, by the
way.)

In STSymbolTable, bindingOf:for: (used for vars with paths) handles
undeclared variables during fileIn as the builtin compiler does, but
lookupPoolsFor: (used for vars without paths) does not.  Attached is
gst-lookupPoolsFor-undeclared.diff on compiler/STSymTable.st to handle
this.

Then, I ran into what seemed to be a premature send of
STSymbolTable>>#finish (as #() cannot grow).  Test:

st> UndefinedObject compile: 'scTest: aV and: bV | what | what := {aV. bV}.
        self strftime: what format: aV readStream on: bV'!
Object: Array new: 0 "<-0x4c5c9288>" error: Invalid index 1: index out of range
SystemExceptions.IndexOutOfRange(Smalltalk.Exception)>>#signal
SystemExceptions.IndexOutOfRange class>>#signalOn:withIndex:
Smalltalk.Array(Smalltalk.Object)>>#checkIndexableBounds:put:
Smalltalk.Array(Smalltalk.Object)>>#at:put:
[] in STInST.STLiteralsTable>>#addLiteral:

RBArrayConstructorNode>>#acceptVisitor: still sends #acceptArrayNode:,
and RBProgramNodeVisitor's implementation of that descends into the
SequenceNode, presumably invoking the aforementioned #finish.

I don't know which way the renaming is going, so I just added
acceptArrayNode: to STCompiler.  Then I found that
acceptArrayConstructorNode: was storing in 1,2,3 instead of 0,1,2 for
this little test: 'scTest ^{1. 2. 3}', so I shifted that back.  Both are
in gst-arrayCtor.diff on compiler/STCompiler.st.

Now I can load I18N with Compiler!

--
Stephen Compall
http://scompall.nocandysw.com/blog

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

gst-lookupPoolsFor-undeclared.diff (2K) Download Attachment
gst-arrayCtor.diff (1K) Download Attachment
signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: undeclared bindings; ArrayConstructorNodes

Paolo Bonzini
Stephen Compall wrote:
> I've been trying to load I18N with Compiler loaded in 2.3.1, using
> compiler-cascade.diff from earlier.  (This patch works fine, by the
> way.)
>
> In STSymbolTable, bindingOf:for: (used for vars with paths) handles
> undeclared variables during fileIn as the builtin compiler does, but
> lookupPoolsFor: (used for vars without paths) does not.  Attached is
> gst-lookupPoolsFor-undeclared.diff on compiler/STSymTable.st to handle
> this.

I applied it, except that I renamed lookupPoolsAndUndeclaredFor: to
lookupBindingOf:


> RBArrayConstructorNode>>#acceptVisitor: still sends #acceptArrayNode:,
> and RBProgramNodeVisitor's implementation of that descends into the
> SequenceNode, presumably invoking the aforementioned #finish.
>
> I don't know which way the renaming is going, so I just added
> acceptArrayNode: to STCompiler.

I renamed every acceptArrayNode: to acceptArrayConstructorNode: and
applied the other part of the patch.

Thanks (next time also include ChangeLog entries)!

Paolo



_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk