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
b7a91663
Unverified
Commit
b7a91663
authored
May 18, 2021
by
Evolution404
Committed by
GitHub
May 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/asm: fix the bug of "00" prefix number (#22883)
parent
bb9f9ccf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
lex_test.go
core/asm/lex_test.go
+4
-0
lexer.go
core/asm/lexer.go
+1
-1
No files found.
core/asm/lex_test.go
View file @
b7a91663
...
...
@@ -60,6 +60,10 @@ func TestLexer(t *testing.T) {
input
:
"0123abc"
,
tokens
:
[]
token
{{
typ
:
lineStart
},
{
typ
:
number
,
text
:
"0123"
},
{
typ
:
element
,
text
:
"abc"
},
{
typ
:
eof
}},
},
{
input
:
"00123abc"
,
tokens
:
[]
token
{{
typ
:
lineStart
},
{
typ
:
number
,
text
:
"00123"
},
{
typ
:
element
,
text
:
"abc"
},
{
typ
:
eof
}},
},
{
input
:
"@foo"
,
tokens
:
[]
token
{{
typ
:
lineStart
},
{
typ
:
label
,
text
:
"foo"
},
{
typ
:
eof
}},
...
...
core/asm/lexer.go
View file @
b7a91663
...
...
@@ -254,7 +254,7 @@ func lexInsideString(l *lexer) stateFn {
func
lexNumber
(
l
*
lexer
)
stateFn
{
acceptance
:=
Numbers
if
l
.
accept
(
"
0"
)
||
l
.
accept
(
"
xX"
)
{
if
l
.
accept
(
"xX"
)
{
acceptance
=
HexadecimalNumbers
}
l
.
acceptRun
(
acceptance
)
...
...
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