parser.c

changeset 17
a034888a2227
parent 14
91f0c87b62a7
child 20
3f11f764772a
--- a/parser.c	Sat Jul 01 14:18:56 2000 +0200
+++ b/parser.c	Fri Jul 21 21:19:31 2000 +0200
@@ -446,7 +446,7 @@
 
 static int arg_match(Token *tok, char c)
 {
-	static const char chs[]={0, 'l', 'd', 'c', 's', 'i', 0, 0};
+	static const char chs[]={0, 'l', 'd', 'c', 's', 'i', 'b', 0, 0};
 	char c2;
 	
 	if(c=='.' || c=='*')
@@ -472,6 +472,23 @@
 		return 0;
 	}
 	   
+	if(c=='b'){
+		if(c2=='l'){
+			TOK_SET_BOOL(tok, TOK_LONG_VAL(tok));
+			return 0;
+		}else if(c2=='i'){
+			if(strcmp(TOK_IDENT_VAL(tok), "TRUE")==0){
+				tok_free(tok);
+				TOK_SET_BOOL(tok, TRUE);
+				return 0;
+			}else if(strcmp(TOK_IDENT_VAL(tok), "FALSE")==0){
+				tok_free(tok);
+				TOK_SET_BOOL(tok, FALSE);
+				return 0;
+			}
+		}
+	}
+				
 	return E_TOKZ_INVALID_ARGUMENT;
 }
 

mercurial