The Trunk: Compiler-ct.404.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Compiler-ct.404.mcz

commits-2
Marcel Taeumel uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-ct.404.mcz

==================== Summary ====================

Name: Compiler-ct.404
Author: ct
Time: 17 June 2019, 10:51:02.869037 pm
UUID: 19e019f5-3ff6-0143-926d-e29c155cc4be
Ancestors: Compiler-eem.403

Fix a defect in Parser>>#parseCue:noPattern:ifFail:

Full failure case description:

Run the following statement:
        Compiler evaluate: ''''''''
In the appearing error window, enter any valid smalltalk expression and save it. Before loading this commit, it will give you a NonBooleanError as doItFlag was set too late (and so was not passed to SyntaxErrorNotification).

=============== Diff against Compiler-eem.403 ===============

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. 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 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)].
 
- doitFlag := noPattern.
  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
  !