1
0
forked from GitHub/gf-core

Transfer: Fixed BNFC's layout resolver to not insert semicolon at end of line if there is one already.

This commit is contained in:
bringert
2005-12-06 16:19:29 +00:00
parent 817ee33c2e
commit 8b379e4421

View File

@@ -109,8 +109,11 @@ resolveLayout tp = res Nothing [if tl then Implicit 1 else Explicit]
res (Just t) (Explicit:bs) [] | null bs = []
| otherwise = res (Just t) bs []
-- If we are using top-level layout, insert a semicolon after the last token
res (Just t) [Implicit n] [] = addToken (nextPos t) layoutSep []
-- If we are using top-level layout, insert a semicolon after
-- the last token, if there isn't one already
res (Just t) [Implicit n] []
| isTokenIn [layoutSep] t = []
| otherwise = addToken (nextPos t) layoutSep []
-- At EOF in an implicit, non-top-level block: close the block
res (Just t) (Implicit n:bs) [] =