The Trunk: Compiler-nice.127.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-nice.127.mcz

commits-2
Nicolas Cellier uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-nice.127.mcz

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

Name: Compiler-nice.127
Author: nice
Time: 25 February 2010, 3:33:15.468 am
UUID: 5f00acd4-a5a9-d94a-9406-74281252e74f
Ancestors: Compiler-nice.126

Let this one raise a SyntaxError thanks to earlier encoder initialization:
Compiler evaluate: '0r0 + 1'

=============== Diff against Compiler-nice.126 ===============

Item was changed:
  ----- Method: Parser>>parse:class:category:noPattern:context:notifying:ifFail: (in category 'public access') -----
  parse: sourceStream class: class category: aCategory noPattern: noPattern context: ctxt notifying: req ifFail: aBlock
  "Answer a MethodNode for the argument, sourceStream, that is the root of
  a parse tree. Parsing is done with respect to the argument, class, to find
  instance, class, and pool variables; and with respect to the argument,
  ctxt, to find temporary variables. Errors in parsing are reported to the
  argument, req, if not nil; 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 |
  category := aCategory.
  myStream := sourceStream.
  [repeatNeeded := false.
  p := myStream position.
  s := myStream upToEnd.
  myStream position: p.
+ self encoder init: class context: ctxt notifying: self.
  self init: myStream notifying: req failBlock: [^ aBlock value].
  doitFlag := noPattern.
  failBlock:= aBlock.
  [methNode := self
  method: noPattern
  context: ctxt
+ encoder: self encoder]
- encoder: (self encoder init: class context: ctxt notifying: self)]
  on: ReparseAfterSourceEditing
  do: [ :ex |
  repeatNeeded := true.
  myStream := ReadStream on: requestor text string].
  repeatNeeded] whileTrue:
  [encoder := self encoder class new].
  methNode sourceText: s.
  ^methNode
  !