File tree Expand file tree Collapse file tree 8 files changed +15
-17
lines changed
Expand file tree Collapse file tree 8 files changed +15
-17
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import BNFC.PrettyPrint
1212--
1313-- >>> mkRule "main" ["file1","file2"] ["do something"]
1414-- main : file1 file2
15- -- do something
15+ -- do something
1616-- <BLANKLINE>
1717--
1818-- >>> mkRule "main" ["program.exe"] []
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ showFile = mkFile withLang "Show" "fs"
7272showFileM = mkMod withLang " Show"
7373tFileM = mkMod withLang " Test"
7474tFile = mkFile withLang " Test" " fs"
75- utilFileM = mkMod noLang " BnfcUtil"
75+ utilFileM = mkMod noLang " BnfcUtil"
7676utilFile = mkFile noLang " BnfcUtil" " fs"
7777fsprojFile = mkFile withLang " " " fsproj"
7878
@@ -105,7 +105,7 @@ makefile :: SharedOptions -> String -> Doc
105105makefile opts basename = vcat
106106 [
107107 mkRule " clean" []
108- [ " -rm -fr bin obj " ]
108+ [ " -rm -fr bin obj " ]
109109 ,mkRule " distclean" [" clean" ]
110110 [ " -rm -f " ++ unwords [ mkFile withLang " Lex" " *" opts,
111111 mkFile withLang " Par" " *" opts,
@@ -169,4 +169,4 @@ fsprojM opts = unlines
169169 ," </ItemGroup>"
170170
171171 ," </Project>"
172- ]
172+ ]
Original file line number Diff line number Diff line change @@ -227,4 +227,3 @@ mkRhs args its =
227227 mk _ _ = []
228228 prt c = prtFun c +++ show (precCat c)
229229
230-
Original file line number Diff line number Diff line change 11{-
22 TODO: Check if printing fot native fsharp objects like choice types or algebraic types can handle this (it would allow to remove most of the code here)
3- BNF Converter: Non-pretty-printer generator
3+ BNF Converter: Non-pretty-printer generator
44 Copyright (C) 2021 Author: Grzegorz Dziadkiewicz
55
66-}
@@ -131,4 +131,3 @@ mkRhs args its =
131131 mk args (Right _ : items) = mk args items
132132 mk _ _ = []
133133
134-
Original file line number Diff line number Diff line change @@ -61,6 +61,6 @@ case_fun cat xs = unlines $
6161 [
6262 " trans" ++ show cat +++ " (x : " ++ fixType cat ++ " ) : Result =" ,
6363 indent 1 " match x with"
64- ] ++
64+ ] ++
6565 (map (indent 1 ) . insertBar . map (++ " -> failure x" )) xs
66-
66+
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ fsharpTestfile absM lexM parM printM showM moduleName cf =
4040 topType2 = text $ fixType $ normCat $ firstEntry cf
4141 in vcat
4242 [ comment " automatically generated by the BNF Converter"
43- , text (" module" +++ moduleName)
43+ , text (" module" +++ moduleName)
4444 , " open System"
4545 , " open System.IO"
4646 , " open FSharp.Text.Lexing"
@@ -54,9 +54,9 @@ fsharpTestfile absM lexM parM printM showM moduleName cf =
5454 , nest 4 (" c |> LexBuffer<char>.FromTextReader |>" <+> parserName <+> lexerName )
5555 , " "
5656 , " let showTree (t:" <> topType2 <> " ) : string ="
57- , nest 4 (vcat ( punctuate " +"
57+ , nest 4 (vcat ( punctuate " +"
5858 [ doubleQuotes " [Abstract syntax]\\ n\\ n"
59- , showFun <+> " t"
59+ , showFun <+> " t"
6060 , doubleQuotes " \\ n\\ n"
6161 , doubleQuotes " [Linearized tree]\\ n\\ n"
6262 , printerName <+> " t"
Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ rules cf = mkRule "token" $
168168 ++
169169 -- reserved keywords
170170 [ ( " rsyms"
171- , vcat
171+ , vcat
172172 [ " let x = lexeme lexbuf"
173173 , " match Map.tryFind x symbol_table with"
174174 , " | Some result -> result"
@@ -204,7 +204,7 @@ rules cf = mkRule "token" $
204204 (multilineC, singleLineC) = comments cf
205205 tokenAction pos t = case asciiKeywords cf of
206206 [] -> " TOK_" <> t <+> arg " (lexeme lexbuf)"
207- _ -> vcat
207+ _ -> vcat
208208 [ " let l = lexeme lexbuf"
209209 , " Map.tryFind l resword_table"
210210 , " |> Option.defaultValue (TOK_" <> t <+> arg " l)"
Original file line number Diff line number Diff line change @@ -104,8 +104,8 @@ reservedFsLex =
104104 , " refill"
105105 , " rule"
106106 , " shortest"
107-
108- ," letter"
107+
108+ ," letter"
109109 ," upper"
110110 ," lower"
111111 ," digit"
@@ -139,4 +139,4 @@ showsFunQual :: (String -> String) -> Cat -> String
139139showsFunQual qual = loop where
140140 loop = \ case
141141 ListCat c -> qual " showList" +++ loop c
142- c -> qual " show" ++ fixType (normCat c)
142+ c -> qual " show" ++ fixType (normCat c)
You can’t perform that action at this time.
0 commit comments