Skip to content

Commit

Permalink
Remove some dead compiler code.
Browse files Browse the repository at this point in the history
  • Loading branch information
rmacnak committed Apr 20, 2024
1 parent aa94435 commit e7f0b62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 44 deletions.
6 changes: 3 additions & 3 deletions newspeak/Mirrors.ns
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ private computeDebugInfo = (
definingMixin _nestedMixins do:
[:nestedMixin | nestedMixin _name = rawMethod selector ifTrue:
[^(compiler
compileClassHeader2: nestedMixin _headerSource
compileClassHeader: nestedMixin _headerSource
within: (mxn: definingMixin)) accessor debugInfo]].
(* Instance initializer *)
(isSubinitializerSelector: rawMethod selector) ifTrue:
[^(compiler
compileClassHeader2: rawMethod mixin _headerSource
compileClassHeader: rawMethod mixin _headerSource
within: (mxn: definingMixin _enclosingMixin)) initializers first debugInfo].
(* Transient slot getter / setter / initializer *)
definingMixin _slots do:
Expand Down Expand Up @@ -109,7 +109,7 @@ private computeDebugInfo = (
definingMixin isMeta ifTrue:
[definingMixin _instanceMixin _primaryFactorySelector = rawMethod selector ifTrue:
[^(compiler
compileClassHeader2: definingMixin _instanceMixin _headerSource
compileClassHeader: definingMixin _instanceMixin _headerSource
within: (mxn: definingMixin _enclosingMixin)) factory debugInfo]].

panic.
Expand Down
42 changes: 1 addition & 41 deletions newspeak/Newspeak2PrimordialSoupCompilation.ns
Original file line number Diff line number Diff line change
Expand Up @@ -2058,24 +2058,6 @@ private compileClass: node <ClassDeclarationAST> ^<IntermediateClassDeclaration>

^classDecl
)
public compileClassHeader2: src <String> within: enclosing <InstanceMixin> ^<IntermediateClassDeclaration> = (
| tree <ClassDeclarationAST> intermediate <IntermediateClassDeclaration> |

currentSource:: src.
currentScope:: Scope new.
currentDepth:: 0.

nil = enclosing ifFalse: [buildIncrementalScopeFor: enclosing].
tree:: parseClassDeclaration: src , '()'.

toScope: currentScope addClass: tree.

nil = enclosing
ifTrue: [intermediate:: compileClass: tree]
ifFalse: [intermediate:: within: enclosing compileClassNoAdd: tree].

^intermediate
)
public compileClassHeader: source <String> within: enclosingIR <IntermediateMixin> = (
^compileClassSource: (source, '()') within: enclosingIR
)
Expand All @@ -2086,7 +2068,7 @@ public compileClassSource: src <String> within: enclosingIR <IntermediateMixin>
currentScope:: Scope new.
currentDepth:: 0.

nil = enclosingIR ifFalse: [buildIncrementalScopeFor: enclosingIR builder].
nil = enclosingIR ifFalse: [buildIncrementalScopeFor: enclosingIR].
tree:: parseClassDeclaration: src.

toScope: currentScope addClass: tree.
Expand Down Expand Up @@ -2471,28 +2453,6 @@ selfNode ^<VariableAST> = (
sourceForNode: node <AST> ^ <String> = (
^currentSource copyFrom: node start to: node end
)
superConstructorCallFor: aNode <ClassHeaderAST> ^<NormalSendAST> = (
(* create call to super constructor method *)
|
var <VariableAST>
send <NormalSendAST>
start <Integer>
end <Integer>
superMsg <MessageAST>
args <List[VariableAST]>
|

start:: aNode superConstructorCall start.
end:: aNode superConstructorCall end.
var:: VariableAST new name: #self; start: start; end: end.
args:: aNode constructor parameters collect:
[:p <VarDeclAST> | hereSendFrom: p].
superMsg:: MessageAST new
send: (superConstructorNameFor: aNode) with: args;
start: start; end: end.
send:: UnresolvedSendAST new to: var send: superMsg; start: start; end: end.
^send
)
superConstructorNameFor: aNode <ClassHeaderAST> ^ <Symbol> = (
^(aNode name, '`superInit`', aNode constructor selector) asSymbol
)
Expand Down

0 comments on commit e7f0b62

Please sign in to comment.