Added the .TIME pseudo function

git-svn-id: svn://svn.cc65.org/cc65/trunk@1651 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2002-11-26 13:44:35 +00:00
parent 0edf53fd2f
commit 8fc78c2c8d
5 changed files with 34 additions and 7 deletions

View File

@@ -34,6 +34,7 @@
#include <string.h>
#include <time.h>
/* common */
#include "check.h"
@@ -660,6 +661,11 @@ static ExprNode* Factor (void)
N = Function (FuncTCount);
break;
case TOK_TIME:
N = LiteralExpr (time (0));
NextTok ();
break;
case TOK_XMATCH:
N = Function (FuncXMatch);
break;

View File

@@ -1430,6 +1430,7 @@ static CtrlDesc CtrlCmdTab [] = {
{ ccNone, DoUnexpected }, /* .STRLEN */
{ ccNone, DoSunPlus },
{ ccNone, DoUnexpected }, /* .TCOUNT */
{ ccNone, DoUnexpected }, /* .TIME */
{ ccNone, DoWarning },
{ ccNone, DoWord },
{ ccNone, DoUnexpected }, /* .XMATCH */

View File

@@ -228,6 +228,7 @@ struct DotKeyword {
{ ".STRLEN", TOK_STRLEN },
{ ".SUNPLUS", TOK_SUNPLUS },
{ ".TCOUNT", TOK_TCOUNT },
{ ".TIME", TOK_TIME },
{ ".WARNING", TOK_WARNING },
{ ".WORD", TOK_WORD },
{ ".XMATCH", TOK_XMATCH },

View File

@@ -201,6 +201,7 @@ enum Token {
TOK_STRLEN,
TOK_SUNPLUS,
TOK_TCOUNT,
TOK_TIME,
TOK_WARNING,
TOK_WORD,
TOK_XMATCH,