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

move basic types to pest3_core #16

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tomtau
Copy link
Contributor

@tomtau tomtau commented Aug 6, 2024

Summary by CodeRabbit

  • New Features

    • Introduced a new core module for improved parsing functionalities in the pest3 library.
    • Added support for conditional features in the pest project to enhance modularity.
  • Bug Fixes

    • Refined dependency management by replacing references to pest3 with pest3_core.
  • Documentation

    • Updated configuration files to better reflect package organization and dependency management.
  • Refactor

    • Reorganized module exports for clearer structure and direct access to pest3_core functionalities.
    • Removed the unicode! macro to streamline Unicode property handling.

Copy link

coderabbitai bot commented Aug 6, 2024

Warning

Rate limit exceeded

@tomtau has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 9 minutes and 10 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between 4b5818c and f99e56a.

Walkthrough

The changes introduce a new core module, pest3_core, into the Rust workspace, enhancing the structure and organization of the project. Dependencies have been refined, with pest3_core replacing pest3 in various files, promoting modularity and clarity. The Cargo.toml files have been updated to reflect new features and dependencies, while the main library’s module structure has been adjusted to improve encapsulation and usability. Overall, these modifications aim to streamline development and dependency management.

Changes

File(s) Change Summary
Cargo.toml Added core to workspace members.
core/Cargo.toml Introduced new Cargo.toml for pest3_core with essential metadata and dependencies on unicode-width and pest2.
core/src/lib.rs Created core module with public sub-modules and re-exported standard library types. Introduced unicode! macro for Unicode parsing functionalities.
generator/Cargo.toml Replaced dependency on pest3 with pest3_core.
generator/src/typed/module.rs Changed import from pest3 to pest3_core for unicode_property_names.
pest/Cargo.toml Added new [features] section and dependencies for pest3_core and pest3_derive.
pest/src/lib.rs Re-exported modules from pest3_core, removed unicode! macro, and added conditional re-export for Parser based on features.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Pest
    participant Core

    User->>Pest: Use parsing functionality
    Pest->>Core: Access core parsing functions
    Core-->>Pest: Return parsing results
    Pest-->>User: Deliver results
Loading

Poem

🐇 In the fields where rabbits play,
New paths are forged, bright as day.
With core now added, oh what delight,
Parsing dreams take joyful flight!
Dependencies shift, like leaves in the breeze,
In our Rusty world, we're happy as can be! 🌼✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@tomtau tomtau linked an issue Aug 6, 2024 that may be closed by this pull request
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1bb36b1 and 4803a9d.

Files selected for processing (7)
  • Cargo.toml (1 hunks)
  • core/Cargo.toml (1 hunks)
  • core/src/lib.rs (1 hunks)
  • generator/Cargo.toml (1 hunks)
  • generator/src/typed/module.rs (1 hunks)
  • pest/Cargo.toml (1 hunks)
  • pest/src/lib.rs (2 hunks)
Files skipped from review due to trivial changes (2)
  • generator/Cargo.toml
  • generator/src/typed/module.rs
Additional comments not posted (21)
core/Cargo.toml (2)

1-7: Metadata section looks good.

The metadata section correctly uses workspace settings for version, authors, edition, description, and license.


9-11: Dependencies section looks good.

The dependencies are correctly set to use workspace settings.

pest/Cargo.toml (2)

9-11: Features section looks good.

The new features section correctly defines an empty default feature set and a derive feature that depends on pest3_derive.


14-15: Dependencies section looks good.

The new dependencies on pest3_core and pest3_derive are correctly added, with pest3_derive marked as optional.

Cargo.toml (1)

2-2: Workspace members update looks good.

The new core member is correctly added to the list of workspace members.

pest/src/lib.rs (8)

6-8: LGTM! Re-exporting the choice module.

This change promotes modularity by re-exporting the choice module from pest3_core.


9-11: LGTM! Re-exporting the formatter module.

This change promotes modularity by re-exporting the formatter module from pest3_core.


12-14: LGTM! Re-exporting the position module.

This change promotes modularity by re-exporting the position module from pest3_core.


15-17: LGTM! Re-exporting the sequence module.

This change promotes modularity by re-exporting the sequence module from pest3_core.


18-20: LGTM! Re-exporting the span module.

This change promotes modularity by re-exporting the span module from pest3_core.


21-23: LGTM! Re-exporting the token module.

This change promotes modularity by re-exporting the token module from pest3_core.


24-26: LGTM! Re-exporting the typed module.

This change promotes modularity by re-exporting the typed module from pest3_core.


44-45: LGTM! Conditionally re-exporting the Parser.

This change promotes flexibility by conditionally re-exporting the Parser from pest3_derive based on the derive feature flag.

core/src/lib.rs (8)

6-6: LGTM! Declaring the choice module.

This change declares the choice module.


7-7: LGTM! Declaring the formatter module.

This change declares the formatter module.


8-8: LGTM! Declaring the position module.

This change declares the position module.


9-9: LGTM! Declaring the sequence module.

This change declares the sequence module.


10-10: LGTM! Declaring the span module.

This change declares the span module.


11-11: LGTM! Declaring the token module.

This change declares the token module.


12-12: LGTM! Declaring the typed module.

This change declares the typed module.


31-69: LGTM! Defining the unicode macro.

This macro generates a Unicode property type with various implementations for parsing and checking characters based on the specified Unicode property.

@tomtau
Copy link
Contributor Author

tomtau commented Aug 6, 2024

@TheVeryDarkness I refactored the crates a bit, so that it can be a single crate dependency on the client side.
The tests fail at the moment, because the generated code uses ::pest3::* paths (and the tests in those crates don't import pest3 in order not to create a circular dependency). I'm not yet sure whether this issue would also show up in the client code (I guess not?) and what the best fix for this is

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (1)
pest/src/lib.rs (1)

44-45: Issues found with the removal of the unicode macro.

The unicode macro is still being used in several files. Its removal from pest/src/lib.rs without updating its usage elsewhere will break the code. Please ensure that all occurrences of the unicode macro are either updated or removed.

  • Files affected:
    • pest/tests/predefined_node.rs
    • core/src/typed/unicode.rs
    • pest/src/bin/unicode.rs
Analysis chain

Verify the impact of removing the unicode macro.

The removal of the unicode macro might affect existing functionality. Ensure that all usages of this macro are updated or removed.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of removing the `unicode` macro.

# Test: Search for the macro usage. Expect: No occurrences of the macro.
rg --type rust $'unicode!'

Length of output: 14555

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 4803a9d and 4b5818c.

Files selected for processing (1)
  • pest/src/lib.rs (2 hunks)
Additional comments not posted (8)
pest/src/lib.rs (8)

6-8: Re-export of choice module looks good.

The re-export enhances modularity by consolidating the choice module within pest3_core.


9-11: Re-export of formatter module looks good.

The re-export enhances modularity by consolidating the formatter module within pest3_core.


12-14: Re-export of position module looks good.

The re-export enhances modularity by consolidating the position module within pest3_core.


15-17: Re-export of sequence module looks good.

The re-export enhances modularity by consolidating the sequence module within pest3_core.


18-20: Re-export of span module looks good.

The re-export enhances modularity by consolidating the span module within pest3_core.


21-23: Re-export of token module looks good.

The re-export enhances modularity by consolidating the token module within pest3_core.


24-26: Re-export of typed module looks good.

The re-export enhances modularity by consolidating the typed module within pest3_core.


44-45: Conditional re-export of Parser looks good.

The conditional re-export aligns with the feature flag usage, allowing for flexible compilation configurations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor: single crate dependency
1 participant