Skip to content

Decouple responsibilities of Source class #185

Closed
@pniederw

Description

@pniederw

Currently, Source has at least three distinct responsibilities:

  1. Load source code from different origins
  2. Cache source code once loaded
  3. 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?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions