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
d473c2ca
Commit
d473c2ca
authored
Oct 02, 2015
by
d11e9
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show usage in ballot
parent
47c7f112
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
ballot.sol.js
ballot.sol.js
+7
-1
index.html
index.html
+1
-3
No files found.
ballot.sol.js
View file @
d473c2ca
...
...
@@ -24,7 +24,13 @@
var
multi
=
function
(
func
)
{
return
func
.
toString
().
match
(
/
[^]
*
\/\*([^]
*
)\*\/\}
$/
)[
1
];
}
var
BALLOT_EXAMPLE
=
multi
(
function
(){
/*contract Ballot {
var
BALLOT_EXAMPLE
=
multi
(
function
(){
/*
// create a new file called 'test' :)
import "test";
contract Ballot {
struct Voter {
uint weight;
bool voted;
...
...
index.html
View file @
d473c2ca
...
...
@@ -288,7 +288,6 @@ THE SOFTWARE.
$
(
'#output'
).
empty
();
var
input
=
editor
.
getValue
();
var
inputIncludingImports
=
includeLocalImports
(
input
);
console
.
log
(
inputIncludingImports
)
var
optimize
=
document
.
querySelector
(
'#optimize'
).
checked
;
try
{
var
data
=
$
.
parseJSON
(
compileJSON
(
inputIncludingImports
,
optimize
?
1
:
0
));
...
...
@@ -328,12 +327,11 @@ THE SOFTWARE.
};
function
includeLocalImports
(
input
)
{
var
importRegex
=
/import
\s[\'\"]([^\'\"]
+
)[\'\"]
/g
var
importRegex
=
/import
\s[\'\"]([^\'\"]
+
)[\'\"]
;
/g
var
imports
=
[];
var
matches
=
[];
var
match
;
while
((
match
=
importRegex
.
exec
(
input
))
!==
null
)
{
console
.
log
(
"match:"
,
match
[
0
])
if
(
match
[
1
]
&&
solFiles
.
indexOf
(
match
[
1
])
!==
-
1
)
{
imports
.
push
(
match
[
1
]
)
matches
.
push
(
match
[
0
]
)
...
...
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