Skip to content

Conversation

@LunaStev
Copy link
Member

@LunaStev LunaStev commented Jun 28, 2025

Added to parameters to support ptr, array.

Summary by CodeRabbit

  • Bug Fixes

    • Improved parsing of generic types in function parameters for more accurate handling and better error messages.
    • Corrected the signedness of integer values in inline assembly input handling to ensure proper interpretation as signed integers.
  • Style

    • Enhanced error messages with clearer formatting and updated error prefixes.
    • Minor formatting improvements for code clarity.

@LunaStev LunaStev self-assigned this Jun 28, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jun 28, 2025

Walkthrough

The changes enhance the parsing of generic types in function parameters within the parser, improving token handling and error messaging. Additionally, the signedness flag for constant integer creation in LLVM IR generation is corrected. Minor formatting and error message updates are also included, with no changes to public interfaces.

Changes

File(s) Change Summary
front/parser/src/parser/parser.rs Refined generic type parsing in function parameters, improved error reporting, and minor formatting.
llvm_temporary/src/llvm_temporary/statement.rs Changed constant integer creation to use signed values for inline assembly input operands.

Sequence Diagram(s)

sequenceDiagram
    participant Parser
    participant TokenStream

    Parser->>TokenStream: Consume ':'
    alt Next token is identifier and '<'
        Parser->>TokenStream: Parse base type
        Parser->>TokenStream: Parse generic inner tokens (handle nested '<', '>')
        Parser->>Parser: Build full generic type string
        Parser->>Parser: Convert to TokenType and WaveType
    else Next token is identifier
        Parser->>Parser: Convert identifier to TokenType and WaveType
    else Other token
        Parser->>Parser: Attempt conversion or report error
    end
Loading

Possibly related PRs

  • LunaStev/Wave#201: Also modifies parse_parameters in front/parser/src/parser/parser.rs to enhance generic type parsing by consuming tokens until matching angle brackets, directly related to the changes in this PR.

Poem

In the warren of code, a parser hops,
Now catching generics, it never stops!
With brackets and tokens, it’s clever and spry,
Error messages clearer, no need to ask why.
LLVM’s numbers now signed with care,
This bunny’s proud of the changes there! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 17e4f22 and 981dfd9.

📒 Files selected for processing (2)
  • front/parser/src/parser/parser.rs (4 hunks)
  • llvm_temporary/src/llvm_temporary/statement.rs (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: LunaStev
PR: LunaStev/Wave#154
File: llvm_temporary/src/llvm_temporary/llvm_codegen.rs:746-799
Timestamp: 2025-05-05T10:39:34.489Z
Learning: The inline assembly implementation in the Wave programming language will be enhanced in a future version with complete support for multiple output constraints, clobber lists, and better validation.
🔇 Additional comments (3)
front/parser/src/parser/parser.rs (2)

70-134: Well-implemented generic type parsing!

The enhanced parsing logic correctly handles generic types like ptr<T> and array<T, size> with proper depth tracking for nested generics. This implementation aligns perfectly with the PR objective to add support for pointer and array parameters.


28-29: Consistent error message improvements

Good addition of the "❌" prefix to error messages throughout the file. This visual indicator makes errors more noticeable in terminal output.

Also applies to: 34-35, 104-105, 109-110, 117-118, 126-127, 131-132, 237-238, 252-253, 304-305, 373-374, 395-396, 619-620, 738-739

llvm_temporary/src/llvm_temporary/statement.rs (1)

526-526: No inline assembly usages detected—signedness change is safe

  • Searched for asm! and llvm_asm! macros across all Rust files—no usages found.
  • Only internal codegen paths touch inline-asm constants (statement.rs, expression.rs), and there are currently no tests or consumer code relying on unsigned literals.
  • This signedness flag update will not affect any existing code in the repository.

Please add/update tests and documentation when full inline-assembly support is introduced.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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>, please review it.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 using 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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

@LunaStev LunaStev added this to Wave Jun 28, 2025
@LunaStev LunaStev added the bug A problem that causes incorrect behavior or crashes. label Jun 28, 2025
@LunaStev LunaStev merged commit a080731 into master Jun 28, 2025
2 checks passed
@github-project-automation github-project-automation bot moved this to Done in Wave Jun 28, 2025
@LunaStev LunaStev deleted the param-bug-fix branch July 19, 2025 12:26
@LunaStev LunaStev added this to Wave Aug 28, 2025
@LunaStev LunaStev moved this to Done in Wave Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug A problem that causes incorrect behavior or crashes.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants