From a7a87cec8c98872299e5dbe4c47a852a954b692b Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Fri, 12 Oct 2018 22:02:09 -0400 Subject: Feature/source loc review (#672) * Fixes/improvements based around review comments. * SourceUnit -> SourceView * * Removed the HumaneSourceLoc as it's POD-like ness seemed to make that unnecessary * Made exposed member variables in SourceManager protected - so make clear where/how can be accesed * Improved description about SourceLoc and associated structures * Changed SourceLocType to 'Actual' and 'Nominal'. * Improved a comment. --- source/slang/lexer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/slang/lexer.cpp') diff --git a/source/slang/lexer.cpp b/source/slang/lexer.cpp index 339d98d49..918668296 100644 --- a/source/slang/lexer.cpp +++ b/source/slang/lexer.cpp @@ -84,22 +84,22 @@ namespace Slang // Lexer void Lexer::initialize( - SourceUnit* inSourceUnit, + SourceView* inSourceView, DiagnosticSink* inSink, NamePool* inNamePool) { - sourceUnit = inSourceUnit; + sourceView = inSourceView; sink = inSink; namePool = inNamePool; - auto content = inSourceUnit->getSourceFile()->content; - + auto content = inSourceView->getContent(); + begin = content.begin(); cursor = content.begin(); end = content.end(); // Set the start location - startLoc = inSourceUnit->getRange().begin; + startLoc = inSourceView->getRange().begin; tokenFlags = TokenFlag::AtStartOfLine | TokenFlag::AfterWhitespace; lexerFlags = 0; -- cgit v1.2.3