Thread: [pure-lang-svn] SF.net SVN: pure-lang:[440] pure/trunk/lexer.ll
Status: Beta
Brought to you by:
agraef
|
From: <ag...@us...> - 2008-07-30 20:16:48
|
Revision: 440
http://pure-lang.svn.sourceforge.net/pure-lang/?rev=440&view=rev
Author: agraef
Date: 2008-07-30 20:16:55 +0000 (Wed, 30 Jul 2008)
Log Message:
-----------
Handle a few additional whitespace characters.
Modified Paths:
--------------
pure/trunk/lexer.ll
Modified: pure/trunk/lexer.ll
===================================================================
--- pure/trunk/lexer.ll 2008-07-29 12:13:14 UTC (rev 439)
+++ pure/trunk/lexer.ll 2008-07-30 20:16:55 UTC (rev 440)
@@ -221,7 +221,7 @@
exp ([Ee][+-]?[0-9]+)
float [0-9]+{exp}|[0-9]+\.{exp}|[0-9]*\.[0-9]+{exp}?
str ([^\"\\\n]|\\(.|\n))*
-blank [ \t]
+blank [ \t\f\v\r]
inttag ::{blank}*int
binttag ::{blank}*bigint
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ag...@us...> - 2008-08-05 04:58:37
|
Revision: 449
http://pure-lang.svn.sourceforge.net/pure-lang/?rev=449&view=rev
Author: agraef
Date: 2008-08-05 04:58:46 +0000 (Tue, 05 Aug 2008)
Log Message:
-----------
Cosmetic changes.
Modified Paths:
--------------
pure/trunk/lexer.ll
Modified: pure/trunk/lexer.ll
===================================================================
--- pure/trunk/lexer.ll 2008-08-05 04:37:56 UTC (rev 448)
+++ pure/trunk/lexer.ll 2008-08-05 04:58:46 UTC (rev 449)
@@ -942,8 +942,8 @@
if (h && h != f) h->print(os);
f->print(os);
for (size_t i = 0, n = fmap.m.size(); i < n; i++) {
- for (EnvMap::const_iterator f = fmap.m[i]->begin(),
- end = fmap.m[i]->end(); f != end; f++)
- f->second.print(os);
+ for (EnvMap::const_iterator it = fmap.m[i]->begin(),
+ end = fmap.m[i]->end(); it != end; it++)
+ it->second.print(os);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ag...@us...> - 2008-08-17 18:20:17
|
Revision: 522
http://pure-lang.svn.sourceforge.net/pure-lang/?rev=522&view=rev
Author: agraef
Date: 2008-08-17 18:20:28 +0000 (Sun, 17 Aug 2008)
Log Message:
-----------
Bugfix in lexer initialization.
Modified Paths:
--------------
pure/trunk/lexer.ll
Modified: pure/trunk/lexer.ll
===================================================================
--- pure/trunk/lexer.ll 2008-08-17 12:57:39 UTC (rev 521)
+++ pure/trunk/lexer.ll 2008-08-17 18:20:28 UTC (rev 522)
@@ -884,18 +884,21 @@
interpreter::lex_begin(const string& fname)
{
yy_flex_debug = (verbose&verbosity::lexer) != 0 && !source_s;
+ FILE *fp;
if (source_s)
- yyin = 0;
+ fp = 0;
else if (source.empty())
- yyin = stdin;
- else if (!(yyin = fopen(fname.c_str(), "r")))
+ fp = stdin;
+ else if (!(fp = fopen(fname.c_str(), "r")))
//error("cannot open '" + source + "'");
perror(source.c_str());
- if (source_s || yyin) {
+ if (source_s || fp) {
+ yyin = fp;
yypush_buffer_state(yy_create_buffer(yyin, YY_BUF_SIZE));
BEGIN(INITIAL);
- }
- return source_s || yyin;
+ return true;
+ } else
+ return false;
}
void
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ag...@us...> - 2008-08-19 11:04:42
|
Revision: 541
http://pure-lang.svn.sourceforge.net/pure-lang/?rev=541&view=rev
Author: agraef
Date: 2008-08-19 11:04:51 +0000 (Tue, 19 Aug 2008)
Log Message:
-----------
Cosmetic changes.
Modified Paths:
--------------
pure/trunk/lexer.ll
Modified: pure/trunk/lexer.ll
===================================================================
--- pure/trunk/lexer.ll 2008-08-19 11:04:21 UTC (rev 540)
+++ pure/trunk/lexer.ll 2008-08-19 11:04:51 UTC (rev 541)
@@ -395,12 +395,12 @@
cout << "list command help: list [options ...] [symbol ...]\n\
Options may be combined, e.g., list -tvl is the same as list -t -v -l.\n\
-a Disassembles pattern matching automata. Useful for debugging purposes.\n\
--c Print information about constant symbols.\n\
+-c Print information about defined constants.\n\
-d Disassembles LLVM IR, showing the generated LLVM assembler code of a\n\
function. Useful for debugging purposes.\n\
-e Annotate printed definitions with lexical environment information\n\
(de Bruijn indices, subterm paths). Useful for debugging purposes.\n\
--f Print information about function symbols.\n\
+-f Print information about defined functions.\n\
-g Indicates that the following symbols are actually shell glob patterns\n\
and that all matching symbols should be listed.\n\
-h Print this list.\n\
@@ -410,7 +410,7 @@
-t[level] List only symbols and definitions at the given temporary level\n\
(the current level by default) or above. Level 1 denotes all temporary\n\
definitions, level 0 *all* definitions (the default if -t is omitted).\n\
--v Print information about variable symbols.\n";
+-v Print information about defined variables.\n";
goto out;
default:
cerr << "list: invalid option character '" << *s << "'\n";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ag...@us...> - 2008-08-27 10:38:01
|
Revision: 633
http://pure-lang.svn.sourceforge.net/pure-lang/?rev=633&view=rev
Author: agraef
Date: 2008-08-27 10:38:09 +0000 (Wed, 27 Aug 2008)
Log Message:
-----------
Bugfix.
Modified Paths:
--------------
pure/trunk/lexer.ll
Modified: pure/trunk/lexer.ll
===================================================================
--- pure/trunk/lexer.ll 2008-08-27 10:20:43 UTC (rev 632)
+++ pure/trunk/lexer.ll 2008-08-27 10:38:09 UTC (rev 633)
@@ -479,6 +479,7 @@
int32_t f = it->first;
if (syms.find(f) == syms.end()) {
const symbol& sym = interp.symtab.sym(f);
+ if (sym.modno >= 0) continue; // skip private symbols
bool matches = true;
if (!args.l.empty()) {
matches = false;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ag...@us...> - 2008-09-06 19:45:56
|
Revision: 735
http://pure-lang.svn.sourceforge.net/pure-lang/?rev=735&view=rev
Author: agraef
Date: 2008-09-06 19:46:07 +0000 (Sat, 06 Sep 2008)
Log Message:
-----------
Add -F option to the dump command, cosmetic changes in the output.
Modified Paths:
--------------
pure/trunk/lexer.ll
Modified: pure/trunk/lexer.ll
===================================================================
--- pure/trunk/lexer.ll 2008-09-06 19:28:53 UTC (rev 734)
+++ pure/trunk/lexer.ll 2008-09-06 19:46:07 UTC (rev 735)
@@ -4,6 +4,7 @@
#include <limits.h>
#include <string.h>
#include <fnmatch.h>
+#include <time.h>
#include <readline/readline.h>
#include <readline/history.h>
#include <string>
@@ -750,7 +751,8 @@
if (!interp.interactive) REJECT;
uint8_t tflag = 1; int pflag = -1;
bool cflag = false, fflag = false, mflag = false, vflag = false;
- bool gflag = false;
+ bool gflag = false, Fflag = false;
+ string fname = ".pure";
const char *s = yytext+4;
if (*s && !isspace(*s)) REJECT;
yylloc->step();
@@ -759,10 +761,12 @@
if (!args.ok) goto out2;
// process option arguments
for (arg = args.l.begin(); arg != args.l.end(); arg++) {
+ if (Fflag) { fname = *arg; Fflag = false; continue; }
const char *s = arg->c_str();
- if (s[0] != '-' || !s[1] || !strchr("cfghmptv", s[1])) break;
+ if (s[0] != '-' || !s[1] || !strchr("Fcfghmptv", s[1])) break;
while (*++s) {
switch (*s) {
+ case 'F': Fflag = true; break;
case 'c': cflag = true; break;
case 'f': fflag = true; break;
case 'g': gflag = true; break;
@@ -784,7 +788,8 @@
break;
case 'h':
cout << "dump command help: dump [options ...] [symbol ...]\n\
-Options may be combined, e.g., dump -cv is the same as show -c -v.\n\
+Options may be combined, e.g., dump -tcv is the same as show -t -c -v.\n\
+-F Write the dump to the file named in the next arg (default is .pure).\n\
-c Dump defined constants.\n\
-f Dump defined functions.\n\
-g Indicates that the following symbols are actually shell glob patterns\n\
@@ -919,11 +924,13 @@
}
l.sort(env_compare);
if (l.empty()) {
- unlink(".pure");
+ unlink(fname.c_str());
goto out2;
}
ofstream fout;
- fout.open(".pure");
+ fout.open(fname.c_str());
+ time_t t; time(&t);
+ fout << "// dump written " << ctime(&t);
for (list<env_sym>::const_iterator it = l.begin();
it != l.end(); ++it) {
const symbol& sym = *it->sym;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ag...@us...> - 2008-09-07 06:58:02
|
Revision: 739
http://pure-lang.svn.sourceforge.net/pure-lang/?rev=739&view=rev
Author: agraef
Date: 2008-09-07 06:58:12 +0000 (Sun, 07 Sep 2008)
Log Message:
-----------
Cosmetic changes.
Modified Paths:
--------------
pure/trunk/lexer.ll
Modified: pure/trunk/lexer.ll
===================================================================
--- pure/trunk/lexer.ll 2008-09-07 06:55:28 UTC (rev 738)
+++ pure/trunk/lexer.ll 2008-09-07 06:58:12 UTC (rev 739)
@@ -426,7 +426,8 @@
tflag = interp.temp;
break;
case 'h':
- cout << "show command help: show [options ...] [symbol ...]\n\
+ cout <<
+"show command help: show [options ...] [symbol ...]\n\
Options may be combined, e.g., show -tvl is the same as show -t -v -l.\n\
-a Disassembles pattern matching automata. Useful for debugging purposes.\n\
-c Print information about defined constants.\n\
@@ -787,9 +788,10 @@
tflag = interp.temp;
break;
case 'h':
- cout << "dump command help: dump [options ...] [symbol ...]\n\
-Options may be combined, e.g., dump -tcv is the same as show -t -c -v.\n\
--F Write the dump to the file named in the next arg (default is .pure).\n\
+ cout <<
+"dump command help: dump [-F filename] [options ...] [symbol ...]\n\
+Options may be combined, e.g., dump -fg f* is the same as dump -f -g f*.\n\
+-F Write the dump to the given file (default is .pure).\n\
-c Dump defined constants.\n\
-f Dump defined functions.\n\
-g Indicates that the following symbols are actually shell glob patterns\n\
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|