translatenix 207d0c78f0 Fix globbed read/import bugs (#449)
* Split MemberNode into (Regular/Shared)MemberNode

SharedMemberNode enables generating non-constant object members
at run time without generating an unbounded number of Truffle root nodes.

* Invert shouldRunTypeCheck to match its name

* Introduce VmObjectBuilder

Introduce VmObjectBuilder, a uniform way to build `VmObject`s
whose `ObjectMember`s are determined at run time.
Replace some manual object building code with VmObjectBuilder.
Add some assertions to fix IntelliJ warnings.

* Improve implementation of globbed read/import nodes

- Leverage SharedMemberNode to have a single Truffle root node per globbed
  read/import expression instead of one root node per resolved glob element.
- Remove caching in ReadGlobNode because it only works correctly if glob pattern is a string *constant*.
- Remove caching in StaticReadNode (now ReadGlobElementNode/ImportGlobElementNode)
  because it seems unnecessary and the implementation doesn't look quite right.

* Simplify code

* Fix ClassCastException when reflecting on globbed import

* Fix caching of globbed reads

Problem:
The result of a globbed read depends not only on the glob pattern but also on the current module URI.
However, ResourceManager does not take this into account when caching globbed reads, causing wrong results.

Changes:
- Cache globbed reads per read expression.
  This is also how globbed imports are cached, except that import URIs are constant.
- Make ReadGlobNode and ImportGlobNode code as similar as possible.
- Reduce code duplication by inheriting from AbstractReadNode.
- Add some tests.
2024-06-03 17:10:56 -07:00
2024-02-01 14:00:22 -08:00
2024-04-30 15:14:14 -07:00
2024-05-28 15:56:20 -07:00
2024-05-28 15:56:20 -07:00
2024-05-28 15:56:20 -07:00
2024-04-11 20:54:01 -07:00
2024-05-28 15:56:20 -07:00
2024-05-28 15:56:20 -07:00
2024-02-01 14:00:22 -08:00
2024-05-28 15:56:20 -07:00
2024-02-21 11:31:22 +00:00
2024-02-01 14:00:22 -08:00
2024-02-01 14:00:22 -08:00
2024-03-20 10:48:19 -07:00
2024-03-15 17:00:23 -07:00
2024-03-15 17:00:23 -07:00
2024-02-01 14:00:22 -08:00
2024-02-01 14:00:22 -08:00
2024-02-01 14:00:22 -08:00
2024-02-26 18:28:29 +01:00
2024-02-01 14:00:22 -08:00
2024-02-01 14:00:22 -08:00

= image:.idea/icon.svg[Pkl,30] Pkl 

:uri-homepage: https://pkl-lang.org
:uri-docs: {uri-homepage}/main/current
:uri-docs-introduction: {uri-docs}/introduction
:uri-docs-release-notes: {uri-docs}/release-notes
:uri-docs-language: {uri-docs}/language
:uri-docs-tools: {uri-docs}/tools
:uri-github-issue: https://github.com/apple/pkl/issues
:uri-github-discussions: https://github.com/apple/pkl/discussions
:uri-pkl-examples: https://pkl-lang.org/main/current/examples.html
:uri-installation: https://pkl-lang.org/main/current/pkl-cli/index.html#installation
:uri-lang-reference: https://pkl-lang.org/main/current/language-reference/index.html
:uri-ci-artifacts: https://s01.oss.sonatype.org/content/groups/public/org/pkl-lang/
:uri-ci-pipeline: https://app.circleci.com/pipelines/github/apple/pkl

A configuration as code language with rich validation and tooling.

== Quick Links

* {uri-installation}[Installation]
* {uri-lang-reference}[Language Reference]

== Documentation

* {uri-homepage}[Home Page]
** {uri-docs-introduction}[Introduction]
** {uri-docs-language}[Language]
** {uri-docs-tools}[Tools]
** {uri-pkl-examples}[Examples]
** {uri-docs-release-notes}[Release Notes]

== Community

We'd love to hear from you!

* Create an {uri-github-issue}[issue]
* Ask a question on {uri-github-discussions}[GitHub Discussions]

== Development image:https://circleci.com/gh/apple/pkl.svg?style=svg["Apple", link="https://app.circleci.com/pipelines/github/apple/pkl"]
* link:CONTRIBUTING.adoc[] for tips on pull requests and filing issues
* link:DEVELOPMENT.adoc[] for build instructions
* {uri-ci-artifacts}[Sonatype Repository] for the artifacts/binaries built by our {uri-ci-pipeline}[CI pipelines] (and those of our other tools and packages repositories).
Description
No description provided
Readme 29 MiB
Latest
2025-12-15 20:18:34 +01:00
Languages
Java 63.9%
Kotlin 30.3%
Pkl 5%
JavaScript 0.6%
CSS 0.2%