forked from GitHub/gf-core
fully implement the linearize command
This commit is contained in:
@@ -713,13 +713,17 @@ pgfCommands = Map.fromList [
|
|||||||
|
|
||||||
linear :: [Option] -> Concr -> Expr -> [String]
|
linear :: [Option] -> Concr -> Expr -> [String]
|
||||||
linear opts concr = case opts of
|
linear opts concr = case opts of
|
||||||
_ | isOpt "all" opts -> concat .
|
_ | isOpt "list" opts &&
|
||||||
map (map snd) . tabularLinearizeAll concr
|
isOpt "all" opts -> map (commaList . map snd) . tabularLinearizeAll concr
|
||||||
_ | isOpt "list" opts -> (:[]) . commaList . concat .
|
_ | isOpt "list" opts -> (:[]) . commaList .
|
||||||
map (map snd) . tabularLinearizeAll concr
|
map snd . tabularLinearize concr
|
||||||
_ | isOpt "table" opts -> concat .
|
_ | isOpt "table" opts &&
|
||||||
map (map (\(p,v) -> p+++":"+++v)) . tabularLinearizeAll concr
|
isOpt "all" opts -> map (\(p,v) -> p+++":"+++v) . concat . tabularLinearizeAll concr
|
||||||
|
_ | isOpt "table" opts -> map (\(p,v) -> p+++":"+++v) . tabularLinearize concr
|
||||||
|
_ | isOpt "bracket" opts &&
|
||||||
|
isOpt "all" opts -> map (unwords . map showBracketedString) . bracketedLinearizeAll concr
|
||||||
_ | isOpt "bracket" opts -> (:[]) . unwords . map showBracketedString . bracketedLinearize concr
|
_ | isOpt "bracket" opts -> (:[]) . unwords . map showBracketedString . bracketedLinearize concr
|
||||||
|
_ | isOpt "all" opts -> linearizeAll concr
|
||||||
_ -> (:[]) . linearize concr
|
_ -> (:[]) . linearize concr
|
||||||
|
|
||||||
-- replace each non-atomic constructor with mkC, where C is the val cat
|
-- replace each non-atomic constructor with mkC, where C is the val cat
|
||||||
|
|||||||
Reference in New Issue
Block a user