svnno****@sourc*****
svnno****@sourc*****
2009年 7月 2日 (木) 23:04:54 JST
Revision: 3570 http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=3570 Author: yutakapon Date: 2009-07-02 23:04:54 +0900 (Thu, 02 Jul 2009) Log Message: ----------- Borisããææãããã±ã¼ã¹ã«ããã¦ããæ£ããCè¨èªã³ã¡ã³ããåãããã«ä¿®æ£ããã ãã ããTest7ã®ããã«ã»ãã³ãã³ãå ã«æ¥ãã±ã¼ã¹ã¯æããªãã http://logmett.com/forum/viewtopic.php?f=2&t=1145 ããããåé¡ãªãã®ã§ãCè¨èªã³ã¡ã³ããæå¹åããã Modified Paths: -------------- trunk/teraterm/ttpmacro/ttmbuff.c trunk/teraterm/ttpmacro/ttmparse.c trunk/teraterm/ttpmacro/ttmparse.h -------------- next part -------------- Modified: trunk/teraterm/ttpmacro/ttmbuff.c =================================================================== --- trunk/teraterm/ttpmacro/ttmbuff.c 2009-07-02 13:28:07 UTC (rev 3569) +++ trunk/teraterm/ttpmacro/ttmbuff.c 2009-07-02 14:04:54 UTC (rev 3570) @@ -261,6 +261,11 @@ DispErr(Err); } } + + if (!IsCommentClosed()) { + DispErr(ErrCloseComment); + } + BuffPtr[IBuff] = 0; InitLineNo(); // (2005.7.18 yutaka) GlobalUnlock(BuffHandle[IBuff]); Modified: trunk/teraterm/ttpmacro/ttmparse.c =================================================================== --- trunk/teraterm/ttpmacro/ttmparse.c 2009-07-02 13:28:07 UTC (rev 3569) +++ trunk/teraterm/ttpmacro/ttmparse.c 2009-07-02 14:04:54 UTC (rev 3570) @@ -12,7 +12,8 @@ #include "ttmparse.h" /* C¾êX^CÌRgðT|[g·é©Ç¤© (2009.7.2 yutaka) */ -//#define SUPPORT_C_STYLE_COMMENT +#define SUPPORT_C_STYLE_COMMENT +static int commenting = 0; /* C¾êRg */ WORD TTLStatus = 0; char LineBuff[MaxLineLen]; // sobt@ÌTCYðg£µ½B(2007.6.9 maya) @@ -42,7 +43,6 @@ static PCHAR StrBuff; static WORD IntVarCount, StrVarCount, LabVarCount; - BOOL InitVar() { HNameBuff = GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT,NameBuffLen); @@ -87,6 +87,7 @@ case ErrTooManyVar: strncpy_s(Msg, sizeof(Msg),"Too many variables.", _TRUNCATE); break; case ErrTypeMismatch: strncpy_s(Msg, sizeof(Msg),"Type mismatch.", _TRUNCATE); break; case ErrVarNotInit: strncpy_s(Msg, sizeof(Msg),"Variable not initialized.", _TRUNCATE); break; + case ErrCloseComment: strncpy_s(Msg, sizeof(Msg),"\"*/\" expected.", _TRUNCATE); break; } i = OpenErrDlg(Msg,LineBuff); @@ -329,9 +330,14 @@ return (*WordId!=0); } +/* C¾êRgªÂ¶çêÄ¢é©Ç¤© */ +int IsCommentClosed(void) +{ + return (commenting == 0); +} + BYTE GetFirstChar() { - static int commenting = 0; BYTE b; int comment_starting = 0; @@ -364,6 +370,12 @@ b = LineBuff[LinePtr]; else b = 0; + + while ((LinePtr<LineLen) && ((b==' ') || (b=='\t'))) + { + LinePtr++; + if (LinePtr<LineLen) b = LineBuff[LinePtr]; + } } /* C¾êRgÌnÜè */ @@ -379,11 +391,18 @@ } LinePtr++; } + if (LinePtr < LineLen) b = LineBuff[LinePtr]; else b = 0; + while ((LinePtr<LineLen) && ((b==' ') || (b=='\t'))) + { + LinePtr++; + if (LinePtr<LineLen) b = LineBuff[LinePtr]; + } + /* RgÌIíèªêsÉoêµÈ¢êÍAi±IÉL^·éB*/ if (comment_starting) commenting = 1; Modified: trunk/teraterm/ttpmacro/ttmparse.h =================================================================== --- trunk/teraterm/ttpmacro/ttmparse.h 2009-07-02 13:28:07 UTC (rev 3569) +++ trunk/teraterm/ttpmacro/ttmparse.h 2009-07-02 14:04:54 UTC (rev 3570) @@ -33,6 +33,7 @@ #define ErrTooManyVar 13 #define ErrTypeMismatch 14 #define ErrVarNotInit 15 +#define ErrCloseComment 16 #define TypUnknown 0 #define TypInteger 1 @@ -236,6 +237,7 @@ void DispErr(WORD Err); void LockVar(); void UnlockVar(); +int IsCommentClosed(void); BYTE GetFirstChar(); BOOL CheckParameterGiven(); BOOL GetIdentifier(PCHAR Name);