mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
now a single line comment (--) is recongized as an empty command. Usefull for GF shell scripts
This commit is contained in:
@@ -14,9 +14,10 @@ readCommandLine s = case [x | (x,cs) <- RP.readP_to_S pCommandLine s, all isSpac
|
|||||||
[x] -> Just x
|
[x] -> Just x
|
||||||
_ -> Nothing
|
_ -> Nothing
|
||||||
|
|
||||||
test s = RP.readP_to_S pCommandLine s
|
pCommandLine =
|
||||||
|
(RP.skipSpaces >> RP.char '-' >> RP.char '-' >> RP.skipMany (RP.satisfy (const True)) >> return []) -- comment
|
||||||
pCommandLine = RP.sepBy (RP.skipSpaces >> pPipe) (RP.skipSpaces >> RP.char ';')
|
RP.<++
|
||||||
|
(RP.sepBy (RP.skipSpaces >> pPipe) (RP.skipSpaces >> RP.char ';'))
|
||||||
|
|
||||||
pPipe = RP.sepBy1 (RP.skipSpaces >> pCommand) (RP.skipSpaces >> RP.char '|')
|
pPipe = RP.sepBy1 (RP.skipSpaces >> pCommand) (RP.skipSpaces >> RP.char '|')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user