[squeak-dev] The Trunk: Compiler-nice.181.mcz
Eliot Miranda
eliot.miranda at gmail.com
Fri Nov 19 20:18:26 UTC 2010
Thanks, Nicholas!
On Fri, Nov 19, 2010 at 8:32 AM, <commits at source.squeak.org> wrote:
> Nicolas Cellier uploaded a new version of Compiler to project The Trunk:
> http://source.squeak.org/trunk/Compiler-nice.181.mcz
>
> ==================== Summary ====================
>
> Name: Compiler-nice.181
> Author: nice
> Time: 19 November 2010, 5:32:20.688 pm
> UUID: 86d69779-755f-0548-8a95-11173c3b8370
> Ancestors: Compiler-eem.180
>
> Let (Scanner isLiteralSymbol: #<) be true
>
> =============== Diff against Compiler-eem.180 ===============
>
> Item was changed:
> ----- Method: Scanner class>>isLiteralSymbol: (in category 'testing')
> -----
> isLiteralSymbol: aSymbol
> "Test whether a symbol can be stored as # followed by its
> characters.
> Symbols created internally with asSymbol may not have this property,
> e.g. '3' asSymbol."
>
> | i ascii type next last |
> i := aSymbol size.
> i = 0 ifTrue: [^ false].
>
> "TypeTable should have been origined at 0 rather than 1 ..."
> ascii := (aSymbol at: 1) asciiValue.
> type := TypeTable at: ascii ifAbsent: [^false].
> type == #xLetter ifTrue: [
> next := last := nil.
> [i > 1]
> whileTrue:
> [ascii := (aSymbol at: i)
> asciiValue.
> type := TypeTable at: ascii
> ifAbsent: [^false].
> (type == #xLetter or: [type ==
> #xDigit or: [type == #xColon
> and: [
> next == nil
>
> ifTrue: [last := #xColon. true]
>
> ifFalse: [last == #xColon and: [next ~~ #xDigit and: [next ~~
> #xColon]]]]]])
> ifFalse: [^ false].
> next := type.
> i := i - 1].
> + ^ true].
> + type == #xBinary ifTrue:
> + [^(2 to: i) allSatisfy: [:j |
> - ^ true].
> - type == #xBinary ifTrue: [^i = 1]. "Here we could extend to
> - ^(2 to: i) allSatisfy: [:j |
> ascii := (aSymbol at: j) asciiValue.
> + (TypeTable at: ascii ifAbsent: []) == #xBinary]].
> - (TypeTable at: ascii ifAbsent: []) == #xBinary]"
> type == #verticalBar ifTrue: [^i = 1].
> ^false!
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20101119/ac5be0b4/attachment.htm
More information about the Squeak-dev
mailing list
|