Issue with 'Kernel.ConcatenatedStream' and gst-convert

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

Issue with 'Kernel.ConcatenatedStream' and gst-convert

Holger Freyther
Hi Paolo,

I am having a problem with the Kernel.ConcatenatedStream when trying
to convert multiple files to the Squeak/Pharo fileout. I have attached
two simple files and execute the following.

$ gst-convert  -F squeak -f gst -o foo.st LogArea.st Timer.st
UndefinedObject(Object)>>doesNotUnderstand: #copyFrom:to: (SysExcept.st:1448)
Kernel.ConcatenatedStream>>copyFrom:to: (StreamOps.st:168)
STInST.MappedSourceCode class>>on:from:to: (Parser.star#VFS.ZipFile/STFileParser.st:433)
STInST.GSTFileInParser(STInST.STFileParser)>>addSourceFrom:to:to: (Parser.star#VFS.ZipFile/STFileParser.st:152)
STInST.GSTFileInParser>>parseMethodSource:on: (Parser.star#VFS.ZipFile/GSTParser.st:317)
STInST.GSTFileInParser>>parseMethodSource: (Parser.star#VFS.ZipFile/GSTParser.st:299)
STInST.GSTFileInParser>>parseClassBodyElement:withinExtend: (Parser.star#VFS.ZipFile/GSTParser.st:230)
STInST.GSTFileInParser>>parseClassBody: (Parser.star#VFS.ZipFile/GSTParser.st:169)
STInST.GSTFileInParser>>parseClass: (Parser.star#VFS.ZipFile/GSTParser.st:157)
STInST.GSTFileInParser>>parseDeclaration: (Parser.star#VFS.ZipFile/GSTParser.st:95)
STInST.GSTFileInParser>>parseDoit (Parser.star#VFS.ZipFile/GSTParser.st:82)
STInST.GSTFileInParser>>parseDoits (Parser.star#VFS.ZipFile/GSTParser.st:67)
STInST.GSTFileInParser(STInST.STFileInParser)>>parseSmalltalk (Parser.star#VFS.ZipFile/STFileParser.st:282)
STInST.GSTFileInParser class(STInST.STFileParser class)>>parseSmalltalkStream:with:onError: (Parser.star#VFS.ZipFile/STFileParser.st:70)
STInST.GSTFileInParser class(STInST.STFileParser class)>>parseSmalltalkStream:with: (Parser.star#VFS.ZipFile/STFileParser.st:60)
SyntaxConverter(STInST.STParsingDriver)>>parseSmalltalkStream:with: (Parser.star#VFS.ZipFile/STFileParser.st:181)
SyntaxConverter>>convertStream:with:to: (../../../install/gst/share/smalltalk/scripts/Convert.st:235)
[] in UndefinedObject>>executeStatements (../../../install/gst/share/smalltalk/scripts/Convert.st:559)


The ConcatenatedStream at this point is at the end. 'self stream' is returning
nil at this point so 'end <= startPos' does not appear to trigger but also
adding:

'stream isNil
            ifTrue: [stream := last. adjust := lastStart]'

does not work. Do you have an idea?

        holger

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

Timer.st (64 bytes) Download Attachment
LogArea.st (38 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Issue with 'Kernel.ConcatenatedStream' and gst-convert

Holger Freyther
On Sat, Oct 06, 2012 at 03:25:58AM +0200, Holger Hans Peter Freyther wrote:
>
> does not work. Do you have an idea?

'self streams' returns 'nil' but 'streams first' will not be moved into
the last. I ended up doing the following. I fail to create a testcase that
is using ReadStream..

diff --git a/kernel/StreamOps.st b/kernel/StreamOps.st
index 9fd1769..0525e5f 100644
--- a/kernel/StreamOps.st
+++ b/kernel/StreamOps.st
@@ -158,7 +158,7 @@ Stream subclass: ConcatenatedStream [
 
        <category: 'all'>
        | adjust stream |
-       stream := self stream.
+       stream := self stream ifNil: [streams first].
        end + 1 = start ifTrue: [^''].
        adjust := end <= startPos
            ifTrue: [stream := last. lastStart]



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