diff options
author | Robert Griesemer <gri@golang.org> | 2008-08-04 15:37:47 -0700 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2008-08-04 15:37:47 -0700 |
commit | 33ef7ce501c61ef30bffb15df9246606f52eebc1 (patch) | |
tree | 7a6ddde52211f84ed722d2ebd10019b0946a33c5 /usr/gri/gosrc/parser.go | |
parent | 334408e1c020b0732665650501adc66a6ebab1d5 (diff) | |
download | golang-33ef7ce501c61ef30bffb15df9246606f52eebc1.tar.gz |
- switch to new export syntax
- deprecate old syntax in this front-end (use -6g for compatibility)
R=r
OCL=13831
CL=13833
Diffstat (limited to 'usr/gri/gosrc/parser.go')
-rw-r--r-- | usr/gri/gosrc/parser.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/usr/gri/gosrc/parser.go b/usr/gri/gosrc/parser.go index a19bd1473..10a0563c5 100644 --- a/usr/gri/gosrc/parser.go +++ b/usr/gri/gosrc/parser.go @@ -14,8 +14,7 @@ import Import "import" import AST "ast" -export Parser -type Parser struct { +export type Parser struct { comp *Globals.Compilation; semantic_checks bool; verbose, indent int; @@ -1796,9 +1795,14 @@ func (P *Parser) ParseFuncDecl(exported bool) { func (P *Parser) ParseExportDecl() { P.Trace("ExportDecl"); - // TODO this needs to be clarified - the current syntax is - // "everything goes" - sigh... + // TODO This is deprecated syntax and should go away eventually. + // (Also at the moment the syntax is everything goes...) //P.Expect(Scanner.EXPORT); + + if !P.comp.flags.sixg { + P.Error(P.pos, "deprecated export syntax (use -6g to enable)"); + } + has_paren := false; if P.tok == Scanner.LPAREN { P.Next(); |