diff options
author | Cristian Adam <cristian.adam@gmail.com> | 2020-02-27 19:20:22 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-03-03 13:42:13 (GMT) |
commit | 598b676b5e77540b366b01b3c10154c2a633d23c (patch) | |
tree | eb3aaea48e3c1743835a74be111ca64ee4a9a4e5 /Source/LexerParser/cmListFileLexer.c | |
parent | c58b9c5ab94d674c76a17e6154f05e0e8c5c37d1 (diff) | |
download | CMake-598b676b5e77540b366b01b3c10154c2a633d23c.zip CMake-598b676b5e77540b366b01b3c10154c2a633d23c.tar.gz CMake-598b676b5e77540b366b01b3c10154c2a633d23c.tar.bz2 |
cmake_command: Add command to EVAL a CMake script as a string
Diffstat (limited to 'Source/LexerParser/cmListFileLexer.c')
-rw-r--r-- | Source/LexerParser/cmListFileLexer.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/Source/LexerParser/cmListFileLexer.c b/Source/LexerParser/cmListFileLexer.c index 15dcda0..ec7424c 100644 --- a/Source/LexerParser/cmListFileLexer.c +++ b/Source/LexerParser/cmListFileLexer.c @@ -2787,7 +2787,7 @@ int cmListFileLexer_SetString(cmListFileLexer* lexer, const char* text) /*--------------------------------------------------------------------------*/ cmListFileLexer_Token* cmListFileLexer_Scan(cmListFileLexer* lexer) { - if (!lexer->file) { + if (!lexer->file && !lexer->string_buffer) { return 0; } if (cmListFileLexer_yylex(lexer->scanner, lexer)) { @@ -2801,21 +2801,13 @@ cmListFileLexer_Token* cmListFileLexer_Scan(cmListFileLexer* lexer) /*--------------------------------------------------------------------------*/ long cmListFileLexer_GetCurrentLine(cmListFileLexer* lexer) { - if (lexer->file) { - return lexer->line; - } else { - return 0; - } + return lexer->line; } /*--------------------------------------------------------------------------*/ long cmListFileLexer_GetCurrentColumn(cmListFileLexer* lexer) { - if (lexer->file) { - return lexer->column; - } else { - return 0; - } + return lexer->column; } /*--------------------------------------------------------------------------*/ |