[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pspp-cvs] pspp/src data/ChangeLog data/identifier.c data/...
From: |
Ben Pfaff |
Subject: |
[Pspp-cvs] pspp/src data/ChangeLog data/identifier.c data/... |
Date: |
Wed, 05 Dec 2007 06:15:39 +0000 |
CVSROOT: /cvsroot/pspp
Module name: pspp
Changes by: Ben Pfaff <blp> 07/12/05 06:15:39
Modified files:
src/data : ChangeLog identifier.c identifier.h
src/language/lexer: ChangeLog lexer.c lexer.h
Log message:
* lexer.c (lex_match_id_n): New function.
(lex_match_id): Reimplement in terms of lex_match_id_n.
* identifier.c (lex_id_match_n): New function.
(lex_id_match): Reimplement in terms of lex_id_match_n.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/src/data/ChangeLog?cvsroot=pspp&r1=1.172&r2=1.173
http://cvs.savannah.gnu.org/viewcvs/pspp/src/data/identifier.c?cvsroot=pspp&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/pspp/src/data/identifier.h?cvsroot=pspp&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/lexer/ChangeLog?cvsroot=pspp&r1=1.29&r2=1.30
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/lexer/lexer.c?cvsroot=pspp&r1=1.31&r2=1.32
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/lexer/lexer.h?cvsroot=pspp&r1=1.16&r2=1.17
Patches:
Index: data/ChangeLog
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/ChangeLog,v
retrieving revision 1.172
retrieving revision 1.173
diff -u -b -r1.172 -r1.173
--- data/ChangeLog 25 Nov 2007 06:17:16 -0000 1.172
+++ data/ChangeLog 5 Dec 2007 06:15:38 -0000 1.173
@@ -1,3 +1,8 @@
+2007-12-04 Ben Pfaff <address@hidden>
+
+ * identifier.c (lex_id_match_n): New function.
+ (lex_id_match): Reimplement in terms of lex_id_match_n.
+
2007-11-24 Ben Pfaff <address@hidden>
* automake.mk (src_data_libdata_a_SOURCES): Add val-type.h, to fix
Index: data/identifier.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/identifier.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- data/identifier.c 7 Jul 2007 06:14:09 -0000 1.7
+++ data/identifier.c 5 Dec 2007 06:15:38 -0000 1.8
@@ -75,10 +75,18 @@
bool
lex_id_match (struct substring keyword, struct substring token)
{
+ return lex_id_match_n (keyword, token, 3);
+}
+
+/* Returns true if TOKEN is a case-insensitive match for at least
+ the first N characters of KEYWORD. */
+bool
+lex_id_match_n (struct substring keyword, struct substring token, size_t n)
+{
size_t token_len = ss_length (token);
size_t keyword_len = ss_length (keyword);
- if (token_len >= 3 && token_len < keyword_len)
+ if (token_len >= n && token_len < keyword_len)
return ss_equals_case (ss_head (keyword, token_len), token);
else
return ss_equals_case (keyword, token);
Index: data/identifier.h
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/identifier.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- data/identifier.h 7 Jul 2007 06:14:09 -0000 1.6
+++ data/identifier.h 5 Dec 2007 06:15:39 -0000 1.7
@@ -60,6 +60,8 @@
/* Comparing identifiers. */
bool lex_id_match (struct substring keyword, struct substring token);
+bool lex_id_match_n (struct substring keyword, struct substring token,
+ size_t n);
int lex_id_to_token (struct substring);
/* Identifier names. */
Index: language/lexer/ChangeLog
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/lexer/ChangeLog,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- language/lexer/ChangeLog 14 Sep 2007 23:39:31 -0000 1.29
+++ language/lexer/ChangeLog 5 Dec 2007 06:15:39 -0000 1.30
@@ -1,3 +1,8 @@
+2007-12-04 Ben Pfaff <address@hidden>
+
+ * lexer.c (lex_match_id_n): New function.
+ (lex_match_id): Reimplement in terms of lex_match_id_n.
+
2007-08-16 Ben Pfaff <address@hidden>
Implement journaling. Bug #17240.
Index: language/lexer/lexer.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/lexer/lexer.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- language/lexer/lexer.c 11 Nov 2007 05:51:43 -0000 1.31
+++ language/lexer/lexer.c 5 Dec 2007 06:15:39 -0000 1.32
@@ -549,8 +549,18 @@
bool
lex_match_id (struct lexer *lexer, const char *s)
{
+ return lex_match_id_n (lexer, s, 3);
+}
+
+/* If the current token is the identifier S, skips it and returns
+ true. The identifier may be abbreviated to its first N
+ letters.
+ Otherwise, returns false. */
+bool
+lex_match_id_n (struct lexer *lexer, const char *s, size_t n)
+{
if (lexer->token == T_ID
- && lex_id_match (ss_cstr (s), ss_cstr (lexer->tokid)))
+ && lex_id_match_n (ss_cstr (s), ss_cstr (lexer->tokid), n))
{
lex_get (lexer);
return true;
Index: language/lexer/lexer.h
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/lexer/lexer.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- language/lexer/lexer.h 5 Sep 2007 06:23:03 -0000 1.16
+++ language/lexer/lexer.h 5 Dec 2007 06:15:39 -0000 1.17
@@ -53,6 +53,7 @@
/* Token matching functions. */
bool lex_match (struct lexer *, int);
bool lex_match_id (struct lexer *, const char *);
+bool lex_match_id_n (struct lexer *, const char *, size_t n);
bool lex_match_int (struct lexer *, int);
/* Forcible matching functions. */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pspp-cvs] pspp/src data/ChangeLog data/identifier.c data/...,
Ben Pfaff <=