From e20dee90944fdf811b2e6c4ffbe790e4242b1410 Mon Sep 17 00:00:00 2001 From: simonmar Date: Mon, 20 Aug 2001 10:19:47 +0000 Subject: [PATCH] [project @ 2001-08-20 10:19:47 by simonmar] Add a new entry point: parseIdentifier, which parses a qualified or non-qualified operator or variable, including parenthesised and backquoted forms, and the special identifiers [], (), (,), (,,) etc. --- ghc/compiler/parser/Parser.y | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ghc/compiler/parser/Parser.y b/ghc/compiler/parser/Parser.y index 30a1950..da612d8 100644 --- a/ghc/compiler/parser/Parser.y +++ b/ghc/compiler/parser/Parser.y @@ -1,6 +1,6 @@ {- ----------------------------------------------------------------------------- -$Id: Parser.y,v 1.72 2001/07/23 10:54:48 simonpj Exp $ +$Id: Parser.y,v 1.73 2001/08/20 10:19:47 simonmar Exp $ Haskell grammar. @@ -9,7 +9,7 @@ Author(s): Simon Marlow, Sven Panne 1997, 1998, 1999 -} { -module Parser ( parseModule, parseStmt ) where +module Parser ( parseModule, parseStmt, parseIdentifier ) where import HsSyn import HsTypes ( mkHsTupCon ) @@ -206,6 +206,7 @@ Conflicts: 14 shift/reduce %lexer { lexer } { ITeof } %name parseModule module %name parseStmt maybe_stmt +%name parseIdentifier identifier %tokentype { Token } %% @@ -923,6 +924,11 @@ dbind : ipvar '=' exp { ($1, $3) } ----------------------------------------------------------------------------- -- Variables, Constructors and Operators. +identifier :: { RdrName } + : qvar { $1 } + | gcon { $1 } + | qop { $1 } + depreclist :: { [RdrName] } depreclist : deprec_var { [$1] } | deprec_var ',' depreclist { $1 : $3 } -- 1.7.10.4