summaryrefslogtreecommitdiffstats
path: root/Source/LexerParser/cmListFileLexer.c
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@gmail.com>2020-02-27 19:20:22 (GMT)
committerBrad King <brad.king@kitware.com>2020-03-03 13:42:13 (GMT)
commit598b676b5e77540b366b01b3c10154c2a633d23c (patch)
treeeb3aaea48e3c1743835a74be111ca64ee4a9a4e5 /Source/LexerParser/cmListFileLexer.c
parentc58b9c5ab94d674c76a17e6154f05e0e8c5c37d1 (diff)
downloadCMake-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.c14
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;
}
/*--------------------------------------------------------------------------*/