diff lwbasic/lexer.c @ 26:26aa76da75ad

Additional parsing in function/sub; emission of prolog/epilog code
author lost@l-w.ca
date Thu, 27 Jan 2011 20:44:57 -0700
parents 87590f43e76d
children 574931d87abd
line wrap: on
line diff
--- a/lwbasic/lexer.c	Mon Jan 24 20:08:09 2011 -0700
+++ b/lwbasic/lexer.c	Thu Jan 27 20:44:57 2011 -0700
@@ -55,6 +55,9 @@
 	{ "as",				token_kw_as },
 	{ "params",			token_kw_params },
 	{ "returns",		token_kw_returns },
+	{ "integer",		token_kw_integer },
+	{ "endsub",			token_kw_endsub },
+	{ "endfunction",	token_kw_endfunction },
 	{ NULL }
 };
 
@@ -111,7 +114,7 @@
 	
 	for (;;) {
 		c = lexer_curchar(state);
-		if (c == '_' || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c >= 0x80)
+		if (c == '_' || (c >= '0' && c <= '9' ) || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c >= 0x80)
 		{
 			/* character is part of word */
 			if (wordpos >= wordlen)