| 1018 | } |
| 1019 | |
| 1020 | bool CPreprocessor::HandleUnDef( Token &iBody, int iLine ) |
| 1021 | { |
| 1022 | CPreprocessor cpp( iBody, iLine ); |
| 1023 | |
| 1024 | Token t = cpp.GetToken( false ); |
| 1025 | |
| 1026 | if( t.Type != Token::TK_KEYWORD ) |
| 1027 | { |
| 1028 | Error( iLine, "Expecting a macro name after #undef, got", &t ); |
| 1029 | return false; |
| 1030 | } |
| 1031 | |
| 1032 | // Don't barf if macro does not exist - standard C behaviour |
| 1033 | Undef( t.String, t.Length ); |
| 1034 | |
| 1035 | do |
| 1036 | { |
| 1037 | t = cpp.GetToken( false ); |
| 1038 | } while( t.Type == Token::TK_WHITESPACE || t.Type == Token::TK_COMMENT || |
| 1039 | t.Type == Token::TK_LINECOMMENT ); |
| 1040 | |
| 1041 | if( t.Type != Token::TK_EOS ) |
| 1042 | Error( iLine, "Warning: Ignoring garbage after directive", &t ); |
| 1043 | |
| 1044 | return true; |
| 1045 | } |
| 1046 | |
| 1047 | bool CPreprocessor::HandleIfDef( Token &iBody, int iLine ) |
| 1048 | { |