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
9f180f91
Commit
9f180f91
authored
Jan 27, 2020
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve `line error message
parent
ad98c145
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletions
+8
-1
src/Language/SystemVerilog/Parser/Lex.x
+4
-1
src/Language/SystemVerilog/Parser/Tokens.hs
+4
-0
No files found.
src/Language/SystemVerilog/Parser/Lex.x
View file @
9f180f91
...
...
@@ -1002,7 +1002,10 @@ handleDirective (posOrig, _, _, strOrig) len = do
let Just line = readMaybe lineStr :: Maybe Int
let Just level = readMaybe levelStr :: Maybe Int
return (line, filename, level)
_ -> lexicalError $ "unexpected tokens following `begin_keywords: " ++ show toks
_ -> lexicalError $
"unexpected tokens types following `line: "
++ show (map tokenName toks) ++ "; should be: "
++ show [Lit_number, Lit_string, Lit_number]
let filename = init $ tail quotedFilename
setCurrentFile filename
(AlexPn f _ c, prev, _, str) <- alexGetInput
...
...
src/Language/SystemVerilog/Parser/Tokens.hs
View file @
9f180f91
...
...
@@ -10,6 +10,7 @@ module Language.SystemVerilog.Parser.Tokens
,
TokenName
(
..
)
,
Position
(
..
)
,
tokenString
,
tokenName
)
where
import
Text.Printf
...
...
@@ -17,6 +18,9 @@ import Text.Printf
tokenString
::
Token
->
String
tokenString
(
Token
_
s
_
)
=
s
tokenName
::
Token
->
TokenName
tokenName
(
Token
kw
_
_
)
=
kw
data
Position
=
Position
String
Int
Int
deriving
Eq
...
...
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