The Inbox: Compiler-ct.417.mcz

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

The Inbox: Compiler-ct.417.mcz

commits-2
Christoph Thiede uploaded a new version of Compiler to project The Inbox:
http://source.squeak.org/inbox/Compiler-ct.417.mcz

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

Name: Compiler-ct.417
Author: ct
Time: 10 February 2020, 11:36:15.173089 pm
UUID: 23da6fd2-74ea-754c-a5af-dfde3933305e
Ancestors: Compiler-eem.416

Strengthens syntax checking for vertical bar after block arguments.

See also the discussion in http://forum.world.st/The-Inbox-ShoutCore-ct-69-mcz-td5102398.html.

=============== Diff against Compiler-eem.416 ===============

Item was changed:
  ----- Method: Parser>>blockExpression (in category 'expression types') -----
  blockExpression
  "[ ({:var} |) (| {temps} |) (statements) ] => BlockNode."
 
  | blockNode variableNodes temporaryBlockVariables start |
  blockNode := BlockNode new.
  variableNodes := OrderedCollection new.
  start := prevMark + requestorOffset.
  "Gather parameters."
  [self match: #colon] whileTrue:
  [variableNodes addLast: (encoder bindBlockArg: self argumentName within: blockNode)].
+ (variableNodes notEmpty and: [(self match: #verticalBar) not]) ifTrue:
- (variableNodes size > 0 & (hereType ~~ #rightBracket) and: [(self match: #verticalBar) not]) ifTrue:
  [^self expected: 'Vertical bar'].
 
  temporaryBlockVariables := self temporaryBlockVariablesFor: blockNode.
  self statements: variableNodes innerBlock: true blockNode: blockNode.
  blockNode temporaries: temporaryBlockVariables.
 
  (self match: #rightBracket) ifFalse: [^self expected: 'Period or right bracket'].
 
  blockNode noteSourceRangeStart: start end: self endOfLastToken encoder: encoder.
 
  "The scope of the parameters and temporary block variables is no longer active."
  temporaryBlockVariables do: [:variable | variable scope: -1].
  variableNodes do: [:variable | variable scope: -1]!