mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-27 21:42:50 -06:00
Regenerated transfer layout syntax module with bug-fixed BNFC. Fixed printing of tokens in correct positions in the layout test program.
This commit is contained in:
@@ -9,11 +9,18 @@ prTokens :: [Token] -> String
|
||||
prTokens = prTokens_ 1 1
|
||||
where
|
||||
prTokens_ _ _ [] = ""
|
||||
prTokens_ l c (PT p t:ts) =
|
||||
prTokens_ l c (t@(PT (Pn _ l' c') _):ts) =
|
||||
replicate (l'-l) '\n'
|
||||
++ replicate (if l' == l then c'-c else c'-1) ' '
|
||||
++ s ++ prTokens_ l' (c'+length s) ts
|
||||
where s = prToken t
|
||||
-- prTokens_ l c (Err p:ts) =
|
||||
|
||||
layout :: String -> String
|
||||
layout s = prTokens . resolveLayout True . tokens
|
||||
layout s = prTokens ts'
|
||||
-- ++ "\n" ++ show ts'
|
||||
where ts = tokens s
|
||||
ts' = resolveLayout True ts
|
||||
|
||||
main :: IO ()
|
||||
main = do args <- getArgs
|
||||
|
||||
Reference in New Issue
Block a user