summaryrefslogtreecommitdiffstats
path: root/source/slang/lexer.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2018-10-12 22:02:09 -0400
committerGitHub <noreply@github.com>2018-10-12 22:02:09 -0400
commita7a87cec8c98872299e5dbe4c47a852a954b692b (patch)
tree46cb5e49f341175dfa4a812a05a60d5368d05a38 /source/slang/lexer.cpp
parentc9ad36868961009fcd67e579f9b51e1333688208 (diff)
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.
Diffstat (limited to 'source/slang/lexer.cpp')
-rw-r--r--source/slang/lexer.cpp10
1 files changed, 5 insertions, 5 deletions
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;