mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 03:32:51 -06:00
Transfer: Fixed BNFC's layout resolver to not insert semicolon at end of line if there is one already.
This commit is contained in:
@@ -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) [] =
|
||||
|
||||
Reference in New Issue
Block a user