Thanks, Nicholas!<br><br><div class="gmail_quote">On Fri, Nov 19, 2010 at 8:32 AM, <span dir="ltr"><<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Nicolas Cellier uploaded a new version of Compiler to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Compiler-nice.181.mcz" target="_blank">http://source.squeak.org/trunk/Compiler-nice.181.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Compiler-nice.181<br>
Author: nice<br>
Time: 19 November 2010, 5:32:20.688 pm<br>
UUID: 86d69779-755f-0548-8a95-11173c3b8370<br>
Ancestors: Compiler-eem.180<br>
<br>
Let (Scanner isLiteralSymbol: #<) be true<br>
<br>
=============== Diff against Compiler-eem.180 ===============<br>
<br>
Item was changed:<br>
----- Method: Scanner class>>isLiteralSymbol: (in category 'testing') -----<br>
isLiteralSymbol: aSymbol<br>
"Test whether a symbol can be stored as # followed by its characters.<br>
Symbols created internally with asSymbol may not have this property,<br>
e.g. '3' asSymbol."<br>
<br>
| i ascii type next last |<br>
i := aSymbol size.<br>
i = 0 ifTrue: [^ false].<br>
<br>
"TypeTable should have been origined at 0 rather than 1 ..."<br>
ascii := (aSymbol at: 1) asciiValue.<br>
type := TypeTable at: ascii ifAbsent: [^false].<br>
type == #xLetter ifTrue: [<br>
next := last := nil.<br>
[i > 1]<br>
whileTrue:<br>
[ascii := (aSymbol at: i) asciiValue.<br>
type := TypeTable at: ascii ifAbsent: [^false].<br>
(type == #xLetter or: [type == #xDigit or: [type == #xColon<br>
and: [<br>
next == nil<br>
ifTrue: [last := #xColon. true]<br>
ifFalse: [last == #xColon and: [next ~~ #xDigit and: [next ~~ #xColon]]]]]])<br>
ifFalse: [^ false].<br>
next := type.<br>
i := i - 1].<br>
+ ^ true].<br>
+ type == #xBinary ifTrue:<br>
+ [^(2 to: i) allSatisfy: [:j |<br>
- ^ true].<br>
- type == #xBinary ifTrue: [^i = 1]. "Here we could extend to<br>
- ^(2 to: i) allSatisfy: [:j |<br>
ascii := (aSymbol at: j) asciiValue.<br>
+ (TypeTable at: ascii ifAbsent: []) == #xBinary]].<br>
- (TypeTable at: ascii ifAbsent: []) == #xBinary]"<br>
type == #verticalBar ifTrue: [^i = 1].<br>
^false!<br>
<br>
<br>
</blockquote></div><br>