diff options
| author | bringert <bringert@cs.chalmers.se> | 2005-12-06 16:19:29 +0000 |
|---|---|---|
| committer | bringert <bringert@cs.chalmers.se> | 2005-12-06 16:19:29 +0000 |
| commit | 1094204640cf1b12de751651c00b78f18d047429 (patch) | |
| tree | aca43048b7f5ba75bcfc57b377b361246242d5ad /src/Transfer/Syntax | |
| parent | cec34b7924b14d2a26585832b4e56201aae7dc0e (diff) | |
Transfer: Fixed BNFC's layout resolver to not insert semicolon at end of line if there is one already.
Diffstat (limited to 'src/Transfer/Syntax')
| -rw-r--r-- | src/Transfer/Syntax/Layout.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Transfer/Syntax/Layout.hs b/src/Transfer/Syntax/Layout.hs index d5eae2010..de5c99870 100644 --- a/src/Transfer/Syntax/Layout.hs +++ b/src/Transfer/Syntax/Layout.hs @@ -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) [] = |
