JavaScriptInnerFunctionNode.st
author Claus Gittinger <cg@exept.de>
Fri, 21 Feb 2020 20:48:14 +0100
changeset 1231 b7d945ef967a
parent 1063 de2e048f6289
permissions -rw-r--r--
#REFACTORING by exept class: JavaScriptParser changed: #forStatement class: JavaScriptParser class added: #forOfAllowed comment/format in: #forInAllowed
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1063
de2e048f6289 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
     1
"{ Encoding: utf8 }"
de2e048f6289 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
     2
155
8941ab2fe811 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 133
diff changeset
     3
"
8941ab2fe811 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 133
diff changeset
     4
 COPYRIGHT (c) 2005 by eXept Software AG
8941ab2fe811 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 133
diff changeset
     5
              All Rights Reserved
8941ab2fe811 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 133
diff changeset
     6
8941ab2fe811 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 133
diff changeset
     7
 This software is furnished under a license and may be used
8941ab2fe811 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 133
diff changeset
     8
 only in accordance with the terms of that license and with the
8941ab2fe811 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 133
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
8941ab2fe811 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 133
diff changeset
    10
 be provided or otherwise made available to, or used by, any
8941ab2fe811 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 133
diff changeset
    11
 other person.  No title to or ownership of the software is
8941ab2fe811 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 133
diff changeset
    12
 hereby transferred.
8941ab2fe811 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 133
diff changeset
    13
"
123
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
"{ Package: 'stx:libjavascript' }"
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
848
239f8d260f0e class: JavaScriptInnerFunctionNode
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
    16
"{ NameSpace: Smalltalk }"
239f8d260f0e class: JavaScriptInnerFunctionNode
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
    17
123
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
JavaScriptFunctionNode subclass:#JavaScriptInnerFunctionNode
133
097c71ec28c9 inner function calling
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
    19
	instanceVariableNames:'indexOfFirstTemp'
123
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	classVariableNames:''
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
	poolDictionaries:''
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
	category:'Languages-JavaScript-Compiling & Parsing'
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
155
8941ab2fe811 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 133
diff changeset
    25
!JavaScriptInnerFunctionNode class methodsFor:'documentation'!
8941ab2fe811 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 133
diff changeset
    26
8941ab2fe811 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 133
diff changeset
    27
copyright
8941ab2fe811 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 133
diff changeset
    28
"
8941ab2fe811 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 133
diff changeset
    29
 COPYRIGHT (c) 2005 by eXept Software AG
8941ab2fe811 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 133
diff changeset
    30
              All Rights Reserved
8941ab2fe811 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 133
diff changeset
    31
8941ab2fe811 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 133
diff changeset
    32
 This software is furnished under a license and may be used
8941ab2fe811 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 133
diff changeset
    33
 only in accordance with the terms of that license and with the
8941ab2fe811 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 133
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
8941ab2fe811 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 133
diff changeset
    35
 be provided or otherwise made available to, or used by, any
8941ab2fe811 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 133
diff changeset
    36
 other person.  No title to or ownership of the software is
8941ab2fe811 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 133
diff changeset
    37
 hereby transferred.
8941ab2fe811 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 133
diff changeset
    38
"
8941ab2fe811 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 133
diff changeset
    39
! !
123
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
!JavaScriptInnerFunctionNode methodsFor:'accessing'!
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
blockArgAccessed:aBoolean
1063
de2e048f6289 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
    44
    "set/clear the flag stating if any block (=function) argument is accessed in the function"
de2e048f6289 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
    45
de2e048f6289 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
    46
    "/ ignore here
de2e048f6289 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
    47
de2e048f6289 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
    48
    "Modified (comment): / 14-02-2019 / 11:08:06 / Claus Gittinger"
123
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
!
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
133
097c71ec28c9 inner function calling
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
    51
home:anEnvironment
097c71ec28c9 inner function calling
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
    52
    environment := anEnvironment
097c71ec28c9 inner function calling
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
    53
!
097c71ec28c9 inner function calling
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
    54
097c71ec28c9 inner function calling
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
    55
indexOfFirstTemp
596
0efa73ee44b0 JavaScript
Claus Gittinger <cg@exept.de>
parents: 465
diff changeset
    56
    indexOfFirstTemp isNil ifTrue:[ ^ self numVars ].
133
097c71ec28c9 inner function calling
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
    57
    ^ indexOfFirstTemp
097c71ec28c9 inner function calling
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
    58
!
097c71ec28c9 inner function calling
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
    59
097c71ec28c9 inner function calling
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
    60
indexOfFirstTemp:index
097c71ec28c9 inner function calling
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
    61
    indexOfFirstTemp := index
123
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
! !
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
!JavaScriptInnerFunctionNode methodsFor:'code generation'!
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
codeOn:aStream inBlock:b for:aCompiler
131
bb82bf09b928 oops - return is a local return
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
    67
    "this generates a block for the inner function;
bb82bf09b928 oops - return is a local return
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
    68
     Difference from block:
bb82bf09b928 oops - return is a local return
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
    69
        return is a local return;
bb82bf09b928 oops - return is a local return
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
    70
        if return is missing, retval is nil"
123
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
    |pos thisStatement nextStatement lastStatement code
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
     maxNumTemp|
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
    maxNumTemp := 10.
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
637
bfb2c2642b7b class: JavaScriptInnerFunctionNode
Stefan Vogel <sv@exept.de>
parents: 596
diff changeset
    77
    pos := aStream position + 1.
123
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
    aStream nextPut:#makeBlock.                                 "+0"
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
    aStream nextPut:0.                                          "+1"
596
0efa73ee44b0 JavaScript
Claus Gittinger <cg@exept.de>
parents: 465
diff changeset
    81
    aStream nextPut:(self numVars + maxNumTemp).                 "+2"
123
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
    aStream nextPut:(arguments size).                           "+3"
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
596
0efa73ee44b0 JavaScript
Claus Gittinger <cg@exept.de>
parents: 465
diff changeset
    84
    self codeVariableSetupOn:aStream for:self.
0efa73ee44b0 JavaScript
Claus Gittinger <cg@exept.de>
parents: 465
diff changeset
    85
123
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
    statements isEmptyOrNil ifTrue:[
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
        aStream nextPut:#retNil.
131
bb82bf09b928 oops - return is a local return
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
    88
    ] ifFalse:[
bb82bf09b928 oops - return is a local return
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
    89
        lastStatement := nil.                                                                "+4"
123
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
        thisStatement := statements.
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
        [thisStatement notNil] whileTrue:[
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
            nextStatement := thisStatement nextStatement.
131
bb82bf09b928 oops - return is a local return
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
    93
            thisStatement codeForSideEffectOn:aStream inBlock:self for:aCompiler.
bb82bf09b928 oops - return is a local return
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
    94
            lastStatement := thisStatement.     
123
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
            thisStatement := nextStatement
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
        ].
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
131
bb82bf09b928 oops - return is a local return
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
    98
        lastStatement isReturnNode ifFalse:[
bb82bf09b928 oops - return is a local return
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
    99
            aStream nextPut:#retNil.
bb82bf09b928 oops - return is a local return
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   100
        ].
bb82bf09b928 oops - return is a local return
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   101
"/
bb82bf09b928 oops - return is a local return
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   102
"/        lastStatement 
bb82bf09b928 oops - return is a local return
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   103
"/                codeForSimpleReturnOn:aStream
bb82bf09b928 oops - return is a local return
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   104
"/                inBlock:self 
bb82bf09b928 oops - return is a local return
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   105
"/                lineNumber:lastStatement lineNumber 
bb82bf09b928 oops - return is a local return
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   106
"/                for:aCompiler.
123
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
    ].
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
    code := (aStream contents).
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
    "/ sigh - during coding, inlined subBlocks may have added more
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
    "/ tempVars; patch the nvar byte ...
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
596
0efa73ee44b0 JavaScript
Claus Gittinger <cg@exept.de>
parents: 465
diff changeset
   113
    code at:pos+2 put:(self numVars + maxNumTemp).
123
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
    "set the end of the block's code"
637
bfb2c2642b7b class: JavaScriptInnerFunctionNode
Stefan Vogel <sv@exept.de>
parents: 596
diff changeset
   116
    code at:pos+1 put:(aStream position + 1)
133
097c71ec28c9 inner function calling
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
   117
!
097c71ec28c9 inner function calling
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
   118
097c71ec28c9 inner function calling
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
   119
rememberOuterBlockVarAccess:aVariableNode
097c71ec28c9 inner function calling
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
   120
"/    accessedOuterBlockVars isNil ifTrue:[
097c71ec28c9 inner function calling
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
   121
"/        accessedOuterBlockVars := OrderedCollection new.
097c71ec28c9 inner function calling
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
   122
"/    ].
097c71ec28c9 inner function calling
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
   123
"/    accessedOuterBlockVars add:aVariableNode
123
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
! !
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
465
4709e087f850 added: #evaluateIn:
Claus Gittinger <cg@exept.de>
parents: 155
diff changeset
   126
!JavaScriptInnerFunctionNode methodsFor:'evaluation'!
4709e087f850 added: #evaluateIn:
Claus Gittinger <cg@exept.de>
parents: 155
diff changeset
   127
855
08a0245d9f51 class: JavaScriptInnerFunctionNode
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   128
_theReceiver
08a0245d9f51 class: JavaScriptInnerFunctionNode
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   129
    ^ nil
08a0245d9f51 class: JavaScriptInnerFunctionNode
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   130
!
08a0245d9f51 class: JavaScriptInnerFunctionNode
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   131
465
4709e087f850 added: #evaluateIn:
Claus Gittinger <cg@exept.de>
parents: 155
diff changeset
   132
evaluateIn:anEnvironment
4709e087f850 added: #evaluateIn:
Claus Gittinger <cg@exept.de>
parents: 155
diff changeset
   133
    ^ self
848
239f8d260f0e class: JavaScriptInnerFunctionNode
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   134
!
239f8d260f0e class: JavaScriptInnerFunctionNode
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   135
239f8d260f0e class: JavaScriptInnerFunctionNode
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   136
exitWith:something
239f8d260f0e class: JavaScriptInnerFunctionNode
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   137
    "return via return-statement"
239f8d260f0e class: JavaScriptInnerFunctionNode
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   138
239f8d260f0e class: JavaScriptInnerFunctionNode
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   139
    |con|
239f8d260f0e class: JavaScriptInnerFunctionNode
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   140
239f8d260f0e class: JavaScriptInnerFunctionNode
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   141
    "/ here, I am in the tree interpreter;
239f8d260f0e class: JavaScriptInnerFunctionNode
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   142
    "/ so just walk along the sender chain to find the evaluateAllIn:
239f8d260f0e class: JavaScriptInnerFunctionNode
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   143
    con := thisContext sender.
239f8d260f0e class: JavaScriptInnerFunctionNode
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   144
    [ con notNil ] whileTrue:[
239f8d260f0e class: JavaScriptInnerFunctionNode
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   145
        ((con selector == #value:) and:[ con receiver == self ]) ifTrue:[
239f8d260f0e class: JavaScriptInnerFunctionNode
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   146
            con return:something.
239f8d260f0e class: JavaScriptInnerFunctionNode
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   147
        ].
239f8d260f0e class: JavaScriptInnerFunctionNode
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   148
        con := con sender.
239f8d260f0e class: JavaScriptInnerFunctionNode
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   149
    ].
239f8d260f0e class: JavaScriptInnerFunctionNode
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   150
1001
0f34b2866465 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   151
    "/ self halt.
848
239f8d260f0e class: JavaScriptInnerFunctionNode
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   152
"/    home notNil ifTrue:[
239f8d260f0e class: JavaScriptInnerFunctionNode
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   153
"/        home exitWith:something
239f8d260f0e class: JavaScriptInnerFunctionNode
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   154
"/    ].
239f8d260f0e class: JavaScriptInnerFunctionNode
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   155
    ^ something
1001
0f34b2866465 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   156
0f34b2866465 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
   157
    "Modified: / 14-07-2018 / 09:35:10 / Claus Gittinger"
465
4709e087f850 added: #evaluateIn:
Claus Gittinger <cg@exept.de>
parents: 155
diff changeset
   158
! !
4709e087f850 added: #evaluateIn:
Claus Gittinger <cg@exept.de>
parents: 155
diff changeset
   159
123
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
!JavaScriptInnerFunctionNode methodsFor:'queries'!
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
133
097c71ec28c9 inner function calling
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
   162
home
097c71ec28c9 inner function calling
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
   163
    ^ environment
976
76f12773ae7d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 855
diff changeset
   164
! !
76f12773ae7d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 855
diff changeset
   165
76f12773ae7d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 855
diff changeset
   166
!JavaScriptInnerFunctionNode methodsFor:'testing'!
133
097c71ec28c9 inner function calling
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
   167
123
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
isInlineBlock
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
    ^ false
133
097c71ec28c9 inner function calling
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
   170
!
097c71ec28c9 inner function calling
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
   171
596
0efa73ee44b0 JavaScript
Claus Gittinger <cg@exept.de>
parents: 465
diff changeset
   172
isInnerFunction
0efa73ee44b0 JavaScript
Claus Gittinger <cg@exept.de>
parents: 465
diff changeset
   173
    ^ true
0efa73ee44b0 JavaScript
Claus Gittinger <cg@exept.de>
parents: 465
diff changeset
   174
!
0efa73ee44b0 JavaScript
Claus Gittinger <cg@exept.de>
parents: 465
diff changeset
   175
133
097c71ec28c9 inner function calling
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
   176
isJavaScriptBlock
097c71ec28c9 inner function calling
Claus Gittinger <cg@exept.de>
parents: 131
diff changeset
   177
    ^ true
123
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
! !
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
652
e55b2faa8385 Added JavaScriptParseNodeVisitor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 637
diff changeset
   180
!JavaScriptInnerFunctionNode methodsFor:'visiting'!
e55b2faa8385 Added JavaScriptParseNodeVisitor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 637
diff changeset
   181
e55b2faa8385 Added JavaScriptParseNodeVisitor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 637
diff changeset
   182
acceptVisitor:visitor 
e55b2faa8385 Added JavaScriptParseNodeVisitor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 637
diff changeset
   183
    "Double dispatch back to the visitor, passing my type encoded in
e55b2faa8385 Added JavaScriptParseNodeVisitor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 637
diff changeset
   184
     the selector (visitor pattern)"
e55b2faa8385 Added JavaScriptParseNodeVisitor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 637
diff changeset
   185
e55b2faa8385 Added JavaScriptParseNodeVisitor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 637
diff changeset
   186
    "stub code automatically generated - please change if required"
e55b2faa8385 Added JavaScriptParseNodeVisitor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 637
diff changeset
   187
e55b2faa8385 Added JavaScriptParseNodeVisitor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 637
diff changeset
   188
    ^ visitor visitJavaScriptInnerFunctionNode:self 
e55b2faa8385 Added JavaScriptParseNodeVisitor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 637
diff changeset
   189
! !
e55b2faa8385 Added JavaScriptParseNodeVisitor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 637
diff changeset
   190
123
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
!JavaScriptInnerFunctionNode class methodsFor:'documentation'!
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
version
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
    ^ '$Header$'
465
4709e087f850 added: #evaluateIn:
Claus Gittinger <cg@exept.de>
parents: 155
diff changeset
   195
!
4709e087f850 added: #evaluateIn:
Claus Gittinger <cg@exept.de>
parents: 155
diff changeset
   196
4709e087f850 added: #evaluateIn:
Claus Gittinger <cg@exept.de>
parents: 155
diff changeset
   197
version_CVS
4709e087f850 added: #evaluateIn:
Claus Gittinger <cg@exept.de>
parents: 155
diff changeset
   198
    ^ '$Header$'
123
22e2dd938ccd initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
! !
596
0efa73ee44b0 JavaScript
Claus Gittinger <cg@exept.de>
parents: 465
diff changeset
   200