Marcel Taeumel uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-mt.382.mcz
==================== Summary ====================
Name: Tests-mt.382
Author: mt
Time: 18 September 2017, 9:24:02.443429 am
UUID: e9db6354-5602-3d4a-b944-ad65501bad8d
Ancestors: Tests-eem.381
Adds a test to verify the integrity of the environment's user interface themes wrt. scope.
=============== Diff against Tests-eem.381 ===============
Item was added:
+ ----- Method: UserInterfaceThemeTest>>test27ScopeIntegrity (in category 'tests') -----
+ test27ScopeIntegrity
+ "If application code manages to use Object >> #userInterfaceTheme without invoking the DNU dispatch directly afterwards, the theme's scope might get inconsistent. Even though this should usually never happen, check for it to be sure."
+
+ | issues |
+ issues := OrderedCollection new.
+ UserInterfaceTheme allThemes do: [:uit |
+ (uit instVarNamed: #scope) isEmpty ifFalse: [issues add: uit]].
+ self assert: issues isEmpty description: 'Some user interface themes have an inconsistent scope state, which can interfere with GC.'.!
Marcel Taeumel uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-mt.382.mcz
==================== Summary ====================
Name: Tests-mt.382
Author: mt
Time: 18 September 2017, 9:24:02.443429 am
UUID: e9db6354-5602-3d4a-b944-ad65501bad8d
Ancestors: Tests-eem.381
Adds a test to verify the integrity of the environment's user interface themes wrt. scope.
=============== Diff against Tests-eem.381 ===============
Item was added:
+ ----- Method: UserInterfaceThemeTest>>test27ScopeIntegrity (in category 'tests') -----
+ test27ScopeIntegrity
+ "If application code manages to use Object >> #userInterfaceTheme without invoking the DNU dispatch directly afterwards, the theme's scope might get inconsistent. Even though this should usually never happen, check for it to be sure."
+
+ | issues |
+ issues := OrderedCollection new.
+ UserInterfaceTheme allThemes do: [:uit |
+ (uit instVarNamed: #scope) isEmpty ifFalse: [issues add: uit]].
+ self assert: issues isEmpty description: 'Some user interface themes have an inconsistent scope state, which can interfere with GC.'.!
David T. Lewis uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-dtl.768.mcz
==================== Summary ====================
Name: Tools-dtl.768
Author: dtl
Time: 16 September 2017, 9:40:44.948741 pm
UUID: a6a1ba7b-4614-46de-974b-41ced829733d
Ancestors: Tools-dtl.767
Fix comments
=============== Diff against Tools-dtl.767 ===============
Item was changed:
----- Method: ObjectExplorer>>copyName (in category 'menus - actions') -----
copyName
+ "Copy the name of the current variable, so the user can paste it into the window below and work with it."
- "Copy the name of the current variable, so the user can paste it into the window below and work with is."
Clipboard clipboardText: self currentSelection key. !
Item was changed:
----- Method: ObjectExplorer>>copyValue (in category 'menus - actions') -----
copyValue
+ "Copy a description of the value of the current variable, so the user can paste it into the window below and work with it."
- "Copy the name of the current variable, so the user can paste it into the window below and work with is."
Clipboard clipboardText: self currentSelection value asStringOrText. !
David T. Lewis uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-dtl.767.mcz
==================== Summary ====================
Name: Tools-dtl.767
Author: dtl
Time: 16 September 2017, 8:52:24.336542 pm
UUID: a4cda952-0952-4ecf-a895-0fa604787356
Ancestors: Tools-cbc.766
For ObjectExplorer>>copyValue, use #asStringOrText to ensure that the value can be copied to the clipboard.
=============== Diff against Tools-cbc.766 ===============
Item was changed:
----- Method: ObjectExplorer>>copyValue (in category 'menus - actions') -----
copyValue
"Copy the name of the current variable, so the user can paste it into the window below and work with is."
+ Clipboard clipboardText: self currentSelection value asStringOrText. !
- Clipboard clipboardText: self currentSelection value. !
David T. Lewis uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-cbc.766.mcz
==================== Summary ====================
Name: Tools-cbc.766
Author: cbc
Time: 15 September 2017, 1:32:51.722459 pm
UUID: 7fd4bc5e-35b0-954e-91f3-a1cd65adee00
Ancestors: Tools-eem.765
For Explorers, add a menu item 'Copy value' (similar to Copy name) that copies the value of the selected item, suitable for use elsewhere.
=============== Diff against Tools-eem.765 ===============
Item was added:
+ ----- Method: ObjectExplorer>>copyValue (in category 'menus - actions') -----
+ copyValue
+ "Copy the name of the current variable, so the user can paste it into the window below and work with is."
+
+ Clipboard clipboardText: self currentSelection value. !
Item was changed:
----- Method: ObjectExplorer>>mainTreeListMenu: (in category 'menus') -----
mainTreeListMenu: aMenu
<treeListMenu>
aMenu addStayUpItemSpecial.
aMenu addList: #(
('inspect (i)' inspectSelection)
('explore (I)' exploreSelection)
-
('method refs to this inst var' referencesToSelection)
('methods storing into this inst var' defsOfSelection)
('objects pointing to this value' objectReferencesToSelection)
('chase pointers' chasePointersForSelection)
('explore pointers' explorePointersForSelection)
-
('browse full (b)' browseFull)
('browse class' browseClass)
('browse hierarchy (h)' classHierarchy)
('browse protocol (p)' browseFullProtocol)
-
('references... (r)' browseVariableReferences)
('assignments... (a)' browseVariableAssignments)
('class refs (N)' browseClassRefs)
-
('copy name (c)' copyName)
+ ('copy value' copyValue)
('basic inspect' inspectBasic)).
Smalltalk isMorphic ifTrue: [
aMenu addList: #(
-
('viewer for this value (v)' viewerForValue))].
aMenu addList: #(
-
('monitor changes' monitorSelection)).
monitorList isEmptyOrNil ifFalse: [
aMenu addList: #(
('stop monitoring all' stopMonitoring))].
^ aMenu!
Patrick Rein uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-pre.204.mcz
==================== Summary ====================
Name: Network-pre.204
Author: pre
Time: 9 September 2017, 11:49:05.258212 am
UUID: 9c649cab-fd0e-f040-b203-268bcc758df6
Ancestors: Network-pre.203
Fixes minor issue with new MailAddressParser after using wrong message for trimming whitespace
=============== Diff against Network-pre.203 ===============
Item was changed:
----- Method: MailAddressParser>>grabName (in category 'parsing') -----
grabName
| name |
name := ''.
[tokens isEmpty not and: [#(Atom QuotedString $. $@) includes: (tokens last type) ]]
whileTrue: [ name := {tokens removeLast text copyWithoutAll: '"'. name} joinSeparatedBy: Character space ].
+ ^ name withBlanksTrimmed!
- ^ name trimBoth!
Patrick Rein uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-pre.203.mcz
==================== Summary ====================
Name: Network-pre.203
Author: pre
Time: 6 September 2017, 7:55:04.916204 pm
UUID: a4494ca0-d9ef-1347-94b6-7719eb9a3e26
Ancestors: Network-tpr.202
Changes the mail address parser to only accept addresses in a valid string of email addresses.
Adds logic to the mail address parser to parse out the names in front of email addresses.
Changes the tokenizer to accept non-ascii characters in email addresses which is allowed since 2012.
=============== Diff against Network-tpr.202 ===============
Item was changed:
Object subclass: #MailAddressParser
+ instanceVariableNames: 'tokens addresses storeNames curAddrTokens'
- instanceVariableNames: 'tokens addresses curAddrTokens'
classVariableNames: ''
poolDictionaries: ''
category: 'Network-RFC822'!
!MailAddressParser commentStamp: '<historical>' prior: 0!
Parse mail addresses. The basic syntax is:
addressList := MailAddressParser addressesIn: aString
This currently only returns the bare addresses, but it could also return a list of the address "source codes". For example, if you give it "Joe <joe@foo>, <jane>", it will currently return a list ('joe@foo' 'jane'). It would be nice to also get a list ('Joe <joe@foo>' '<jane>').!
Item was added:
+ ----- Method: MailAddressParser class>>addressesAndNamePairsIn: (in category 'parsing') -----
+ addressesAndNamePairsIn: aString
+ "return a collection of the addresses and the corresponding names listed in aString"
+ | tokens |
+ tokens := MailAddressTokenizer tokensIn: aString.
+ ^(self new initialize: tokens) grabAddressesAndNames!
Item was changed:
----- Method: MailAddressParser>>grabAddressWithRoute (in category 'parsing') -----
grabAddressWithRoute
"grad an address of the form 'Descriptive Text <real.address(a)c.d.e>"
+ | name |
self startNewAddress.
+
-
tokens removeLast. "remove the >"
"grab until we see a $<"
+ [ tokens isEmpty ifTrue: [self error: '<> are not matched' ].
+ tokens last type = $<]
+ whileFalse: [ self addToAddress ].
- [
- tokens isEmpty ifTrue: [
- self error: '<> are not matched' ].
- tokens last type = $<
- ] whileFalse: [ self addToAddress ].
tokens removeLast. "remove the <"
+ self finishAddress.
+
+ name := self grabName.
+
+ storeNames ifTrue: [addresses addFirst: {name . addresses removeFirst}].!
-
-
- self removePhrase.
-
- self finishAddress!
Item was changed:
----- Method: MailAddressParser>>grabAddresses (in category 'parsing') -----
grabAddresses
+
- "grab all the addresses in the string"
| token |
"remove comments"
tokens removeAllSuchThat: [:t | t type == #Comment].
+
"grab one address or address group each time through this loop"
+ [ [tokens isEmpty not and: [ tokens last type = $, ]]
+ whileTrue: [ tokens removeLast ].
+ tokens isEmpty ] whileFalse: [
+
- [
- "remove commas"
- [
- tokens isEmpty not and: [ tokens last type = $, ]
- ] whileTrue: [ tokens removeLast ].
-
- "check whether any tokens are left"
- tokens isEmpty
- ] whileFalse: [
token := tokens last.
"delegate, depending on what form the address is in"
"the from can be determined from the last token"
+ token type = $>
+ ifTrue: [self grabAddressWithRoute ]
+ ifFalse: [ (#(Atom DomainLiteral QuotedString) includes: token type)
+ ifTrue: [self grabBasicAddress ]
+ ifFalse: [token type = $;
+ ifTrue: [self grabGroupAddress ]
+ ifFalse: [self error: 'un-recognized address format' ]]]].
+ ^ addresses!
- token type = $> ifTrue: [
- self grabAddressWithRoute ]
- ifFalse: [
- (#(Atom DomainLiteral QuotedString) includes: token type) ifTrue: [
- self grabBasicAddress ]
- ifFalse: [
- token type = $; ifTrue: [
- self grabGroupAddress ]
- ifFalse: [
- ^self error: 'un-recognized address format' ] ] ]
- ].
-
- ^addresses!
Item was added:
+ ----- Method: MailAddressParser>>grabAddressesAndNames (in category 'parsing') -----
+ grabAddressesAndNames
+
+ storeNames := true.
+
+ self grabAddresses.
+
+ addresses := addresses collect: [:a |
+ a isString
+ ifTrue: [{'' . a}]
+ ifFalse: [a] ].
+
+ ^ addresses!
Item was changed:
----- Method: MailAddressParser>>grabBasicAddress (in category 'parsing') -----
grabBasicAddress
"grad an address of the form a.b(a)c.d.e"
+ | name |
self startNewAddress.
"grab either the domain if specified, or the domain if not"
self addToAddress.
[tokens isEmpty not and: [ tokens last type = $.] ]
whileTrue:
["add name-dot pairs of tokens"
self addToAddress.
(#(Atom QuotedString ) includes: tokens last type)
ifFalse: [self error: 'bad token in address: ' , tokens last text].
self addToAddress].
(tokens isEmpty or: [tokens last type ~= $@])
ifTrue: ["no domain specified"
self finishAddress]
ifFalse:
["that was the domain. check that no QuotedString's slipped in"
curAddrTokens do: [:tok | tok type = #QuotedString ifTrue: [self error: 'quote marks are not allowed within a domain name (' , tok text , ')']].
"add the @ sign"
self addToAddress.
"add the local part"
(#(Atom QuotedString ) includes: tokens last type)
ifFalse: [self error: 'invalid local part for address: ' , tokens last text].
self addToAddress.
"add word-dot pairs if there are any"
[tokens isEmpty not and: [tokens last type = $.]]
whileTrue:
[self addToAddress.
(tokens isEmpty not and: [#(Atom QuotedString ) includes: tokens last type])
ifTrue: [self addToAddress]].
+ self finishAddress].
+
+ name := self grabName.
+ storeNames ifTrue: [addresses addFirst: {name . addresses removeFirst}].!
- self finishAddress]!
Item was changed:
----- Method: MailAddressParser>>grabGroupAddress (in category 'parsing') -----
grabGroupAddress
"grab an address of the form 'phrase : address, address, ..., address;'"
"I'm not 100% sure what this format means, so I'm just returningthe list of addresses between the : and ; -ls (if this sounds right to someone, feel free to remove this comment :)"
"remove the $; "
tokens removeLast.
"grab one address each time through this loop"
+ [ "remove commas"
+ [tokens isEmpty not and: [ tokens last type = $, ]]
+ whileTrue: [ tokens removeLast ].
- [
- "remove commas"
- [
- tokens isEmpty not and: [ tokens last type = $, ]
- ] whileTrue: [ tokens removeLast ].
+ tokens isEmpty ifTrue: ["no matching :" ^ self error: 'stray ; in address list'].
+ tokens last type = $:]
+ whileFalse: [
+
+ "delegate to either grabAddressWithRoute, or grabBasicAddress. nested groups are not allowed"
+ tokens last type = $>
+ ifTrue: [self grabAddressWithRoute ]
+ ifFalse: [ (#(Atom DomainLiteral QuotedString) includes: tokens last type)
+ ifTrue: [self grabBasicAddress ]
+ ifFalse: [^ self error: 'un-recognized address format' ]]].
- tokens isEmpty ifTrue: [
- "no matching :"
- ^self error: 'stray ; in address list'. ].
- tokens last type = $:
- ] whileFalse: [
- "delegate to either grabAddressWithRoute, or grabBasicAddress. nested groups are not allowed"
-
- tokens last type = $> ifTrue: [
- self grabAddressWithRoute ]
- ifFalse: [
- (#(Atom DomainLiteral QuotedString) includes: tokens last type) ifTrue: [
- self grabBasicAddress ]
- ifFalse: [
- ^self error: 'un-recognized address format' ] ]
- ].
-
tokens removeLast. "remove the :"
self removePhrase.!
Item was added:
+ ----- Method: MailAddressParser>>grabName (in category 'parsing') -----
+ grabName
+
+ | name |
+ name := ''.
+ [tokens isEmpty not and: [#(Atom QuotedString $. $@) includes: (tokens last type) ]]
+ whileTrue: [ name := {tokens removeLast text copyWithoutAll: '"'. name} joinSeparatedBy: Character space ].
+ ^ name trimBoth!
Item was added:
+ ----- Method: MailAddressParser>>initialize (in category 'private-initialization') -----
+ initialize
+
+ storeNames := false.!
Item was changed:
----- Method: MailAddressParser>>removePhrase (in category 'parsing') -----
removePhrase
"skip most characters to the left of this"
+ [tokens isEmpty not and: [#(Atom QuotedString $. $@) includes: (tokens last type)]]
+ whileTrue: [ tokens removeLast ].
- [
- tokens isEmpty not and: [
- #(Atom QuotedString $. $@) includes: (tokens last type) ]
- ] whileTrue: [ tokens removeLast ].
!
Item was changed:
----- Method: MailAddressTokenizer class>>nonAtomSet (in category 'class initialization') -----
nonAtomSet
+ "(from RFC 6531)"
- "(from RFC 2822)"
+ ^CSNonAtom ifNil: [ | notAtoms |
+ notAtoms := CharacterSet new
- ^CSNonAtom ifNil: [
- CSNonAtom := CharacterSet new
addAll: ($A to: $Z);
addAll: ($a to: $z);
addAll: ($0 to: $9);
addAll: '!!#$%&''*+-/=?^_`{|}~';
+ complement.
+ CSNonAtom := Set new.
+ 0 to: 127 do: [:v | | c |
+ c := Character value: v.
+ (notAtoms includes: c) ifTrue: [CSNonAtom add: c]]]!
- complement ]!
Chris Muller uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-cmm.1114.mcz
==================== Summary ====================
Name: Kernel-cmm.1114
Author: cmm
Time: 1 September 2017, 12:24:33.854299 pm
UUID: 0bc56c90-144a-401c-915c-c68060661f03
Ancestors: Kernel-cmm.1113
Revert cmm.1113 due to objections.
=============== Diff against Kernel-cmm.1113 ===============
Item was changed:
----- Method: Object>>pin (in category 'pinning') -----
pin
+ "The VM's garbage collector routinely moves objects as it reclaims and compacts
+ memory. But it can also pin an object so that it will not be moved, which can make
+ it easier to pass objects out through the FFI. Objects are unpinnned when created.
+ This method ensures an object is pinned, and answers whether it was already pinned."
+ ^self setPinned: true!
- "Ensure the receiver is pinned and answer whether it was pinned."
- ^ self pinned: true!
Item was removed:
- ----- Method: Object>>pinned: (in category 'pinning') -----
- pinned: aBoolean
- "The VM's garbage collector routinely moves objects as it reclaims and compacts memory. But it can also pin an object so that it will not be moved, which can make it easier to pass objects out through the FFI. Objects are unpinnned when created.
- Answer whether the receiver was pinned."
- ^ self setPinned: aBoolean!
Item was changed:
----- Method: Object>>setPinned: (in category 'private') -----
setPinned: aBoolean
+ "The VM's garbage collector routinely moves objects as it reclaims and compacts
+ memory. But it can also pin an object so that it will not be moved, which can make
+ it easier to pass objects out through the FFI. Objects are unpinnned when created.
+ This primitive either pins or unpins an object, and answers if it was already pinned."
- "Primitive which pins or unpins the receiver and answers whether it was already pinned."
<primitive: 184 error: ec>
^self primitiveFailed!
Item was changed:
----- Method: Object>>unpin (in category 'pinning') -----
unpin
+ "The VM's garbage collector routinely moves objects as it reclaims and compacts
+ memory. But it can also pin an object so that it will not be moved, which can make
+ it easier to pass objects out through the FFI. Objects are unpinnned when created.
+ This method ensures an object is unpinned, and answers whether it was pinned."
+ ^self setPinned: false!
- "Ensure the receiver is unpinned and answer whether it was pinned."
- ^ self pinned: false!