mirror of https://github.com/zachjs/sv2v.git
proper handling of single-line comments in macro definitions
This commit is contained in:
parent
c4449fd9ca
commit
17fd6f8ce5
|
|
@ -410,6 +410,11 @@ takeUntilNewline = do
|
||||||
[] -> return ""
|
[] -> return ""
|
||||||
'\n' : _ -> do
|
'\n' : _ -> do
|
||||||
return ""
|
return ""
|
||||||
|
'/' : '/' : _ -> do
|
||||||
|
remainder <- takeThrough '\n'
|
||||||
|
case last $ init remainder of
|
||||||
|
'\\' -> takeUntilNewline >>= return . (' ' :)
|
||||||
|
_ -> return ""
|
||||||
'\\' : '\n' : rest -> do
|
'\\' : '\n' : rest -> do
|
||||||
let newPos = alexMove (alexMove pos '\\') '\n'
|
let newPos = alexMove (alexMove pos '\\') '\n'
|
||||||
alexSetInput (newPos, '\n', [], rest)
|
alexSetInput (newPos, '\n', [], rest)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue