mirror of
https://github.com/NixOS/nix
synced 2025-06-28 09:31:16 +02:00
libexpr: Rename "column" fields to offset
... because that's what they are.
This commit is contained in:
parent
77e9f9ee82
commit
71cb8bf509
4 changed files with 21 additions and 21 deletions
|
@ -4,7 +4,7 @@
|
|||
|
||||
void nix::lexer::internal::initLoc(YYLTYPE * loc)
|
||||
{
|
||||
loc->first_column = loc->last_column = 0;
|
||||
loc->beginOffset = loc->endOffset = 0;
|
||||
}
|
||||
|
||||
void nix::lexer::internal::adjustLoc(yyscan_t yyscanner, YYLTYPE * loc, const char * s, size_t len)
|
||||
|
@ -16,15 +16,15 @@ void nix::lexer::internal::adjustLoc(yyscan_t yyscanner, YYLTYPE * loc, const ch
|
|||
if (lexerState.docCommentDistance == 1) {
|
||||
// Preceding token was a doc comment.
|
||||
ParserLocation doc;
|
||||
doc.first_column = lexerState.lastDocCommentLoc.first_column;
|
||||
doc.beginOffset = lexerState.lastDocCommentLoc.beginOffset;
|
||||
ParserLocation docEnd;
|
||||
docEnd.first_column = lexerState.lastDocCommentLoc.last_column;
|
||||
docEnd.beginOffset = lexerState.lastDocCommentLoc.endOffset;
|
||||
DocComment docComment{lexerState.at(doc), lexerState.at(docEnd)};
|
||||
PosIdx locPos = lexerState.at(*loc);
|
||||
lexerState.positionToDocComment.emplace(locPos, docComment);
|
||||
}
|
||||
lexerState.docCommentDistance++;
|
||||
|
||||
loc->first_column = loc->last_column;
|
||||
loc->last_column += len;
|
||||
loc->beginOffset = loc->endOffset;
|
||||
loc->endOffset += len;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue