mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-01 07:12:50 -06:00
Transfer: Changed BNFC's layout syntax resolver to add a semicolon at EOF if using top-level layout sytax. Changed transfer syntax to use this to force semicolon after imports when pretty printing transfer. transfer grammar printer now produces Transfer syntax, not core. It also imports prelude and includes Eq and Compos instances.
This commit is contained in:
@@ -10,13 +10,16 @@ comment "{-" "-}" ;
|
||||
Module. Module ::= [Import] [Decl] ;
|
||||
|
||||
Import. Import ::= "import" Ident ;
|
||||
separator Import ";" ;
|
||||
-- FIXME: this is terminator to ensure that the pretty printer
|
||||
-- produces a semicolon after the last import. This could cause
|
||||
-- problems in a program which only does imports and uses layout syntax.
|
||||
terminator Import ";" ;
|
||||
|
||||
DataDecl. Decl ::= "data" Ident ":" Exp "where" "{" [ConsDecl] "}" ;
|
||||
TypeDecl. Decl ::= Ident ":" Exp ;
|
||||
ValueDecl. Decl ::= Ident [Pattern] Guard "=" Exp ;
|
||||
DeriveDecl. Decl ::= "derive" Ident Ident ;
|
||||
separator Decl ";" ;
|
||||
terminator Decl ";" ;
|
||||
|
||||
ConsDecl. ConsDecl ::= Ident ":" Exp ;
|
||||
separator ConsDecl ";" ;
|
||||
|
||||
Reference in New Issue
Block a user