Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sv2v
Overview
Overview
Details
Activity
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
lvzhengyang
sv2v
Commits
73404643
Commit
73404643
authored
Sep 02, 2019
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ParseDecl edge case
parent
97fda59c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
+5
-1
src/Language/SystemVerilog/Parser/ParseDecl.hs
+5
-1
No files found.
src/Language/SystemVerilog/Parser/ParseDecl.hs
View file @
73404643
...
@@ -184,7 +184,7 @@ parseDTsAsDeclOrAsgn :: [DeclToken] -> ([Decl], [Stmt])
...
@@ -184,7 +184,7 @@ parseDTsAsDeclOrAsgn :: [DeclToken] -> ([Decl], [Stmt])
parseDTsAsDeclOrAsgn
[
DTIdent
f
]
=
(
[]
,
[
Subroutine
(
Nothing
)
f
(
Args
[]
[]
)])
parseDTsAsDeclOrAsgn
[
DTIdent
f
]
=
(
[]
,
[
Subroutine
(
Nothing
)
f
(
Args
[]
[]
)])
parseDTsAsDeclOrAsgn
[
DTPSIdent
p
f
]
=
(
[]
,
[
Subroutine
(
Just
p
)
f
(
Args
[]
[]
)])
parseDTsAsDeclOrAsgn
[
DTPSIdent
p
f
]
=
(
[]
,
[
Subroutine
(
Just
p
)
f
(
Args
[]
[]
)])
parseDTsAsDeclOrAsgn
tokens
=
parseDTsAsDeclOrAsgn
tokens
=
if
(
any
isAsgnToken
tokens
||
tripLookahead
tokens
)
&&
lhs
/=
Nothing
if
(
isAsgn
(
last
tokens
)
||
tripLookahead
tokens
)
&&
lhs
/=
Nothing
then
(
[]
,
[
constructor
(
fromJust
lhs
)
expr
])
then
(
[]
,
[
constructor
(
fromJust
lhs
)
expr
])
else
(
parseDTsAsDecl
tokens
,
[]
)
else
(
parseDTsAsDecl
tokens
,
[]
)
where
where
...
@@ -193,6 +193,10 @@ parseDTsAsDeclOrAsgn tokens =
...
@@ -193,6 +193,10 @@ parseDTsAsDeclOrAsgn tokens =
DTAsgnNBlk
mt
e
->
(
Asgn
mt
,
e
)
DTAsgnNBlk
mt
e
->
(
Asgn
mt
,
e
)
_
->
error
$
"invalid block item decl or stmt: "
++
(
show
tokens
)
_
->
error
$
"invalid block item decl or stmt: "
++
(
show
tokens
)
lhs
=
takeLHS
$
init
tokens
lhs
=
takeLHS
$
init
tokens
isAsgn
::
DeclToken
->
Bool
isAsgn
(
DTAsgnNBlk
_
_
)
=
True
isAsgn
(
DTAsgn
_
_
)
=
True
isAsgn
_
=
False
-- [PUBLIC]: parser for mixed comma-separated declaration and assignment lists;
-- [PUBLIC]: parser for mixed comma-separated declaration and assignment lists;
-- the main use case is for `for` loop initialization lists
-- the main use case is for `for` loop initialization lists
...
...
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