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
2ce88624
Commit
2ce88624
authored
Oct 12, 2020
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add isYulAstNode
parent
94833230
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
7 deletions
+15
-7
debuggerUI.js
apps/remix-ide/src/app/tabs/debugger/debuggerUI.js
+1
-1
astWalker.ts
libs/remix-astwalker/src/astWalker.ts
+11
-3
sourceMappings.ts
libs/remix-astwalker/src/sourceMappings.ts
+2
-2
sourceMappings.ts
libs/remix-astwalker/tests/sourceMappings.ts
+1
-1
No files found.
apps/remix-ide/src/app/tabs/debugger/debuggerUI.js
View file @
2ce88624
...
...
@@ -233,7 +233,7 @@ class DebuggerUI {
<p class="mt-2
${
css
.
debuggerLabel
}
">Debugger Configuration</p>
<div class="mt-2
${
css
.
debuggerConfig
}
custom-control custom-checkbox">
<input class="custom-control-input" id="debugGeneratedSourcesInput" onchange=
${(
event
)
=>
{
this
.
opt
.
debugWithGeneratedSources
=
event
.
target
.
checked
}}
type
=
"checkbox"
title
=
"Debug with generated sources"
>
<
label
data
-
id
=
"debugGeneratedSourcesLabel"
class
=
"form-check-label custom-control-label"
for
=
"debugGeneratedSourcesInput"
>
Debug
Generated
sources
if
available
(
>=
Solidity
0.7
.
2
)
<
/label
>
<
label
data
-
id
=
"debugGeneratedSourcesLabel"
class
=
"form-check-label custom-control-label"
for
=
"debugGeneratedSourcesInput"
>
Debug
Generated
sources
if
available
(
from
Solidity
0.7
.
2
)
<
/label
>
<
/div>
<
/div>
$
{
this
.
txBrowser
.
render
()}
...
...
libs/remix-astwalker/src/astWalker.ts
View file @
2ce88624
...
...
@@ -12,7 +12,15 @@ const isObject = function(obj: any): boolean {
export
function
isAstNode
(
node
:
Record
<
string
,
unknown
>
):
boolean
{
return
(
isObject
(
node
)
&&
// 'id' in node &&
'id'
in
node
&&
'nodeType'
in
node
&&
'src'
in
node
)
}
export
function
isYulAstNode
(
node
:
Record
<
string
,
unknown
>
):
boolean
{
return
(
isObject
(
node
)
&&
'nodeType'
in
node
&&
'src'
in
node
)
...
...
@@ -200,7 +208,7 @@ export class AstWalker extends EventEmitter {
}
// eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/explicit-module-boundary-types
walkFullInternal
(
ast
:
AstNode
,
callback
:
Function
)
{
if
(
isAstNode
(
ast
))
{
if
(
isAstNode
(
ast
)
||
isYulAstNode
(
ast
)
)
{
// console.log(`XXX id ${ast.id}, nodeType: ${ast.nodeType}, src: ${ast.src}`);
callback
(
ast
);
for
(
const
k
of
Object
.
keys
(
ast
))
{
...
...
@@ -223,7 +231,7 @@ export class AstWalker extends EventEmitter {
// Normalizes parameter callback and calls walkFullInternal
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
walkFull
(
ast
:
AstNode
,
callback
:
any
)
{
if
(
isAstNode
(
ast
))
return
this
.
walkFullInternal
(
ast
,
callback
);
if
(
isAstNode
(
ast
)
||
isYulAstNode
(
ast
)
)
return
this
.
walkFullInternal
(
ast
,
callback
);
}
// eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/explicit-module-boundary-types
...
...
libs/remix-astwalker/src/sourceMappings.ts
View file @
2ce88624
import
{
isAstNode
,
AstWalker
}
from
'./astWalker'
;
import
{
isAstNode
,
isYulAstNode
,
AstWalker
}
from
'./astWalker'
;
import
{
AstNode
,
LineColPosition
,
LineColRange
,
Location
}
from
"./types"
;
import
{
util
}
from
"@remix-project/remix-lib"
;
...
...
@@ -31,7 +31,7 @@ export function lineColPositionFromOffset(offset: number, lineBreaks: Array<numb
* @param astNode The object to convert.
*/
export
function
sourceLocationFromAstNode
(
astNode
:
AstNode
):
Location
|
null
{
if
(
isAstNode
(
astNode
)
&&
astNode
.
src
)
{
if
(
isAstNode
(
astNode
)
&&
isYulAstNode
(
astNode
)
&&
astNode
.
src
)
{
return
sourceLocationFromSrc
(
astNode
.
src
)
}
return
null
;
...
...
libs/remix-astwalker/tests/sourceMappings.ts
View file @
2ce88624
import
tape
from
"tape"
;
import
{
AstNode
,
isAstNode
,
AstNode
,
isAstNode
,
LineColPosition
,
lineColPositionFromOffset
,
LineColRange
,
Location
,
SourceMappings
,
sourceLocationFromAstNode
,
...
...
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