mirror of
https://github.com/NixOS/nix.git
synced 2025-11-15 23:12:44 +01:00
Move /src to /subprojects
This will facilitate breaking up Nix into multiple packages for each component with Meson.
This commit is contained in:
parent
4db9487823
commit
84e2963f8e
737 changed files with 504 additions and 505 deletions
30
subprojects/libexpr/lexer-helpers.cc
Normal file
30
subprojects/libexpr/lexer-helpers.cc
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#include "lexer-tab.hh"
|
||||
#include "lexer-helpers.hh"
|
||||
#include "parser-tab.hh"
|
||||
|
||||
void nix::lexer::internal::initLoc(YYLTYPE * loc)
|
||||
{
|
||||
loc->beginOffset = loc->endOffset = 0;
|
||||
}
|
||||
|
||||
void nix::lexer::internal::adjustLoc(yyscan_t yyscanner, YYLTYPE * loc, const char * s, size_t len)
|
||||
{
|
||||
loc->stash();
|
||||
|
||||
LexerState & lexerState = *yyget_extra(yyscanner);
|
||||
|
||||
if (lexerState.docCommentDistance == 1) {
|
||||
// Preceding token was a doc comment.
|
||||
ParserLocation doc;
|
||||
doc.beginOffset = lexerState.lastDocCommentLoc.beginOffset;
|
||||
ParserLocation docEnd;
|
||||
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->beginOffset = loc->endOffset;
|
||||
loc->endOffset += len;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue