Sponsored bug of the day: !s in a startup script cause SyntaxErrors

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

Sponsored bug of the day: !s in a startup script cause SyntaxErrors

Frank Shearar-3
http://bugs.squeak.org/view.php?id=7732 says

Sample startup demonstrating the problem:

    FileStream stdout nextPutAll: '! is an exclamation mark'; flush.

which causes a SyntaxError whose content is:

    FileStream stdout nextPutAll: Unmatched string quote ->'
----
This is probably caused by something thinking the startup script is in
chunk format?
----

The bug is spectacularly annoying because you simply (*) cannot run a
script headless without first verifying that it works headfully. And
come on, the ! is in a _string_.

frank


(*) The whole startup script process needs to be reworked, and that's
well out of scope for this ticket or this thread, and we actually need
some kind of headless UIManager, and that too is out of scope for now!

Reply | Threaded
Open this post in threaded view
|

Re: Sponsored bug of the day: !s in a startup script cause SyntaxErrors

Bob Arning-2
Yes,

CodeLoader >> installSourceFile:

does a #fileIn on your startup file, which means it does expect a chunk format. One solution would be to make sure your startup is in that format

(FileStream fileNamed: 'chunkedStartUp')
    nextChunkPut: 'FileStream stdout nextPutAll: ''! is an exclamation mark''; flush.';
    flush;
    close

or if your raw startup is in a file already

(FileStream fileNamed: 'chunkedStartUp')
    nextChunkPut: (FileStream readOnlyFileNamed: 'rawStartup') contentsOfEntireFile;
    flush;
    close

Cheers,
Bob

On 3/2/13 6:26 AM, Frank Shearar wrote:
http://bugs.squeak.org/view.php?id=7732 says

Sample startup demonstrating the problem:

    FileStream stdout nextPutAll: '! is an exclamation mark'; flush.

which causes a SyntaxError whose content is:

    FileStream stdout nextPutAll: Unmatched string quote ->'
----
This is probably caused by something thinking the startup script is in
chunk format?
----

The bug is spectacularly annoying because you simply (*) cannot run a
script headless without first verifying that it works headfully. And
come on, the ! is in a _string_.

frank


(*) The whole startup script process needs to be reworked, and that's
well out of scope for this ticket or this thread, and we actually need
some kind of headless UIManager, and that too is out of scope for now!