[project @ 1998-11-08 17:06:13 by sof]
authorsof <unknown>
Sun, 8 Nov 1998 17:06:13 +0000 (17:06 +0000)
committersof <unknown>
Sun, 8 Nov 1998 17:06:13 +0000 (17:06 +0000)
front end support for 'foreign label's

ghc/compiler/parser/hslexer.flex
ghc/compiler/parser/hsparser.y
ghc/compiler/parser/utils.h

index a5adef3..fc1b66b 100644 (file)
@@ -401,6 +401,7 @@ NL                          [\n\r]
 <GlaExt>"_casm_GC_"            { RETURN(CASM_GC); }
 <GlaExt>"foreign"              { RETURN(FOREIGN); }
 <GlaExt>"export"               { RETURN(EXPORT); }
+<GlaExt>"label"                        { RETURN(LABEL); }
 <GlaExt>"unsafe"               { RETURN(UNSAFE); }
 <GlaExt>"_stdcall"             { RETURN(STDCALL); }
 <GlaExt>"_ccall"               { RETURN(C_CALL); }
index 59d6f9d..8a691fd 100644 (file)
@@ -161,7 +161,7 @@ BOOLEAN pat_check=TRUE;
 
 %token  SCC
 %token CCALL           CCALL_GC        CASM            CASM_GC
-%token  EXPORT          UNSAFE          STDCALL                C_CALL  
+%token  EXPORT          UNSAFE          STDCALL                C_CALL   LABEL
 %token  PASCAL         FASTCALL        FOREIGN         DYNAMIC
 
 /**********************************************************************
@@ -548,6 +548,8 @@ defaultd:  defaultkey OPAREN types CPAREN       { $$ = mkdbind($3,startlineno);
 foreignd:  foreignkey IMPORT callconv ext_name unsafe_flag qvarid DCOLON sigtype { $$ = mkfobind($6,$8,$4,$5,$3,FOREIGN_IMPORT,startlineno); }
         |  foreignkey EXPORT callconv ext_name qvarid DCOLON sigtype             { $$ = mkfobind($5,$7,$4,0,$3,FOREIGN_EXPORT,startlineno); }
        ;
+        |  foreignkey LABEL ext_name qvarid DCOLON sigtype                       { $$ = mkfobind($4,$6,$3,0,-1,FOREIGN_LABEL,startlineno); }
+       ;
 
 callconv: STDCALL      { $$ = CALLCONV_STDCALL;  }
        | C_CALL        { $$ = CALLCONV_CCALL;    }
index 8124440..4ebf921 100644 (file)
@@ -122,6 +122,7 @@ void        checkprec PROTO((tree, qid, BOOLEAN));
 
 #define FOREIGN_IMPORT    0
 #define FOREIGN_EXPORT    1
+#define FOREIGN_LABEL     2
 
 BOOLEAN        isconstr PROTO((char *));
 void   setstartlineno PROTO((void));