[squeak-dev] The Trunk: Compiler-eem.446.mcz
commits at source.squeak.org
commits at source.squeak.org
Fri Oct 9 18:54:53 UTC 2020
Eliot Miranda uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-eem.446.mcz
==================== Summary ====================
Name: Compiler-eem.446
Author: eem
Time: 9 October 2020, 11:54:51.071572 am
UUID: 6f9f349c-5461-45b5-a707-6150decce9ef
Ancestors: Compiler-eem.445
Have Parser pay attention to encoderClass if stored in a cue.
=============== Diff against Compiler-eem.445 ===============
Item was changed:
+ ----- Method: Parser>>encoder (in category 'private') -----
- ----- Method: Parser>>encoder (in category 'public access') -----
encoder
^encoder ifNil:
[encoder := CompiledMethod preferredBytecodeSetEncoderClass new]!
Item was added:
+ ----- Method: Parser>>encoderFromCue: (in category 'private') -----
+ encoderFromCue: aCompilationCue
+ ^encoder ifNil:
+ [encoder := (aCompilationCue encoderClass ifNil: [CompiledMethod preferredBytecodeSetEncoderClass]) new]!
Item was changed:
----- Method: Parser>>parseCue:noPattern:ifFail: (in category 'public access') -----
parseCue: aCue noPattern: noPattern ifFail: aBlock
+ "Answer a MethodNode for the argument, sourceStream, that is the root
+ of a parse tree. Parsing is done with respect to the CompilationCue to
+ resolve variables, etc. Errors in parsing are reported to the cue's requestor;
- "Answer a MethodNode for the argument, sourceStream, that is the root of
- a parse tree. Parsing is done with respect to the CompilationCue to
- resolve variables. Errors in parsing are reported to the cue's requestor;
otherwise aBlock is evaluated. The argument noPattern is a Boolean that is
true if the the sourceStream does not contain a method header (i.e., for DoIts)."
| methNode repeatNeeded myStream s p subSelection |
myStream := aCue sourceStream.
[repeatNeeded := false.
p := myStream position.
s := myStream upToEnd.
myStream position: p.
+
-
doitFlag := noPattern.
+ [(self encoderFromCue: aCue) init: aCue notifying: self.
+ self init: myStream cue: aCue failBlock: [^aBlock value].
+
- [self encoder init: aCue notifying: self.
- self init: myStream cue: aCue failBlock: [^ aBlock value].
-
subSelection := self interactive and: [cue requestor selectionInterval = (p + 1 to: p + s size)].
failBlock:= aBlock.
methNode := self method: noPattern context: cue context]
on: ReparseAfterSourceEditing
do: [ :ex |
repeatNeeded := true.
properties := nil. "Avoid accumulating pragmas and primitives Number"
myStream := ex newSource
ifNil: [subSelection
ifTrue:
[ReadStream
on: cue requestor text string
from: cue requestor selectionInterval first
to: cue requestor selectionInterval last]
ifFalse:
[ReadStream on: cue requestor text string]]
ifNotNil: [:src | myStream := src readStream]].
repeatNeeded] whileTrue:
[encoder := self encoder class new].
methNode sourceText: s.
+ ^methNode!
- ^methNode
- !
More information about the Squeak-dev
mailing list
|