Closed
Description
Currently, Source
has at least three distinct responsibilities:
- Load source code from different origins
- Cache source code once loaded
- Work with source text (
SourceSection
, etc.)
I'm happy with how Source
handles 3, but have different requirements for 1 and 2 (i.e. I need full control over them). Can these responsibilities be extracted into separate classes (e.g. SourceLoader
) that are not mandatory for using the PolyglotEngine
/TruffleLanguage
/Source
APIs? Also, can you add a way to set the URI for a(ny) Source
, so that its origin can be cleanly attached?