From 7361ddea45727e80a79ba42af34e45f9641fc993 Mon Sep 17 00:00:00 2001 From: aarne Date: Sat, 12 Mar 2011 11:24:14 +0000 Subject: make it possible to override opers defined in an interface by syntax 'instance Foo of Bar - [f,g,h]' --- src/compiler/GF/Grammar/Parser.y | 10 +++++----- src/compiler/GF/Grammar/Printer.hs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/compiler/GF/Grammar') diff --git a/src/compiler/GF/Grammar/Parser.y b/src/compiler/GF/Grammar/Parser.y index 71b81e345..969aa25c3 100644 --- a/src/compiler/GF/Grammar/Parser.y +++ b/src/compiler/GF/Grammar/Parser.y @@ -132,11 +132,11 @@ ComplMod ModType :: { (ModuleType,Ident) } ModType - : 'abstract' Ident { (MTAbstract, $2) } - | 'resource' Ident { (MTResource, $2) } - | 'interface' Ident { (MTInterface, $2) } - | 'concrete' Ident 'of' Ident { (MTConcrete $4, $2) } - | 'instance' Ident 'of' Ident { (MTInstance $4, $2) } + : 'abstract' Ident { (MTAbstract, $2) } + | 'resource' Ident { (MTResource, $2) } + | 'interface' Ident { (MTInterface, $2) } + | 'concrete' Ident 'of' Ident { (MTConcrete $4, $2) } + | 'instance' Ident 'of' Included { (MTInstance $4, $2) } ModHeaderBody :: { ( [(Ident,MInclude)] , Maybe (Ident,MInclude,[(Ident,Ident)]) diff --git a/src/compiler/GF/Grammar/Printer.hs b/src/compiler/GF/Grammar/Printer.hs index ee9cd703b..3319f86e8 100644 --- a/src/compiler/GF/Grammar/Printer.hs +++ b/src/compiler/GF/Grammar/Printer.hs @@ -61,7 +61,7 @@ ppModule q (mn, ModInfo mtype mstat opts exts with opens _ jments) = MTResource -> text "resource" <+> ppIdent mn MTConcrete abs -> text "concrete" <+> ppIdent mn <+> text "of" <+> ppIdent abs MTInterface -> text "interface" <+> ppIdent mn - MTInstance int -> text "instance" <+> ppIdent mn <+> text "of" <+> ppIdent int + MTInstance ie -> text "instance" <+> ppIdent mn <+> text "of" <+> ppExtends ie ppExtends (id,MIAll ) = ppIdent id ppExtends (id,MIOnly incs) = ppIdent id <+> brackets (commaPunct ppIdent incs) -- cgit v1.2.3