From 0d3f8903e52d0671388d11c7f660957dbb7cc159 Mon Sep 17 00:00:00 2001 From: livid-burner <103508176+livid-burner@users.noreply.github.com> Date: Tue, 26 Apr 2022 13:18:29 +0300 Subject: [PATCH] Fix CR handling --- Main.hs | 4 ++-- alpaca-parser-generator.cabal | 2 +- package.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Main.hs b/Main.hs index fb09d4a..5fa0bde 100644 --- a/Main.hs +++ b/Main.hs @@ -29,10 +29,10 @@ runProgram :: (LexerWriter lang, ParserWriter parser lang) => Proxy lang -> Proxy parser -> MainProgram runProgram lang parserMethod debugLexer parserName baseFileName inputFile = do input <- decodeUtf8 <$> BS.readFile inputFile - let (lexicRaw, grammarLines) = second (drop 1) . break ((=="%%") . T.filter (/='\r')) $ T.lines input + let (lexicRaw, grammarLines) = second (drop 1) . break (=="%%") $ T.lines $ T.filter (/='\r') input rootdir = takeDirectory inputFile grammar = T.unlines grammarLines - lexic = filter (not . T.null) lexicRaw + lexic = filter (not . T.null . T.strip) lexicRaw setCurrentDirectory rootdir runInIO $ do writeFiles =<< makeLexer lang debugLexer lexic diff --git a/alpaca-parser-generator.cabal b/alpaca-parser-generator.cabal index 2103e89..78e42eb 100644 --- a/alpaca-parser-generator.cabal +++ b/alpaca-parser-generator.cabal @@ -5,7 +5,7 @@ cabal-version: 1.12 -- see: https://github.com/sol/hpack name: alpaca-parser-generator -version: 0.3.0.1 +version: 0.3.0.2 author: Nikolay Yakimov maintainer: root@livid.pp.ru license: MIT diff --git a/package.yaml b/package.yaml index 122a071..459054f 100644 --- a/package.yaml +++ b/package.yaml @@ -1,5 +1,5 @@ name: alpaca-parser-generator -version: '0.3.0.1' +version: '0.3.0.2' author: Nikolay Yakimov maintainer: root@livid.pp.ru license: MIT