actively re-orging by section
This commit is contained in:
parent
38fb13556f
commit
f2ef23d02e
4 changed files with 147 additions and 78 deletions
|
@ -1,6 +1,10 @@
|
|||
module RTLILParser.Primitives(
|
||||
pOctal,
|
||||
pEscapedChar
|
||||
pWs
|
||||
,pNonWs
|
||||
,pMaybeWs
|
||||
,pEol
|
||||
,pOctal
|
||||
,pEscapedChar
|
||||
) where
|
||||
|
||||
import Control.Monad (void)
|
||||
|
@ -9,7 +13,6 @@ import Text.Parsec.String (Parser)
|
|||
import Data.Char (digitToInt)
|
||||
import Util(binaryStringToInt, octalStringToInt)
|
||||
|
||||
|
||||
pOctal :: Parser Char
|
||||
pOctal = do
|
||||
digits <- count 1 digit -- At least 1 digit
|
||||
|
@ -26,4 +29,17 @@ pEscapedChar = do
|
|||
, char 't' >> return '\t'
|
||||
, try pOctal
|
||||
, anyChar
|
||||
]
|
||||
]
|
||||
|
||||
pMaybeWs :: Parser String
|
||||
pMaybeWs = many (oneOf " \t")
|
||||
|
||||
pWs :: Parser String
|
||||
pWs = many1 (oneOf " \t")
|
||||
|
||||
-- https://github.com/YosysHQ/yosys/blob/111b747d2797238eadf541879848492a9d34909a/frontends/rtlil/rtlil_lexer.l#L88C1-L88C17
|
||||
pNonWs :: Parser Char
|
||||
pNonWs = noneOf " \t\r\n"
|
||||
|
||||
pEol :: Parser String
|
||||
pEol = many1 (oneOf "\r\n")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue