Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
2bf868bd
Commit
2bf868bd
authored
Oct 09, 2020
by
aniket-engg
Committed by
Aniket
Oct 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
legacyAST removed
parent
a012a049
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
13 additions
and
52 deletions
+13
-52
compiler-input.js
apps/remix-ide/src/app/compiler/compiler-input.js
+1
-1
types.ts
libs/remix-analyzer/src/types.ts
+0
-10
astWalker.ts
libs/remix-astwalker/src/astWalker.ts
+5
-5
types.ts
libs/remix-astwalker/src/types.ts
+0
-9
legacyAST.ts
libs/remix-astwalker/tests/resources/legacyAST.ts
+1
-1
rdb
libs/remix-debug/bin/rdb
+1
-1
test.js
libs/remix-debug/test.js
+1
-1
compilerHelper.js
libs/remix-debug/test/helpers/compilerHelper.js
+1
-1
compilerHelper.js
libs/remix-lib/src/helpers/compilerHelper.js
+1
-1
compiler-input.ts
libs/remix-solidity/src/compiler/compiler-input.ts
+1
-1
types.ts
libs/remix-solidity/src/compiler/types.ts
+1
-11
types.ts
libs/remix-tests/src/types.ts
+0
-10
No files found.
apps/remix-ide/src/app/compiler/compiler-input.js
View file @
2bf868bd
...
...
@@ -12,7 +12,7 @@ module.exports = (sources, opts) => {
libraries
:
opts
.
libraries
,
outputSelection
:
{
'*'
:
{
''
:
[
'
legacyAST'
,
'
ast'
],
''
:
[
'ast'
],
'*'
:
[
'abi'
,
'metadata'
,
'devdoc'
,
'userdoc'
,
'evm.legacyAssembly'
,
'evm.bytecode'
,
'evm.deployedBytecode'
,
'evm.methodIdentifiers'
,
'evm.gasEstimates'
]
}
}
...
...
libs/remix-analyzer/src/types.ts
View file @
2bf868bd
...
...
@@ -720,8 +720,6 @@ export interface CommonYulAstNode {
id
:
number
/** The AST object */
ast
:
AstNode
/** The legacy AST object */
legacyAST
:
AstNodeLegacy
}
/////////
...
...
@@ -742,14 +740,6 @@ export interface CommonYulAstNode {
[
x
:
string
]:
any
}
export
interface
AstNodeLegacy
{
id
:
number
name
:
string
src
:
string
children
?:
Array
<
AstNodeLegacy
>
attributes
?:
AstNodeAtt
}
export
interface
AstNodeAtt
{
operator
?:
string
string
?:
null
...
...
libs/remix-astwalker/src/astWalker.ts
View file @
2bf868bd
import
{
EventEmitter
}
from
"events"
;
import
{
AstNodeLegacy
,
Node
,
AstNode
}
from
"./index"
;
import
{
Node
,
AstNode
}
from
"./index"
;
export
declare
interface
AstWalker
{
new
():
EventEmitter
;
...
...
@@ -34,16 +34,16 @@ export function isAstNode(node: Record<string, unknown>): boolean {
*/
export
class
AstWalker
extends
EventEmitter
{
manageCallback
(
node
:
AstNode
Legacy
|
AstNode
,
node
:
AstNode
,
callback
:
Record
<
string
,
unknown
>
|
Function
// eslint-disable-line @typescript-eslint/ban-types
):
any
{
// FIXME: we shouldn't be doing this callback determination type on each AST node,
// since the callback function is set once per walk.
// Better would be to store the right one as a variable and
// return that.
if
(
<
AstNodeLegacy
>
node
)
{
if
((
<
AstNodeLegacy
>
node
).
name
in
callback
)
{
return
callback
[(
<
AstNodeLegacy
>
node
).
name
](
node
);
if
(
node
)
{
if
((
node
).
name
in
callback
)
{
return
callback
[(
node
).
name
](
node
);
}
else
{
return
callback
[
"*"
](
node
);
}
...
...
libs/remix-astwalker/src/types.ts
View file @
2bf868bd
...
...
@@ -24,7 +24,6 @@ export interface LineColRange {
export
interface
Node
{
ast
?:
AstNode
;
legacyAST
?:
AstNodeLegacy
;
source
?:
string
;
id
?:
number
;
}
...
...
@@ -47,14 +46,6 @@ export interface AstNode {
[
x
:
string
]:
any
;
}
export
interface
AstNodeLegacy
{
id
:
number
;
// This is unique across all nodes in an AST tree
name
:
string
;
// This corresponds to "nodeType" in ASTNode
src
:
string
;
children
?:
Array
<
AstNodeLegacy
>
;
// This corresponds to "nodes" in ASTNode
attributes
?:
AstNodeAtt
;
}
export
interface
AstNodeAtt
{
operator
?:
string
;
string
?:
null
;
...
...
libs/remix-astwalker/tests/resources/legacyAST.ts
View file @
2bf868bd
import
{
Node
}
from
'../../src/'
let
node
:
Node
;
let
node
:
any
;
node
=
{
"legacyAST"
:
{
"children"
:
[{
"attributes"
:
{
"literals"
:
[
"solidity"
,
">="
,
"0.5"
,
".0"
,
"<"
,
"0.6"
,
".0"
]
},
"id"
:
1
,
"name"
:
"PragmaDirective"
,
"src"
:
"0:31:0"
},
{
"attributes"
:
{
"SourceUnit"
:
53
,
"absolutePath"
:
"mortal.sol"
,
"file"
:
"mortal.sol"
,
"scope"
:
26
,
"symbolAliases"
:
[
null
],
"unitAlias"
:
""
},
"id"
:
2
,
"name"
:
"ImportDirective"
,
"src"
:
"32:20:0"
},
{
"attributes"
:
{
"contractDependencies"
:
[
52
],
"contractKind"
:
"contract"
,
"documentation"
:
null
,
"fullyImplemented"
:
true
,
"linearizedBaseContracts"
:
[
25
,
52
],
"name"
:
"Greeter"
,
"scope"
:
26
},
"children"
:
[{
"attributes"
:
{
"arguments"
:
null
},
"children"
:
[{
"attributes"
:
{
"contractScope"
:
null
,
"name"
:
"Mortal"
,
"referencedDeclaration"
:
52
,
"type"
:
"contract Mortal"
},
"id"
:
3
,
"name"
:
"UserDefinedTypeName"
,
"src"
:
"74:6:0"
}],
"id"
:
4
,
"name"
:
"InheritanceSpecifier"
,
"src"
:
"74:6:0"
},
{
"attributes"
:
{
"constant"
:
false
,
"name"
:
"greeting"
,
"scope"
:
25
,
"stateVariable"
:
true
,
"storageLocation"
:
"default"
,
"type"
:
"string"
,
"value"
:
null
,
"visibility"
:
"internal"
},
"children"
:
[{
"attributes"
:
{
"name"
:
"string"
,
"type"
:
"string"
},
"id"
:
5
,
"name"
:
"ElementaryTypeName"
,
"src"
:
"141:6:0"
}],
"id"
:
6
,
"name"
:
"VariableDeclaration"
,
"src"
:
"141:15:0"
},
{
"attributes"
:
{
"documentation"
:
null
,
"implemented"
:
true
,
"isConstructor"
:
true
,
"kind"
:
"constructor"
,
"modifiers"
:
[
null
],
"name"
:
""
,
"scope"
:
25
,
"stateMutability"
:
"nonpayable"
,
"superFunction"
:
null
,
"visibility"
:
"public"
},
"children"
:
[{
"children"
:
[{
"attributes"
:
{
"constant"
:
false
,
"name"
:
"_greeting"
,
"scope"
:
16
,
"stateVariable"
:
false
,
"storageLocation"
:
"memory"
,
"type"
:
"string"
,
"value"
:
null
,
"visibility"
:
"internal"
},
"children"
:
[{
"attributes"
:
{
"name"
:
"string"
,
"type"
:
"string"
},
"id"
:
7
,
"name"
:
"ElementaryTypeName"
,
"src"
:
"225:6:0"
}],
"id"
:
8
,
"name"
:
"VariableDeclaration"
,
"src"
:
"225:23:0"
}],
"id"
:
9
,
"name"
:
"ParameterList"
,
"src"
:
"224:25:0"
},
{
"attributes"
:
{
"parameters"
:
[
null
]
},
"children"
:
[],
"id"
:
10
,
"name"
:
"ParameterList"
,
"src"
:
"257:0:0"
},
{
"children"
:
[{
"children"
:
[{
"attributes"
:
{
"argumentTypes"
:
null
,
"isConstant"
:
false
,
"isLValue"
:
false
,
"isPure"
:
false
,
"lValueRequested"
:
false
,
"operator"
:
"="
,
"type"
:
"string storage ref"
},
"children"
:
[{
"attributes"
:
{
"argumentTypes"
:
null
,
"overloadedDeclarations"
:
[
null
],
"referencedDeclaration"
:
6
,
"type"
:
"string storage ref"
,
"value"
:
"greeting"
},
"id"
:
11
,
"name"
:
"Identifier"
,
"src"
:
"267:8:0"
},
{
"attributes"
:
{
"argumentTypes"
:
null
,
"overloadedDeclarations"
:
[
null
],
"referencedDeclaration"
:
8
,
"type"
:
"string memory"
,
"value"
:
"_greeting"
},
"id"
:
12
,
"name"
:
"Identifier"
,
"src"
:
"278:9:0"
}],
"id"
:
13
,
"name"
:
"Assignment"
,
"src"
:
"267:20:0"
}],
"id"
:
14
,
"name"
:
"ExpressionStatement"
,
"src"
:
"267:20:0"
}],
"id"
:
15
,
"name"
:
"Block"
,
"src"
:
"257:37:0"
}],
"id"
:
16
,
"name"
:
"FunctionDefinition"
,
"src"
:
"213:81:0"
},
{
"attributes"
:
{
"documentation"
:
null
,
"implemented"
:
true
,
"isConstructor"
:
false
,
"kind"
:
"function"
,
"modifiers"
:
[
null
],
"name"
:
"greet"
,
"scope"
:
25
,
"stateMutability"
:
"view"
,
"superFunction"
:
null
,
"visibility"
:
"public"
},
"children"
:
[{
"attributes"
:
{
"parameters"
:
[
null
]
},
"children"
:
[],
"id"
:
17
,
"name"
:
"ParameterList"
,
"src"
:
"338:2:0"
},
{
"children"
:
[{
"attributes"
:
{
"constant"
:
false
,
"name"
:
""
,
"scope"
:
24
,
"stateVariable"
:
false
,
"storageLocation"
:
"memory"
,
"type"
:
"string"
,
"value"
:
null
,
"visibility"
:
"internal"
},
"children"
:
[{
"attributes"
:
{
"name"
:
"string"
,
"type"
:
"string"
},
"id"
:
18
,
"name"
:
"ElementaryTypeName"
,
"src"
:
"362:6:0"
}],
"id"
:
19
,
"name"
:
"VariableDeclaration"
,
"src"
:
"362:13:0"
}],
"id"
:
20
,
"name"
:
"ParameterList"
,
"src"
:
"361:15:0"
},
{
"children"
:
[{
"attributes"
:
{
"functionReturnParameters"
:
20
},
"children"
:
[{
"attributes"
:
{
"argumentTypes"
:
null
,
"overloadedDeclarations"
:
[
null
],
"referencedDeclaration"
:
6
,
"type"
:
"string storage ref"
,
"value"
:
"greeting"
},
"id"
:
21
,
"name"
:
"Identifier"
,
"src"
:
"394:8:0"
}],
"id"
:
22
,
"name"
:
"Return"
,
"src"
:
"387:15:0"
}],
"id"
:
23
,
"name"
:
"Block"
,
"src"
:
"377:32:0"
}],
"id"
:
24
,
"name"
:
"FunctionDefinition"
,
"src"
:
"324:85:0"
}],
"id"
:
25
,
"name"
:
"ContractDefinition"
,
"src"
:
"54:357:0"
}],
"name"
:
"SourceUnit"
,
"attributes"
:
{
"absolutePath"
:
"greeter.sol"
,
"exportedSymbols"
:
{
"Greeter"
:
[
25
]
}
},
"id"
:
26
,
"src"
:
"0:412:0"
}
}
...
...
libs/remix-debug/bin/rdb
View file @
2bf868bd
...
...
@@ -44,7 +44,7 @@ const inputJson = {
},
outputSelection
:
{
'*'
:
{
''
:
[
'
legacyAST
'
],
''
:
[
'
ast
'
],
'*'
:
[
'abi'
,
'metadata'
,
'devdoc'
,
'userdoc'
,
'evm.legacyAssembly'
,
'evm.bytecode'
,
'evm.deployedBytecode'
,
'evm.methodIdentifiers'
,
'evm.gasEstimates'
]
}
}
...
...
libs/remix-debug/test.js
View file @
2bf868bd
...
...
@@ -19,7 +19,7 @@ var inputJson = {
},
outputSelection
:
{
'*'
:
{
''
:
[
'
legacyAST
'
],
''
:
[
'
ast
'
],
'*'
:
[
'abi'
,
'metadata'
,
'devdoc'
,
'userdoc'
,
'evm.legacyAssembly'
,
'evm.bytecode'
,
'evm.deployedBytecode'
,
'evm.methodIdentifiers'
,
'evm.gasEstimates'
]
}
}
...
...
libs/remix-debug/test/helpers/compilerHelper.js
View file @
2bf868bd
...
...
@@ -17,7 +17,7 @@ function compilerInput (contracts) {
},
outputSelection
:
{
'*'
:
{
''
:
[
'
legacyAST'
,
'
ast'
],
''
:
[
'ast'
],
'*'
:
[
'abi'
,
'metadata'
,
'evm.legacyAssembly'
,
'evm.bytecode'
,
'evm.deployedBytecode'
,
'evm.methodIdentifiers'
,
'evm.gasEstimates'
]
}
}
...
...
libs/remix-lib/src/helpers/compilerHelper.js
View file @
2bf868bd
...
...
@@ -17,7 +17,7 @@ function compilerInput (contracts) {
},
outputSelection
:
{
'*'
:
{
''
:
[
'
legacyAST'
,
'
ast'
],
''
:
[
'ast'
],
'*'
:
[
'abi'
,
'metadata'
,
'evm.legacyAssembly'
,
'evm.bytecode'
,
'evm.deployedBytecode'
,
'evm.methodIdentifiers'
,
'evm.gasEstimates'
]
}
}
...
...
libs/remix-solidity/src/compiler/compiler-input.ts
View file @
2bf868bd
...
...
@@ -14,7 +14,7 @@ export default (sources: Source, opts: CompilerInputOptions): string => {
libraries
:
opts
.
libraries
,
outputSelection
:
{
'*'
:
{
''
:
[
'
legacyAST'
,
'
ast'
],
''
:
[
'ast'
],
'*'
:
[
'abi'
,
'metadata'
,
'devdoc'
,
'userdoc'
,
'evm.legacyAssembly'
,
'evm.bytecode'
,
'evm.deployedBytecode'
,
'evm.methodIdentifiers'
,
'evm.gasEstimates'
,
'evm.assembly'
]
}
}
...
...
libs/remix-solidity/src/compiler/types.ts
View file @
2bf868bd
...
...
@@ -122,7 +122,7 @@ export interface CompilerInput {
//
outputSelection
?:
{
'*'
:
{
''
:
[
'
legacyAST'
,
'
ast'
],
''
:
[
'ast'
],
'*'
:
[
'abi'
,
'metadata'
,
'devdoc'
,
'userdoc'
,
'evm.legacyAssembly'
,
'evm.bytecode'
,
'evm.deployedBytecode'
,
'evm.methodIdentifiers'
,
'evm.gasEstimates'
,
'evm.assembly'
]
}
}
...
...
@@ -266,8 +266,6 @@ export interface CompilationResult {
id
:
number
/** The AST object */
ast
:
AstNode
/** The legacy AST object */
legacyAST
:
AstNodeLegacy
}
/////////
...
...
@@ -288,14 +286,6 @@ export interface CompilationResult {
[
x
:
string
]:
any
}
export
interface
AstNodeLegacy
{
id
:
number
name
:
string
src
:
string
children
?:
Array
<
AstNodeLegacy
>
attributes
?:
AstNodeAtt
}
export
interface
AstNodeAtt
{
operator
?:
string
string
?:
null
...
...
libs/remix-tests/src/types.ts
View file @
2bf868bd
...
...
@@ -81,16 +81,6 @@ export interface CompilationSource {
id
:
number
/** The AST object */
ast
:
AstNode
/** The legacy AST object */
legacyAST
:
AstNodeLegacy
}
export
interface
AstNodeLegacy
{
id
:
number
name
:
string
src
:
string
children
?:
Array
<
AstNodeLegacy
>
attributes
?:
AstNodeAtt
}
export
interface
AstNodeAtt
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment