[squeak-dev] The Inbox: Multilingual-nice.250.mcz

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Wed Dec 11 21:02:31 UTC 2019


Le mer. 11 déc. 2019 à 21:45, <commits at source.squeak.org> a écrit :

> Nicolas Cellier uploaded a new version of Multilingual to project The
> Inbox:
> http://source.squeak.org/inbox/Multilingual-nice.250.mcz
>
> ==================== Summary ====================
>
> Name: Multilingual-nice.250
> Author: nice
> Time: 11 December 2019, 9:45:47.879387 pm
> UUID: ebe6fac0-efa6-449b-8e4c-7eb3fd167b47
> Ancestors: Multilingual-mt.249
>
> Nuke keyValueIndex (my pleasure)
>
> The intention was for accessing either event buffer at 3 (macRoman) or 6
> (UTF32/UCS4)
>
> Currently the choice is between 6 or 6 (it could have been dependent on VM
> version in 2007, but it's not and never was in Cog/Spur)
>
> Anyway, the code was testing for presence of #SugarLaunche instead of
> #SugarLauncher, so it would not have worked as intended (if ever we can
> distinguish 6 from 6).
>
> =============== Diff against Multilingual-mt.249 ===============
>
> Item was changed:
>   KeyboardInputInterpreter subclass: #MacUnicodeInputInterpreter
> +       instanceVariableNames: ''
> -       instanceVariableNames: 'keyValueIndex'
>         classVariableNames: ''
>         poolDictionaries: ''
>         category: 'Multilingual-TextConversion'!
>
> Item was changed:
>   ----- Method: MacUnicodeInputInterpreter>>nextCharFrom:firstEvt: (in
> category 'keyboard') -----
>   nextCharFrom: sensor firstEvt: evtBuf
>         | keyValue mark |
>         keyValue := evtBuf at: 6.
>         mark := self japaneseSpecialMark: keyValue.
>         mark notNil
>                 ifTrue: [^ mark].
> -       keyValue < 256
> -               ifTrue: [^Character value: keyValue].
>

Ah sorry, the change above was not advertised...
It is because Unicode>>value: will perform the exact same test, so no need
to duplicate the work!

        "Smalltalk systemLanguage charsetClass charFromUnicode: keyValue."
>         ^ Unicode value: keyValue!
>
> Item was changed:
>   KeyboardInputInterpreter subclass: #UnixUnicodeInputInterpreter
> +       instanceVariableNames: ''
> -       instanceVariableNames: 'keyValueIndex'
>         classVariableNames: ''
>         poolDictionaries: ''
>         category: 'Multilingual-TextConversion'!
>
> Item was removed:
> - ----- Method: UnixUnicodeInputInterpreter>>initialize (in category
> 'initialization') -----
> - initialize
> -       | satisfiesVersion launcherClass |
> -       launcherClass := Smalltalk at: #SugarLaunche  ifAbsent: [nil].
> -       satisfiesVersion := launcherClass notNil and: [launcherClass
> current isRunningInSugar].
> -       satisfiesVersion
> -               ifTrue: [keyValueIndex := 6]
> -               ifFalse: [keyValueIndex := 6  "it might have to be 3, but
> probably different logic to check the VM version would be better."]!
>
> Item was removed:
> - ----- Method: UnixUnicodeInputInterpreter>>keyValueIndex (in category
> 'accessing') -----
> - keyValueIndex
> -       ^ keyValueIndex!
>
> Item was changed:
>   ----- Method: UnixUnicodeInputInterpreter>>nextCharFrom:firstEvt: (in
> category 'keyboard') -----
>   nextCharFrom: sensor firstEvt: evtBuf
>         | keyValue mark |
> +       keyValue := evtBuf at: 6.
> -       keyValue := evtBuf at: self keyValueIndex.
>         mark := self japaneseSpecialMark: keyValue.
>         mark notNil
>                 ifTrue: [^ mark].
>         keyValue < 256
>                 ifTrue: [^ Character value: keyValue].
>         "Smalltalk systemLanguage charsetClass charFromUnicode: keyValue."
>         ^ Unicode value: keyValue!
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191211/46783f9d/attachment.html>


More information about the Squeak-dev mailing list