summaryrefslogtreecommitdiffstats
path: root/Source/cmListFileLexer.in.l
Commit message (Collapse)AuthorAgeFilesLines
* cmListFileLexer: Revise C++ coding style using clang-formatBrad King2016-05-171-151/+107
| | | | | | | Manually extract the C++ portion of `cmListFileLexer.in.l` into a temporary file, format it, and then move it back into the original file. Manually format C++ code inside the lexer actions to match our style. Then re-generate the lexer.
* cmListFileLexer: Update to flex 2.6Brad King2016-05-171-9/+6
| | | | | | Revise the documented modifications we need to make to the flex-generated source file according to the needs of the new version. Update our own implementation to avoid warnings with flex types.
* cmListFileLexer: Fix lexing of single '[' character (#15092)Brad King2014-08-181-0/+7
| | | | | | | | The lexer changes in commit v3.0.0-rc1~495^2 (Add Lua-style long brackets and long comments to CMake language, 2013-08-06) accidentally left out matching '[' as a single character in an unquoted argument. Add a lexer rule to match it and extend the RunCMake.Syntax test to cover this case.
* Use cmsys::[io]fstream instead of cmsys_ios::[io]fstream.Clinton Stimpson2014-01-071-0/+9
| | | | | Also use SystemTools::Fopen() instead of fopen(). This is to eventually support utf-8 filenames.
* Add \-continuation to CMake language quoted argumentsBrad King2013-10-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Teach the CMake language lexer to treat the \-LF pair terminating a line ending in an odd number of backslashes inside a quoted argument as a continuation. Drop the pair from the returned quoted argument token text. This will allow long lines inside quoted argument strings to be divided across multiple lines in the source file. It will also allow quoted argument text to start on the line after the opening quote. For example, the code: set(x "\ ...") sets variable "x" to the value "..." with no opening newline. Previously an odd number of backslashes at the end of a line inside a quoted argument would put a \-LF pair (or a \-CR pair) literally in the argument. Then the command-argument evaluator would complain that the \-escape sequence is invalid. Therefore this syntax is available to use without changing behavior of valid existing code. Teach the RunCMake.Syntax test to cover cases of quoted arguments with lines ending in \, \\, and \\\. Odd counts are continuations.
* Add Lua-style long brackets and long comments to CMake languageBrad King2013-10-171-6/+89
| | | | | | | | | | | | | | | | | Teach the CMake language parser to recognize Lua-style "long bracket" arguments. These start with two '[' separated by zero or more '=' characters e.g. "[[" or "[=[" or "[==[". They end with two ']' separated by the same number of '=' as the opening bracket. There is no nesting of brackets of the same level (number of '='). No escapes, variable expansion, or other processing is performed on the content between such brackets so they always represent exactly one argument. Also teach CMake to parse and ignore "long comment" syntax. A long comment starts with "#" immediately followed by an opening long bracket. It ends at the matching close long bracket. Teach the RunCMake.Syntax test to cover long bracket and long comment cases.
* cmListFileLexer: Convert CRLF -> LF newlines explicitlyBrad King2013-10-171-2/+34
| | | | | | | | | | | Read input files in binary mode instead of text mode and convert CRLF newlines to LF newlines explicitly in our own buffer. This is necessary to read CMake source files with CRLF newlines on platforms whose C runtime libraries do not transform newlines in text mode. For example, a Cygwin or Linux binary may not transform CRLF -> LF in files read from a Windows filesystem. Perform the conversion ourselves to ensure that multi-line string literals in CMake source files have LF newlines everywhere.
* cmListFileLexer: Allow a leading UTF-8 Byte-Order-Mark (#11137)Brad King2013-10-171-4/+53
| | | | | | Teach the lexer to read a UTF-8, UTF-16 BE/LE, or UTF-32 BE/LE Byte-Order-Mark from the start of a file if any is present. Report an error on files using UTF-16 or UTF-32 and accept a UTF-8 or missing BOM.
* cmListFileLexer: Allow command names with one letter (#14181)Brad King2013-10-171-1/+1
| | | | | | | | | Teach the lexer to treat a single letter as an identifier instead of an unquoted argument. Outside of a command invocation, the parser treats an identifier as a command name and an unquoted argument as an error. Inside of a command invocation, the parser treats an identifier as an unquoted argument. Therefore this change to the lexer will make what was previously an error case work with no other behavioral change.
* cmListFileLexer: Fix leak on error before EOFBrad King2013-09-171-0/+1
| | | | | | | Teach cmListFileLexerDestroy to call cmListFileLexerSetToken with a NULL token to free the token string buffer. Without this, if an error occurs before the token cleanup happens when EOF is reached, then the token string buffer may leak.
* cmListFileLexer: Modify flex output to avoid Borland warningBrad King2013-08-081-0/+1
| | | | | | Remove the "yyscanner = NULL" assignment from the end of the yylex_destroy function because Borland warns that the value is never used.
* Warn about arguments not separated by whitespaceBrad King2013-08-081-1/+5
| | | | | | | | | | | Teach the lexer to return tokens for whitespace. Teach the parser to tolerate the space tokens where whitespace is allowed. Also teach the parser to diagnose and warn about cases of quoted arguments followed immediately by another argument. This was accidentally allowed previously, so we only warn. Update the RunCMake.Syntax test case StringNoSpace expected stderr to include the warnings.
* cmListFileLexer: Split normal and legacy unquoted argumentsBrad King2013-08-081-1/+10
| | | | | Match legacy arguments separately. Add macros to simplify and clarify matching rules.
* cmListFileLexer: Fix line number after backslash in stringBrad King2013-08-081-1/+7
| | | | | | If a line inside a string ends in a backslash count the following newline character as a line increment. Add a test covering this case to verify that subsequent line numbers are correct.
* Document removal of 'register' from flex/bison outputBrad King2013-06-281-0/+1
| | | | | | In each .l and .y input file that has instructions for manual transformation of the output to include a step to remove the 'register' storage specifier.
* Convert CMake to OSI-approved BSD LicenseBrad King2009-09-281-14/+9
| | | | | | | This converts the CMake license to a pure 3-clause OSI-approved BSD License. We drop the previous license clause requiring modified versions to be plainly marked. We also update the CMake copyright to cover the full development time range.
* COMP: Fix warnings produced by the change in include order from the ↵Brad King2006-08-091-5/+1
| | | | re-organization of lexer code.
* COMP: Moved duplicate flex-generated lexer warning suppression and ↵Brad King2006-08-081-22/+4
| | | | cross-platform support code to a single cmStandardLexer.h included by all lexer sources. Added fix for macro redefinitions on Borland 5.8 compiler.
* COMP: Fix and/or disable warnings for Borland 5.6 build.Brad King2006-08-011-0/+5
|
* BUG: When an unquoted argument contains a pair of matching double quotes ↵Brad King2005-09-191-1/+1
| | | | spaces and tabs should be allowed in-between. This allows arguments like -DFOO='"bar zot"' to work.
* BUG: Unquoted arguments can have quotes that are not at the beginning, but ↵Brad King2005-08-011-1/+1
| | | | only an even number of them.
* COMP: Defining YY_NO_INPUT to remove compilation of unused yyinput function. ↵Brad King2005-03-151-0/+1
| | | | It was producing a warning about unreachable code.
* ENH: Mangled lexer symbols to begin in cmListFileLexer_yy instead of just yy ↵Brad King2005-01-191-7/+7
| | | | to avoid conflict with other lexers that may be added.
* BUG#1179: Fix for syntax in unquoted arguments.Brad King2004-09-201-1/+3
|
* BUG#1049: Added error message when file ends in an unterminated string.Brad King2004-08-311-1/+27
|
* BUG: Fixed parsing of unquoted arguments to allow double-quotes within the ↵Brad King2004-06-181-1/+1
| | | | argument.
* ENH: Added cmListFileLexer_SetString method to allow a string to be parsed ↵Brad King2004-04-211-9/+91
| | | | as input.
* ERR: Removed YY_BREAK statements after return statements because they are ↵Brad King2003-12-091-0/+1
| | | | unreachable.
* ERR: Added missing static keyword to cmListFileLexerSetToken and ↵Brad King2003-12-091-4/+4
| | | | cmListFileLexerAppend definitions.
* ERR: Fixed comment about how to run flex to reflect new name of this file.Brad King2003-12-081-1/+1
|
* ERR: Renaming cmListFileLexer.l to cmListFileLexer.in.l to avoid make ↵Brad King2003-12-081-0/+327
programs trying to run lex automatically whn building cmListFileLexer.c.