Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analyzer-Wide Common Semantics API #22

Merged
merged 8 commits into from
Sep 3, 2024
Merged

Conversation

Eliah-Lakhin
Copy link
Owner

Fixes #15.

This Pull Request introduces two new features:

  1. Common Semantics Feature: A feature specified via the #[semantics(CommonSemanticsType)] attribute on the Node type, which describes semantics that will be shared across all documents managed by the Analyzer.
  2. New Slot Object: Similar to Attr, but without an associated computable function. The value of the Slot is edited directly by the API user.

Overall, the new API enables users to inject shared configuration metadata from the external environment into the Analyzer's semantic model, such as a mapping between file system file names and corresponding document IDs within the Analyzer. It also provides a way to introduce common computable semantic attributes, such as an attribute that collects diagnostic issues across all managed documents.

The API documentation, User Guide, and Examples have been updated accordingly.

@Eliah-Lakhin Eliah-Lakhin added the enhancement New feature proposal label Sep 3, 2024
@Eliah-Lakhin Eliah-Lakhin linked an issue Sep 3, 2024 that may be closed by this pull request
4 tasks
@Eliah-Lakhin Eliah-Lakhin merged commit 37932fb into master Sep 3, 2024
@Eliah-Lakhin Eliah-Lakhin deleted the issue-15-common-semantics branch September 3, 2024 19:13
Eliah-Lakhin added a commit that referenced this pull request Sep 3, 2024
Semantic Analysis Framework:

- #22: Introduced the new `Slot` object. This object is similar to `Attr`, except that its value is edited directly by the API user, and it does not have an associated computable function. This allows users to inject external metadata into the semantic model.
- #22: Implemented the common semantic feature. This feature enables the user to specify Analyzer-wide semantic graph nodes (attributes and slots) that are shared across all compilation units. These enhancements address the lack of global state within the Analyzer's semantic analysis framework and introduce a conventional method to organize cross-document relationships.

Lexer:

- #16: Introduced new `$xid_start` and `$xid_continue` Lexer Regex classes.
- #16: Added support for classes with combined Unicode properties: `${alpha | num}`.
- #16: Adjusted the `$alpha` class in accordance with UCD specifications.
- #16: Introduced the `lexis::Char` and `lexis::CharProperties` types in the main crate, enabling users to test characters for Unicode properties.
- #20: Added a new Token operator `i("abc")` that expands to case-insensitive matching.
- Fixed an edge-case bug in the Document (MutableUnit). The Mutable Document's lexer sometimes misinterpreted trailing token bounds when the user rewrote the end of the text.
- Fixed a minor bug in the `#[constructor]` attribute of the Token macro.

Syntax Parser:

- #19: Fixed a minor bug in the conflict resolutions of the Node macro's root rule.

Breaking Changes:

- #22: The `analysis::Feature` and `analysis::AbstractFeature` traits have received new members.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Global State Support for Semantic Analysis Framework
1 participant