summaryrefslogtreecommitdiffstats
path: root/src/lexer.cc
Commit message (Collapse)AuthorAgeFilesLines
* rename a variableNico Weber2018-04-061-5/+5
|
* Improve location of error messages around identifiers.Nico Weber2018-04-061-2/+7
| | | | | | | | | | Lexer::ReadIdent() now sets last_token_ before returning, like Lexer::ReadEvalString() does. So all "expected identifiers" and things that call ReadIdent (pool parser, rule parser, let parser, code parsing the rule name after a : in a build line) now point the "^ near here" at what was there instead of the previous last_token According to manifest_parser_perftest, this is perf-neutral.
* CanonicalizePath handles \ on WindowsScott Graham2014-10-301-221/+272
|
* block parse method doneRobert Iannucci2012-11-101-183/+206
|
* windows: fix size_t<->int conversions in ninja.exeEvan Martin2012-08-101-1/+1
|
* reject tabs (and CRs) in input files more aggressivelyEvan Martin2012-08-021-18/+19
|
* Revert "Make StringPiece data members private."Nico Weber2012-07-281-3/+3
| | | | | | This reverts commit 904c9610fe66c4f4bd63a07d6f057c8603d24394. The commit caused issue #380, this revert fixes it. The revert also makes the test from the previous commit pass.
* Merge pull request #352 from tfarina/string-piece-privateEvan Martin2012-07-271-3/+3
|\ | | | | Make StringPiece data members private.
| * Make StringPiece data members private.Thiago Farina2012-06-301-3/+3
| | | | | | | | Signed-off-by: Thiago Farina <tfarina@chromium.org>
* | disallow crlf in manifest filesEvan Martin2012-07-181-51/+59
|/ | | | | | | | | | | | | | | It turns out to be trickier than expected to process these correctly. It turns out to also be trickier than expected to give a nice error message on encountering these. But the behavior prior to this patch would just be silent failures where we attempted to examine paths that accidentally contained embedded \r. For now, fix all regexes of the form [^...] to include \r in the excluded block, then assert that we get a vague lexer error near the problem. In the future perhaps we can open manifest files in text mode on Windows or just disallow Windows-style CRLF in the manual.
* allow UTF-8 in rule descriptionsEvan Martin2012-04-261-4/+4
| | | | | The lexer already mostly allowed this, except that chars >127 were being interpreted as negative indexes into the lexer table.
* parse $:Peter Kuemmel2012-01-291-0/+20
| | | | | '$:' is a valid string now, it expands to ':' update error messages and show a hint when something went wrong.
* add colon escapingPeter Kuemmel2012-01-291-21/+31
| | | | | | | | Needed for Windows drive names. For instance configure with gtest: python configure.py --with-gtest=c$:\gtest-1.6.0
* Lexer: include leading spaces in the newline token.Evan Jones2012-01-051-84/+90
| | | | This means that indented blank lines are skipped without causing errors.
* make Lexer::Error not emit trailing newlineEvan Martin2012-01-051-1/+1
| | | | | Now it's consistent with other errors. Fixes part of issue #187.
* Lexer: include leading whitespace in the comment token.Evan Jones2012-01-051-53/+63
| | | | Indented comments are ignored rather than causing errors.
* windows: more build fixesScott Graham2012-01-041-0/+1
|
* allow hyphen in variable namesEvan Martin2011-12-301-16/+24
|
* make evalstring internals privateEvan Martin2011-12-301-6/+6
|
* switch the core ninja parser to use re2c for the lexerEvan Martin2011-12-291-0/+729
- Delete the old "Tokenizer" code. - Write separate tests for the lexer distinct from the parser. - Switch the parser to use the new code. - New lexer error output has file:line numbers so e.g. Emacs can jump your editor to the syntax error. - The EvalEnv ($-interpolation) code is now part of the lexer as well.