Skip to content

Conversation

@0xGeorgii
Copy link
Contributor

No description provided.

@0xGeorgii 0xGeorgii requested review from city-high-rider and Copilot and removed request for Copilot May 8, 2025 09:22
@0xGeorgii 0xGeorgii self-assigned this May 8, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds a new grammar rule for struct expressions while also modifying the handling of type definition symbols in function call expressions and updating the array literal rule.

  • Introduces a new struct_expression rule that parses a struct with a struct name, fields, and proper delimiters.
  • Replaces a literal ':' with $._typedef_symbol in function_call_expression to support type syntax consistency.
  • Updates the array_literal rule to allow empty arrays by wrapping the sep1 rule in an optional.
Files not reviewed (3)
  • debug.inf: Language not supported
  • src/grammar.json: Language not supported
  • src/node-types.json: Language not supported
Comments suppressed due to low confidence (2)

grammar.js:510

  • The modification in the array_literal rule now allows empty arrays, which is a functional change. If empty arrays are not intended, consider reverting to require at least one element or update the tests to reflect the desired behavior.
optional(sep1($._expression, ','))

grammar.js:197

  • Consider adding tests for the new struct_expression rule to ensure that all valid struct expressions are parsed as expected.
struct_expression: $ => seq(

… expressions

- Introduced a new file `struct.txt` containing a detailed example of a struct expression in the main function, demonstrating the initialization of a structure with various types of fields.
- Removed an empty line from the `binary.txt` file to clean up the code.
@0xGeorgii 0xGeorgii requested a review from Copilot May 8, 2025 09:41
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new grammar rule for struct expressions while updating the version numbers in key configuration files.

  • Adds a new struct_expression rule in grammar.js.
  • Updates version numbers in pyproject.toml and Cargo.toml.
  • Adjusts argument parsing in function_call_expression and refines string_literal and array_literal rules.

Reviewed Changes

Copilot reviewed 4 out of 11 changed files in this pull request and generated no comments.

File Description
pyproject.toml Updated version from 0.0.32 to 0.0.33.
grammar.js Added struct_expression rule and refined function_call_expression, string_literal, and array_literal rules.
Cargo.toml Updated version from 0.0.32 to 0.0.33.
Files not reviewed (7)
  • Makefile: Language not supported
  • debug.inf: Language not supported
  • package.json: Language not supported
  • src/grammar.json: Language not supported
  • src/node-types.json: Language not supported
  • test/corpus/expressions/binary.txt: Language not supported
  • test/corpus/expressions/struct.txt: Language not supported
Comments suppressed due to low confidence (2)

grammar.js:197

  • Consider adding tests to validate the new struct_expression grammar rule, ensuring it correctly parses various struct formats.
struct_expression: $ => seq(

grammar.js:510

  • Ensure there are tests for the updated array_literal rule to cover both empty and non-empty cases.
optional(sep1(

@0xGeorgii 0xGeorgii requested a review from Copilot May 18, 2025 04:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request introduces support for struct expressions in the grammar while also updating version numbers and making minor adjustments.

  • Introduces a new grammar rule for struct_expression.
  • Renames a field in struct_definition and updates function argument syntax for typedef symbols.
  • Bumps version numbers in pyproject.toml and Cargo.toml, and adds new utility files (index.js, highlight.js).

Reviewed Changes

Copilot reviewed 11 out of 25 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/tree_sitter/parser.h Removed redundant typedef for TSLanguageMetadata
pyproject.toml Version update from 0.0.32 to 0.0.33
index.js Adds binding setup and static data handling for Node integration
highlight.js Introduces a regex-based syntax highlighter for the Inference language
grammar.js Adds struct_expression rule and makes updates to struct_definition, function argument syntax, and literal rules
Cargo.toml Version update from 0.0.32 to 0.0.33
Files not reviewed (14)
  • .tree-sitter-config.json: Language not supported
  • Makefile: Language not supported
  • debug.inf: Language not supported
  • package.json: Language not supported
  • queries/highlights.scm: Language not supported
  • src/grammar.json: Language not supported
  • src/node-types.json: Language not supported
  • test/corpus/expressions/binary.txt: Language not supported
  • test/corpus/expressions/struct.txt: Language not supported
  • test/corpus/spec/basic_concepts.txt: Language not supported
  • test/corpus/spec/functions.txt: Language not supported
  • test/corpus/spec/general-description.txt: Language not supported
  • test/corpus/spec/lexical_structure.txt: Language not supported
  • test/corpus/spec/statements.txt: Language not supported
Comments suppressed due to low confidence (1)

grammar.js:312

  • [nitpick] Consider using a consistent field name for structure identification between struct_expression and struct_definition (e.g., both using 'struct_name' or 'name') to improve code clarity.
field('name', $.identifier),

@0xGeorgii 0xGeorgii merged commit 60b9be9 into main May 18, 2025
4 checks passed
@0xGeorgii 0xGeorgii deleted the add-struct-expression branch May 18, 2025 04:47
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.

2 participants