Changeset: 0c5fcde7cc49 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0c5fcde7cc49
Modified Files:
monetdb5/mal/mal_parser.mx
monetdb5/mal/mal_type.mx
Branch: headless
Log Message:
Step one, remove :bat and see how it breaks
diffs (113 lines):
diff --git a/monetdb5/mal/mal_parser.mx b/monetdb5/mal/mal_parser.mx
--- a/monetdb5/mal/mal_parser.mx
+++ b/monetdb5/mal/mal_parser.mx
@@ -627,7 +627,7 @@
@item scalarType
@tab : ':' @sc{ identifier}
@item collectionType
-@tab : ':' @sc{ bat} ['[' col ',' col ']']
+@tab : ':' @sc{ col} ['[' col ']']
@item anyType
@tab : ':' @sc{ any} [typeAlias]
@item col
@@ -692,33 +692,20 @@
int
parseTypeId(Client cntxt, int defaultType)
{
- int i = TYPE_any, ht, tt, kh = 0, kt = 0;
+ int i = TYPE_any, ht, kh = 0, kt = 0;
char *s= CURRENT(cntxt);
- if ( strncmp(s, ":bat[", 5) == 0) {
- /* parse :bat[:type,:type] */
+ if ( strncmp(s, ":col[", 5) == 0) {
+ /* parse :col[:type] */
advance(cntxt,5);
if( currChar(cntxt) ==':') {
ht = simpleTypeId(cntxt);
kh = typeAlias(cntxt,ht);
} else ht = TYPE_any;
- if (currChar(cntxt) != ',') {
- parseError(cntxt, "',' expected\n");
- return i;
- }
- nextChar(cntxt); /* skip , */
- skipSpace(cntxt);
- if( currChar(cntxt) ==':') {
- tt = simpleTypeId(cntxt);
- kt = typeAlias(cntxt,tt);
- } else tt= TYPE_any;
-
- i = newBatType(ht, tt);
+ i = newColType(ht);
if (kh > 0)
- setAnyHeadIndex(i, kh);
- if (kt > 0)
- setAnyTailIndex(i, kt);
+ setAnyIndex(i, kh);
if (currChar(cntxt) != ']')
parseError(cntxt, "']' expected\n");
@@ -726,21 +713,11 @@
skipSpace(cntxt);
return i;
}
- if( (strncmp(s,":bat",4)==0 ||
- strncmp(s,":BAT",4)==0 ) && !idCharacter[(int) s[4]]) {
- advance(cntxt,4);
- return TYPE_bat;
- }
- if( strncmp(s,":col",4)==0 && !idCharacter[(int) s[4]]) {
- /* parse default for :col[:any] */
- advance(cntxt,4);
- return newColType(TYPE_any);
- }
if( currChar(cntxt) ==':'){
ht = simpleTypeId(cntxt);
kt = typeAlias(cntxt,ht);
if( kt > 0)
- setAnyTailIndex(ht,kt);
+ setAnyIndex(ht,kt);
return ht;
}
parseError(cntxt,"<type identifier> expected\n");
diff --git a/monetdb5/mal/mal_type.mx b/monetdb5/mal/mal_type.mx
--- a/monetdb5/mal/mal_type.mx
+++ b/monetdb5/mal/mal_type.mx
@@ -51,8 +51,10 @@
#define TMPMARKER '_'
#define REFMARKER 'X'
+#define newColType(T) (1<<16 | (T & 0377) )
+#define getType(X) (X & 0377 )
+
#define newBatType(H,T) (1<<16 | (((H & 0377) <<8) | (T & 0377) ))
-#define newColType(T) (1<<25 | (((TYPE_void & 0377) <<8) | (T & 0377) ))
#define getHeadType(X) ((X>>8) & 0377 )
#define getTailType(X) ((X) & 0377 )
#define isaBatType(X) ((1<<16) & (X) && (X)!= TYPE_any)
@@ -130,11 +132,11 @@
if (isaBatType(tpe)) {
k = getHeadIndex(tpe);
if (k)
- snprintf(buf, l, "bat[:any%c%d,", TMPMARKER, k);
+ snprintf(buf, l, "col[:any%c%d,", TMPMARKER, k);
else if (getHeadType(tpe) == TYPE_any)
- snprintf(buf, l, "bat[:any,");
+ snprintf(buf, l, "col[:any,");
else
- snprintf(buf, l, "bat[:%s,",
ATOMname(getHeadType(tpe)));
+ snprintf(buf, l, "col[:%s,",
ATOMname(getHeadType(tpe)));
l -= strlen(buf);
s = buf + strlen(buf);
k = getTailIndex(tpe);
@@ -212,8 +214,6 @@
return TYPE_any;
break;
case 'b':
- if (qt("bat"))
- return TYPE_bat;
if (qt("bit"))
return TYPE_bit;
if (qt("bte"))
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list