Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
Hdlmake
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
15
Issues
15
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Hdlmake
Commits
324543ac
Commit
324543ac
authored
Oct 01, 2013
by
Paweł Szostek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vlog parser: remove strange syntax hack
parent
199e423f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
vlog_parser.py
hdlmake/vlog_parser.py
+5
-7
No files found.
hdlmake/vlog_parser.py
View file @
324543ac
...
...
@@ -195,26 +195,24 @@ class VerilogPreprocessor(object):
elif
matches
[
"define"
]:
self
.
_parse_macro_def
(
matches
[
"define"
])
global
n_repl
n_repl
=
0
# the actual macro expansions (no args/vargs support yet, though)
def
do_expand
(
what
):
global
n_repl
# print("Expand %s" % what.group(1))
if
what
.
group
(
1
)
in
self
.
vpp_keywords
:
# print("GotReserved")
return
'`'
+
what
.
group
(
1
)
m
=
self
.
_find_macro
(
what
.
group
(
1
))
if
m
:
n_repl
+=
1
return
m
.
expansion
else
:
logging
.
error
(
"No expansion for macro '`
%
s'"
%
what
.
group
(
1
))
line
=
re
.
sub
(
vl_macro_expand
,
do_expand
,
line
)
new_buf
+=
line
+
'
\n
'
n_expansions
+=
n_repl
repl_line
=
re
.
sub
(
vl_macro_expand
,
do_expand
,
line
)
new_buf
+=
repl_line
+
'
\n
'
# if there was any expansion, then keep on iterating
if
repl_line
!=
line
:
n_expansions
+=
1
buf
=
new_buf
if
n_expansions
==
0
:
return
new_buf
...
...
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