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
1f03c64e
Commit
1f03c64e
authored
Jul 08, 2021
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
convert Token to use record syntax
parent
91e3ac0f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
14 deletions
+5
-14
src/Language/SystemVerilog/Parser/Tokens.hs
+5
-14
No files found.
src/Language/SystemVerilog/Parser/Tokens.hs
View file @
1f03c64e
...
@@ -10,23 +10,11 @@ module Language.SystemVerilog.Parser.Tokens
...
@@ -10,23 +10,11 @@ module Language.SystemVerilog.Parser.Tokens
(
Token
(
..
)
(
Token
(
..
)
,
TokenName
(
..
)
,
TokenName
(
..
)
,
Position
(
..
)
,
Position
(
..
)
,
tokenString
,
tokenName
,
tokenPosition
,
pattern
TokenEOF
,
pattern
TokenEOF
)
where
)
where
import
Text.Printf
import
Text.Printf
tokenString
::
Token
->
String
tokenString
(
Token
_
s
_
)
=
s
tokenName
::
Token
->
TokenName
tokenName
(
Token
kw
_
_
)
=
kw
tokenPosition
::
Token
->
Position
tokenPosition
(
Token
_
_
pos
)
=
pos
pattern
TokenEOF
::
Token
pattern
TokenEOF
::
Token
pattern
TokenEOF
=
Token
Unknown
""
(
Position
""
0
0
)
pattern
TokenEOF
=
Token
Unknown
""
(
Position
""
0
0
)
...
@@ -36,8 +24,11 @@ data Position
...
@@ -36,8 +24,11 @@ data Position
instance
Show
Position
where
instance
Show
Position
where
show
(
Position
f
l
c
)
=
printf
"%s:%d:%d"
f
l
c
show
(
Position
f
l
c
)
=
printf
"%s:%d:%d"
f
l
c
data
Token
data
Token
=
Token
=
Token
TokenName
String
Position
{
tokenName
::
TokenName
,
tokenString
::
String
,
tokenPosition
::
Position
}
data
TokenName
data
TokenName
=
KW_dollar_bits
=
KW_dollar_bits
...
...
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