Nicolas Cellier uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-nice.184.mcz
==================== Summary ====================
Name: CollectionsTests-nice.184
Author: nice
Time: 30 March 2011, 9:57:18.627 pm
UUID: 88386be6-a998-42c7-87c4-efd261e64f02
Ancestors: CollectionsTests-nice.183
Use #newCompiler #newParser
=============== Diff against CollectionsTests-nice.183 ===============
Item was changed:
----- Method: CharacterTest>>testPrintStringAll (in category 'testing-printing') -----
testPrintStringAll
Character allCharacters do: [ :each |
+ self assert: (self class newCompiler
- self assert: (self class compilerClass
evaluate: each printString) = each ].!
Item was changed:
----- Method: CharacterTest>>testStoreStringAll (in category 'testing-printing') -----
testStoreStringAll
Character allCharacters do: [ :each |
+ self assert: (self class newCompiler
- self assert: (self class compilerClass
evaluate: each storeString) = each ].!
Nicolas Cellier uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-nice.184.mcz
==================== Summary ====================
Name: CollectionsTests-nice.184
Author: nice
Time: 30 March 2011, 9:57:18.627 pm
UUID: 88386be6-a998-42c7-87c4-efd261e64f02
Ancestors: CollectionsTests-nice.183
Use #newCompiler #newParser
=============== Diff against CollectionsTests-nice.183 ===============
Item was changed:
----- Method: CharacterTest>>testPrintStringAll (in category 'testing-printing') -----
testPrintStringAll
Character allCharacters do: [ :each |
+ self assert: (self class newCompiler
- self assert: (self class compilerClass
evaluate: each printString) = each ].!
Item was changed:
----- Method: CharacterTest>>testStoreStringAll (in category 'testing-printing') -----
testStoreStringAll
Character allCharacters do: [ :each |
+ self assert: (self class newCompiler
- self assert: (self class compilerClass
evaluate: each storeString) = each ].!
Nicolas Cellier uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-nice.184.mcz
==================== Summary ====================
Name: CollectionsTests-nice.184
Author: nice
Time: 30 March 2011, 9:57:18.627 pm
UUID: 88386be6-a998-42c7-87c4-efd261e64f02
Ancestors: CollectionsTests-nice.183
Use #newCompiler #newParser
=============== Diff against CollectionsTests-nice.183 ===============
Item was changed:
----- Method: CharacterTest>>testPrintStringAll (in category 'testing-printing') -----
testPrintStringAll
Character allCharacters do: [ :each |
+ self assert: (self class newCompiler
- self assert: (self class compilerClass
evaluate: each printString) = each ].!
Item was changed:
----- Method: CharacterTest>>testStoreStringAll (in category 'testing-printing') -----
testStoreStringAll
Character allCharacters do: [ :each |
+ self assert: (self class newCompiler
- self assert: (self class compilerClass
evaluate: each storeString) = each ].!
Nicolas Cellier uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-nice.199.mcz
==================== Summary ====================
Name: Compiler-nice.199
Author: nice
Time: 30 March 2011, 9:56:40.201 pm
UUID: 40f46685-08e8-4661-95bd-8be4327c963b
Ancestors: Compiler-IgorStasenko.198
Use #newCompiler #newParser
Move some #evaluate: methods to instance side to enable (self class newCompiler evaluate: 'nil') usage
=============== Diff against Compiler-IgorStasenko.198 ===============
Item was changed:
----- Method: Compiler class>>new (in category 'accessing') -----
new
+ ^ super new parser: self newParser!
- ^ super new parser: self parserClass new!
Item was added:
+ ----- Method: Compiler>>evaluate: (in category 'public access') -----
+ evaluate: textOrString
+ "See evaluate:for:notifying:logged:. If a compilation error occurs,
+ a Syntax Error view is created rather than notifying any requestor.
+ Compilation is carried out with respect to nil, i.e., no object, and the
+ invocation is not logged."
+
+ ^self evaluate: textOrString for: nil logged: false!
Item was added:
+ ----- Method: Compiler>>evaluate:for:logged: (in category 'public access') -----
+ evaluate: textOrString for: anObject logged: logFlag
+ "See evaluate:for:notifying:logged:. If a compilation error occurs,
+ a Syntax Error view is created rather than notifying any requestor."
+
+ ^self evaluate: textOrString for: anObject notifying: nil logged: logFlag!
Item was added:
+ ----- Method: Compiler>>evaluate:for:notifying:logged: (in category 'public access') -----
+ evaluate: textOrString for: anObject notifying: aController logged: logFlag
+ "Compile and execute the argument, textOrString with respect to the class
+ of anObject. If a compilation error occurs, notify aController. If both
+ compilation and execution are successful then, if logFlag is true, log
+ (write) the text onto a system changes file so that it can be replayed if
+ necessary."
+
+ ^ self
+ evaluate: textOrString
+ in: nil
+ to: anObject
+ notifying: aController
+ ifFail: [^nil]
+ logged: logFlag.!
Item was changed:
----- Method: Compiler>>evaluate:in:to: (in category 'public access') -----
evaluate: aString in: aContext to: aReceiver
"evaluate aString in the given context, and return the result. 2/2/96 sw"
+ ^self
+ evaluate: aString
+ in: aContext
+ to: aReceiver
+ notifying: nil
+ ifFail: [^ #failedDoit]!
- | result |
- result := self
- evaluate: aString
- in: aContext
- to: aReceiver
- notifying: nil
- ifFail: [^ #failedDoit].
- ^ result!
Item was added:
+ ----- Method: Compiler>>evaluate:logged: (in category 'public access') -----
+ evaluate: textOrString logged: logFlag
+ "See evaluate:for:notifying:logged:. If a compilation error occurs,
+ a Syntax Error view is created rather than notifying any requestor.
+ Compilation is carried out with respect to nil, i.e., no object."
+
+ ^self evaluate: textOrString for: nil logged: logFlag!
Item was added:
+ ----- Method: Compiler>>evaluate:notifying:logged: (in category 'public access') -----
+ evaluate: textOrString notifying: aController logged: logFlag
+ "See evaluate:for:notifying:logged:. Compilation is carried out
+ with respect to nil, i.e., no object."
+
+ ^self evaluate: textOrString for: nil notifying: aController logged: logFlag!
Item was changed:
----- Method: Compiler>>parser (in category 'public access') -----
parser
+ parser ifNil: [parser := (class ifNil: [self class]) newParser].
- parser ifNil: [parser := self parserClass new].
^parser!
Item was removed:
- ----- Method: Compiler>>parserClass (in category 'public access') -----
- parserClass
-
- ^parser ifNil: [self class parserClass] ifNotNil: [parser class]!
Item was changed:
----- Method: MethodNode>>blockExtentsToTempsMap (in category 'debugger support') -----
blockExtentsToTempsMap
"Answer a Dictionary of blockExtent to temp locations for the current method.
This is used by the debugger to locate temp vars in contexts. A temp map
entry is a pair of the temp's name and its index, where an index is either an
integer for a normal temp or a pair of the index of the indirect temp vector
containing the temp and the index of the temp in its indirect temp vector."
^encoder blockExtentsToTempsMap ifNil:
[| methNode |
+ methNode := encoder classEncoding newParser
- methNode := encoder classEncoding parserClass new
encoderClass: encoder class;
parse: (sourceText ifNil: [self decompileString])
class: self methodClass.
"As a side effect generate: creates data needed for the map."
methNode generate.
methNode encoder blockExtentsToTempsMap]!
Item was changed:
----- Method: MethodNode>>rawSourceRangesAndMethodDo: (in category 'source mapping') -----
rawSourceRangesAndMethodDo: aBinaryBlock
"Evaluate aBinaryBlock with the rawSourceRanges and method generated from the receiver."
| methNode method |
+ methNode := encoder classEncoding newParser
- methNode := encoder classEncoding parserClass new
encoderClass: encoder class;
parse: (sourceText "If no source, use decompile string as source to map from"
ifNil: [self decompileString]
ifNotNil: [sourceText])
class: self methodClass.
method := methNode generate. "set bytecodes to map to"
^aBinaryBlock
value: methNode encoder rawSourceRanges
value: method!
Nicolas Cellier uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-nice.199.mcz
==================== Summary ====================
Name: Compiler-nice.199
Author: nice
Time: 30 March 2011, 9:56:40.201 pm
UUID: 40f46685-08e8-4661-95bd-8be4327c963b
Ancestors: Compiler-IgorStasenko.198
Use #newCompiler #newParser
Move some #evaluate: methods to instance side to enable (self class newCompiler evaluate: 'nil') usage
=============== Diff against Compiler-IgorStasenko.198 ===============
Item was changed:
----- Method: Compiler class>>new (in category 'accessing') -----
new
+ ^ super new parser: self newParser!
- ^ super new parser: self parserClass new!
Item was added:
+ ----- Method: Compiler>>evaluate: (in category 'public access') -----
+ evaluate: textOrString
+ "See evaluate:for:notifying:logged:. If a compilation error occurs,
+ a Syntax Error view is created rather than notifying any requestor.
+ Compilation is carried out with respect to nil, i.e., no object, and the
+ invocation is not logged."
+
+ ^self evaluate: textOrString for: nil logged: false!
Item was added:
+ ----- Method: Compiler>>evaluate:for:logged: (in category 'public access') -----
+ evaluate: textOrString for: anObject logged: logFlag
+ "See evaluate:for:notifying:logged:. If a compilation error occurs,
+ a Syntax Error view is created rather than notifying any requestor."
+
+ ^self evaluate: textOrString for: anObject notifying: nil logged: logFlag!
Item was added:
+ ----- Method: Compiler>>evaluate:for:notifying:logged: (in category 'public access') -----
+ evaluate: textOrString for: anObject notifying: aController logged: logFlag
+ "Compile and execute the argument, textOrString with respect to the class
+ of anObject. If a compilation error occurs, notify aController. If both
+ compilation and execution are successful then, if logFlag is true, log
+ (write) the text onto a system changes file so that it can be replayed if
+ necessary."
+
+ ^ self
+ evaluate: textOrString
+ in: nil
+ to: anObject
+ notifying: aController
+ ifFail: [^nil]
+ logged: logFlag.!
Item was changed:
----- Method: Compiler>>evaluate:in:to: (in category 'public access') -----
evaluate: aString in: aContext to: aReceiver
"evaluate aString in the given context, and return the result. 2/2/96 sw"
+ ^self
+ evaluate: aString
+ in: aContext
+ to: aReceiver
+ notifying: nil
+ ifFail: [^ #failedDoit]!
- | result |
- result := self
- evaluate: aString
- in: aContext
- to: aReceiver
- notifying: nil
- ifFail: [^ #failedDoit].
- ^ result!
Item was added:
+ ----- Method: Compiler>>evaluate:logged: (in category 'public access') -----
+ evaluate: textOrString logged: logFlag
+ "See evaluate:for:notifying:logged:. If a compilation error occurs,
+ a Syntax Error view is created rather than notifying any requestor.
+ Compilation is carried out with respect to nil, i.e., no object."
+
+ ^self evaluate: textOrString for: nil logged: logFlag!
Item was added:
+ ----- Method: Compiler>>evaluate:notifying:logged: (in category 'public access') -----
+ evaluate: textOrString notifying: aController logged: logFlag
+ "See evaluate:for:notifying:logged:. Compilation is carried out
+ with respect to nil, i.e., no object."
+
+ ^self evaluate: textOrString for: nil notifying: aController logged: logFlag!
Item was changed:
----- Method: Compiler>>parser (in category 'public access') -----
parser
+ parser ifNil: [parser := (class ifNil: [self class]) newParser].
- parser ifNil: [parser := self parserClass new].
^parser!
Item was removed:
- ----- Method: Compiler>>parserClass (in category 'public access') -----
- parserClass
-
- ^parser ifNil: [self class parserClass] ifNotNil: [parser class]!
Item was changed:
----- Method: MethodNode>>blockExtentsToTempsMap (in category 'debugger support') -----
blockExtentsToTempsMap
"Answer a Dictionary of blockExtent to temp locations for the current method.
This is used by the debugger to locate temp vars in contexts. A temp map
entry is a pair of the temp's name and its index, where an index is either an
integer for a normal temp or a pair of the index of the indirect temp vector
containing the temp and the index of the temp in its indirect temp vector."
^encoder blockExtentsToTempsMap ifNil:
[| methNode |
+ methNode := encoder classEncoding newParser
- methNode := encoder classEncoding parserClass new
encoderClass: encoder class;
parse: (sourceText ifNil: [self decompileString])
class: self methodClass.
"As a side effect generate: creates data needed for the map."
methNode generate.
methNode encoder blockExtentsToTempsMap]!
Item was changed:
----- Method: MethodNode>>rawSourceRangesAndMethodDo: (in category 'source mapping') -----
rawSourceRangesAndMethodDo: aBinaryBlock
"Evaluate aBinaryBlock with the rawSourceRanges and method generated from the receiver."
| methNode method |
+ methNode := encoder classEncoding newParser
- methNode := encoder classEncoding parserClass new
encoderClass: encoder class;
parse: (sourceText "If no source, use decompile string as source to map from"
ifNil: [self decompileString]
ifNotNil: [sourceText])
class: self methodClass.
method := methNode generate. "set bytecodes to map to"
^aBinaryBlock
value: methNode encoder rawSourceRanges
value: method!
Nicolas Cellier uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-nice.199.mcz
==================== Summary ====================
Name: Compiler-nice.199
Author: nice
Time: 30 March 2011, 9:56:40.201 pm
UUID: 40f46685-08e8-4661-95bd-8be4327c963b
Ancestors: Compiler-IgorStasenko.198
Use #newCompiler #newParser
Move some #evaluate: methods to instance side to enable (self class newCompiler evaluate: 'nil') usage
=============== Diff against Compiler-IgorStasenko.198 ===============
Item was changed:
----- Method: Compiler class>>new (in category 'accessing') -----
new
+ ^ super new parser: self newParser!
- ^ super new parser: self parserClass new!
Item was added:
+ ----- Method: Compiler>>evaluate: (in category 'public access') -----
+ evaluate: textOrString
+ "See evaluate:for:notifying:logged:. If a compilation error occurs,
+ a Syntax Error view is created rather than notifying any requestor.
+ Compilation is carried out with respect to nil, i.e., no object, and the
+ invocation is not logged."
+
+ ^self evaluate: textOrString for: nil logged: false!
Item was added:
+ ----- Method: Compiler>>evaluate:for:logged: (in category 'public access') -----
+ evaluate: textOrString for: anObject logged: logFlag
+ "See evaluate:for:notifying:logged:. If a compilation error occurs,
+ a Syntax Error view is created rather than notifying any requestor."
+
+ ^self evaluate: textOrString for: anObject notifying: nil logged: logFlag!
Item was added:
+ ----- Method: Compiler>>evaluate:for:notifying:logged: (in category 'public access') -----
+ evaluate: textOrString for: anObject notifying: aController logged: logFlag
+ "Compile and execute the argument, textOrString with respect to the class
+ of anObject. If a compilation error occurs, notify aController. If both
+ compilation and execution are successful then, if logFlag is true, log
+ (write) the text onto a system changes file so that it can be replayed if
+ necessary."
+
+ ^ self
+ evaluate: textOrString
+ in: nil
+ to: anObject
+ notifying: aController
+ ifFail: [^nil]
+ logged: logFlag.!
Item was changed:
----- Method: Compiler>>evaluate:in:to: (in category 'public access') -----
evaluate: aString in: aContext to: aReceiver
"evaluate aString in the given context, and return the result. 2/2/96 sw"
+ ^self
+ evaluate: aString
+ in: aContext
+ to: aReceiver
+ notifying: nil
+ ifFail: [^ #failedDoit]!
- | result |
- result := self
- evaluate: aString
- in: aContext
- to: aReceiver
- notifying: nil
- ifFail: [^ #failedDoit].
- ^ result!
Item was added:
+ ----- Method: Compiler>>evaluate:logged: (in category 'public access') -----
+ evaluate: textOrString logged: logFlag
+ "See evaluate:for:notifying:logged:. If a compilation error occurs,
+ a Syntax Error view is created rather than notifying any requestor.
+ Compilation is carried out with respect to nil, i.e., no object."
+
+ ^self evaluate: textOrString for: nil logged: logFlag!
Item was added:
+ ----- Method: Compiler>>evaluate:notifying:logged: (in category 'public access') -----
+ evaluate: textOrString notifying: aController logged: logFlag
+ "See evaluate:for:notifying:logged:. Compilation is carried out
+ with respect to nil, i.e., no object."
+
+ ^self evaluate: textOrString for: nil notifying: aController logged: logFlag!
Item was changed:
----- Method: Compiler>>parser (in category 'public access') -----
parser
+ parser ifNil: [parser := (class ifNil: [self class]) newParser].
- parser ifNil: [parser := self parserClass new].
^parser!
Item was removed:
- ----- Method: Compiler>>parserClass (in category 'public access') -----
- parserClass
-
- ^parser ifNil: [self class parserClass] ifNotNil: [parser class]!
Item was changed:
----- Method: MethodNode>>blockExtentsToTempsMap (in category 'debugger support') -----
blockExtentsToTempsMap
"Answer a Dictionary of blockExtent to temp locations for the current method.
This is used by the debugger to locate temp vars in contexts. A temp map
entry is a pair of the temp's name and its index, where an index is either an
integer for a normal temp or a pair of the index of the indirect temp vector
containing the temp and the index of the temp in its indirect temp vector."
^encoder blockExtentsToTempsMap ifNil:
[| methNode |
+ methNode := encoder classEncoding newParser
- methNode := encoder classEncoding parserClass new
encoderClass: encoder class;
parse: (sourceText ifNil: [self decompileString])
class: self methodClass.
"As a side effect generate: creates data needed for the map."
methNode generate.
methNode encoder blockExtentsToTempsMap]!
Item was changed:
----- Method: MethodNode>>rawSourceRangesAndMethodDo: (in category 'source mapping') -----
rawSourceRangesAndMethodDo: aBinaryBlock
"Evaluate aBinaryBlock with the rawSourceRanges and method generated from the receiver."
| methNode method |
+ methNode := encoder classEncoding newParser
- methNode := encoder classEncoding parserClass new
encoderClass: encoder class;
parse: (sourceText "If no source, use decompile string as source to map from"
ifNil: [self decompileString]
ifNotNil: [sourceText])
class: self methodClass.
method := methNode generate. "set bytecodes to map to"
^aBinaryBlock
value: methNode encoder rawSourceRanges
value: method!
Nicolas Cellier uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-nice.435.mcz
==================== Summary ====================
Name: Collections-nice.435
Author: nice
Time: 30 March 2011, 9:50:07.129 pm
UUID: f53b9d14-89c3-4105-8e0b-41cd10076918
Ancestors: Collections-nice.434
Use #newCompiler #newParser
=============== Diff against Collections-nice.434 ===============
Item was changed:
----- Method: Text>>makeSelectorBold (in category 'emphasis') -----
makeSelectorBold
"For formatting Smalltalk source code, set the emphasis of that portion of
the receiver's string that parses as a message selector to be bold."
| parser i |
string size = 0 ifTrue: [^ self].
i := 0.
[(string at: (i := i + 1)) isSeparator] whileTrue.
(string at: i) = $[ ifTrue: [^ self]. "block, no selector"
+ [(parser := Compiler newParser) parseSelector: string] on: Error do: [^ self].
- [(parser := Compiler parserClass new) parseSelector: string] on: Error do: [^ self].
self makeBoldFrom: 1 to: (parser endOfLastToken min: string size)!
Item was changed:
----- Method: Text>>makeSelectorBoldIn: (in category 'emphasis') -----
makeSelectorBoldIn: aClass
"For formatting Smalltalk source code, set the emphasis of that portion of
the receiver's string that parses as a message selector to be bold."
| parser |
string size = 0 ifTrue: [^self].
+ (parser := aClass newParser) parseSelector: string.
- (parser := aClass parserClass new) parseSelector: string.
self makeBoldFrom: 1 to: (parser endOfLastToken min: string size)!
Nicolas Cellier uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-nice.435.mcz
==================== Summary ====================
Name: Collections-nice.435
Author: nice
Time: 30 March 2011, 9:50:07.129 pm
UUID: f53b9d14-89c3-4105-8e0b-41cd10076918
Ancestors: Collections-nice.434
Use #newCompiler #newParser
=============== Diff against Collections-nice.434 ===============
Item was changed:
----- Method: Text>>makeSelectorBold (in category 'emphasis') -----
makeSelectorBold
"For formatting Smalltalk source code, set the emphasis of that portion of
the receiver's string that parses as a message selector to be bold."
| parser i |
string size = 0 ifTrue: [^ self].
i := 0.
[(string at: (i := i + 1)) isSeparator] whileTrue.
(string at: i) = $[ ifTrue: [^ self]. "block, no selector"
+ [(parser := Compiler newParser) parseSelector: string] on: Error do: [^ self].
- [(parser := Compiler parserClass new) parseSelector: string] on: Error do: [^ self].
self makeBoldFrom: 1 to: (parser endOfLastToken min: string size)!
Item was changed:
----- Method: Text>>makeSelectorBoldIn: (in category 'emphasis') -----
makeSelectorBoldIn: aClass
"For formatting Smalltalk source code, set the emphasis of that portion of
the receiver's string that parses as a message selector to be bold."
| parser |
string size = 0 ifTrue: [^self].
+ (parser := aClass newParser) parseSelector: string.
- (parser := aClass parserClass new) parseSelector: string.
self makeBoldFrom: 1 to: (parser endOfLastToken min: string size)!
Nicolas Cellier uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-nice.435.mcz
==================== Summary ====================
Name: Collections-nice.435
Author: nice
Time: 30 March 2011, 9:50:07.129 pm
UUID: f53b9d14-89c3-4105-8e0b-41cd10076918
Ancestors: Collections-nice.434
Use #newCompiler #newParser
=============== Diff against Collections-nice.434 ===============
Item was changed:
----- Method: Text>>makeSelectorBold (in category 'emphasis') -----
makeSelectorBold
"For formatting Smalltalk source code, set the emphasis of that portion of
the receiver's string that parses as a message selector to be bold."
| parser i |
string size = 0 ifTrue: [^ self].
i := 0.
[(string at: (i := i + 1)) isSeparator] whileTrue.
(string at: i) = $[ ifTrue: [^ self]. "block, no selector"
+ [(parser := Compiler newParser) parseSelector: string] on: Error do: [^ self].
- [(parser := Compiler parserClass new) parseSelector: string] on: Error do: [^ self].
self makeBoldFrom: 1 to: (parser endOfLastToken min: string size)!
Item was changed:
----- Method: Text>>makeSelectorBoldIn: (in category 'emphasis') -----
makeSelectorBoldIn: aClass
"For formatting Smalltalk source code, set the emphasis of that portion of
the receiver's string that parses as a message selector to be bold."
| parser |
string size = 0 ifTrue: [^self].
+ (parser := aClass newParser) parseSelector: string.
- (parser := aClass parserClass new) parseSelector: string.
self makeBoldFrom: 1 to: (parser endOfLastToken min: string size)!