Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
d5bcc01e
Commit
d5bcc01e
authored
Jul 04, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed shebang check. Previously it would hang on an unknown shebang
parent
633027d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
18 deletions
+26
-18
script.go
ethutil/script.go
+26
-18
No files found.
ethutil/script.go
View file @
d5bcc01e
...
@@ -10,28 +10,36 @@ import (
...
@@ -10,28 +10,36 @@ import (
// General compile function
// General compile function
func
Compile
(
script
string
)
(
ret
[]
byte
,
err
error
)
{
func
Compile
(
script
string
)
(
ret
[]
byte
,
err
error
)
{
c
:=
strings
.
Split
(
script
,
"
\n
"
)[
0
]
if
len
(
script
)
>
2
{
line
:=
strings
.
Split
(
script
,
"
\n
"
)[
0
]
if
c
==
"#!serpent"
{
if
line
[
0
:
2
]
==
"#!"
{
byteCode
,
err
:=
serpent
.
Compile
(
script
)
switch
line
{
if
err
!=
nil
{
case
"#!serpent"
:
return
nil
,
err
byteCode
,
err
:=
serpent
.
Compile
(
script
)
}
if
err
!=
nil
{
return
nil
,
err
}
return
byteCode
,
nil
}
}
else
{
return
byteCode
,
nil
compiler
:=
mutan
.
NewCompiler
(
backend
.
NewEthereumBackend
())
}
else
{
byteCode
,
errors
:=
compiler
.
Compile
(
strings
.
NewReader
(
script
))
compiler
:=
mutan
.
NewCompiler
(
backend
.
NewEthereumBackend
())
if
len
(
errors
)
>
0
{
byteCode
,
errors
:=
compiler
.
Compile
(
strings
.
NewReader
(
script
))
var
errs
string
if
len
(
errors
)
>
0
{
for
_
,
er
:=
range
errors
{
var
errs
string
if
er
!=
nil
{
for
_
,
er
:=
range
errors
{
errs
+=
er
.
Error
()
if
er
!=
nil
{
}
errs
+=
er
.
Error
()
}
}
return
nil
,
fmt
.
Errorf
(
"%v"
,
errs
)
}
}
return
nil
,
fmt
.
Errorf
(
"%v"
,
errs
)
}
return
byteCode
,
nil
return
byteCode
,
nil
}
}
}
return
nil
,
nil
}
}
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