[pure-lang-svn] SF.net SVN: pure-lang:[632] pure/trunk
Status: Beta
Brought to you by:
agraef
|
From: <ag...@us...> - 2008-08-27 10:20:34
|
Revision: 632
http://pure-lang.svn.sourceforge.net/pure-lang/?rev=632&view=rev
Author: agraef
Date: 2008-08-27 10:20:43 +0000 (Wed, 27 Aug 2008)
Log Message:
-----------
Add 'private' declarations.
Modified Paths:
--------------
pure/trunk/ChangeLog
pure/trunk/parser.yy
Modified: pure/trunk/ChangeLog
===================================================================
--- pure/trunk/ChangeLog 2008-08-27 10:10:15 UTC (rev 631)
+++ pure/trunk/ChangeLog 2008-08-27 10:20:43 UTC (rev 632)
@@ -1,3 +1,8 @@
+2008-08-27 Albert Graef <Dr....@t-...>
+
+ * parser.yy, etc.: Symbols can now be declared 'private'. These
+ aren't visible anywhere except in the module that declares them.
+
2008-08-26 Albert Graef <Dr....@t-...>
* test/test022.pure: Add macro test script.
Modified: pure/trunk/parser.yy
===================================================================
--- pure/trunk/parser.yy 2008-08-27 10:10:15 UTC (rev 631)
+++ pure/trunk/parser.yy 2008-08-27 10:20:43 UTC (rev 632)
@@ -291,7 +291,8 @@
/* Lexical tie-in: We need to tell the lexer that we're defining new operator
symbols (interp.declare_op = true) instead of searching for existing ones
in the symbol table. */
-{ if ($1->fix != nullary && $1->prec > 9) {
+{ if ($1->priv && $1->prec > 10 ||
+ !$1->priv && $1->fix != nullary && $1->prec > 9) {
error(yylloc, "invalid fixity declaration"); YYERROR;
} else
interp.declare_op = true; }
@@ -307,6 +308,9 @@
fixity
: FIX INT { $$ = new sym_info(false,$2,$1); }
| NULLARY { $$ = new sym_info(false,10,nullary); }
+| PRIVATE FIX INT { $$ = new sym_info(true,$3,$2); }
+| PRIVATE NULLARY { $$ = new sym_info(true,10,nullary); }
+| PRIVATE { $$ = new sym_info(true,10,infix); }
;
ids
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|