Eliot Miranda uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-eem.388.mcz ==================== Summary ==================== Name: Compiler-eem.388 Author: eem Time: 30 June 2018, 9:39:44.257778 am UUID: 656179c4-4227-43e5-91f5-b10d57129aba Ancestors: Compiler-eem.387 Initialize the temp for ThisContext (the argument to DoItIn: in the context inspector in the debugger) correctly, avoiding a spurious undefined warning and consequent reselection. Fix typedScan:do: sio that character literals are scanned (and hence that e.g. local senders of... $A et al work properly). =============== Diff against Compiler-eem.387 =============== Item was changed: ----- Method: Encoder>>init:notifying: (in category 'initialize-release') ----- init: aCue notifying: anObject "The use of the variable requestor is a bit confusing here. This is *not* the original requestor, which is available through the cue. It's the Parser instance that is using the encoder." self setCue: aCue. requestor := anObject. nTemps := 0. supered := false. self initScopeAndLiteralTables. cue getClass variablesAndOffsetsDo: [:variable "<String|CFieldDefinition>" :offset "<Integer|nil>" | offset isNil ifTrue: [scopeTable at: variable name put: (FieldNode new fieldDefinition: variable)] ifFalse: [scopeTable at: variable put: (offset >= 0 ifTrue: [InstanceVariableNode new name: variable index: offset] ifFalse: [MaybeContextInstanceVariableNode new name: variable index: offset negated])]]. + cue context ifNotNil: - cue context ~~ nil ifTrue: [| homeNode | + homeNode := self bindArg: self doItInContextName. - homeNode := self bindTemp: self doItInContextName. "0th temp = aContext passed as arg" cue context tempNames withIndexDo: [:variable :index| variable ~= self doItInContextName ifTrue: [scopeTable at: variable put: (MessageAsTempNode new receiver: homeNode selector: #namedTempAt: arguments: (Array with: (self encodeLiteral: index)) precedence: 3 from: self)]]]. sourceRanges := Dictionary new: 32. + globalSourceRanges := OrderedCollection new: 32! - globalSourceRanges := OrderedCollection new: 32 - ! Item was changed: ----- Method: Scanner>>typedScan:do: (in category 'public access') ----- typedScan: textOrString do: aBinaryBlock "Evaluate aBinaryBlock with the token and its type for the first token in input, mapping literals to type #literal and anything else to type #word." | theTokensType atNumber theToken | self initScannerForTokenization. self scan: (ReadStream on: textOrString asString). atNumber := hereChar notNil and: [hereChar isDigit]. theTokensType := tokenType. theToken := self advance. (theToken == #- and: [atNumber and: [token isNumber]]) ifTrue: [theToken := self advance negated]. theToken isNumber ifTrue: [theTokensType := #number]. ^aBinaryBlock value: theToken + value: ((#(number string literal character) includes: theTokensType) - value: ((#(number string literal) includes: theTokensType) ifTrue: [#literal] ifFalse: [#word])! |
Free forum by Nabble | Edit this page |