Avoid keeping the SourceText
instance around in SyntaxTree
#45
Labels
area: analysis
Issues related to language analyses.
area: build
Issues related to the build system.
area: driver
Issues related to the command line driver.
type: feature
Issues that are classified as feature requests.
Milestone
celerity/src/language/core/Syntax/SyntaxAnalysis.cs
Lines 6 to 9 in 18c5d49
This is neat because, for the happy case, we don't need to access the
SourceText
at all. Only when there are diagnostics do we need to access line information from theSourceText
, and it's reasonable to just reconstruct it for those cases.Even then, we still have to keep the
SourceText
around during parsing in order to construct locations for diagnostics. To remedy that, we should probably also consider changingSourceDiagnostic
to not carry aSourceLocation
, but rather aSourceTextSpan
and aSyntaxItem
reference. ASourceDiagnostic.GetLocation()
method could then be exposed which would resolve theSourceLocation
.The text was updated successfully, but these errors were encountered: