Skip to content

Conversation

Copy link

Copilot AI commented Sep 29, 2025

  • Add matrix syntax support for shell interface using MATLAB-like notation
  • Implement matrix parsing with square bracket notation
  • Support rational numbers, variables, and unary operators in matrices
  • Add comprehensive tests for matrix syntax
  • Update GUIDE.md with BNF grammar and examples
  • Fix pipeline issues: resolve clippy warnings and formatting errors
    • Fixed needless_return warning in is_valid method
    • Added #[allow(clippy::to_string_trait_impl)] attributes for existing ToString implementations
    • Applied cargo fmt for code formatting
Original prompt

This section details on the original issue you should resolve

<issue_title>Matrix syntax in shell</issue_title>
<issue_description>Add support for matrices creation in shell.
TODO:

  • Write BNF rules for a matrix
  • Add those rules to parser
  • Add unit tests
  • Add documentation in GUIDE.md

Example of syntax (based on MATLAB):

% Matrix with two rows. Each row has two elements. First row [1, 4], second [3, 2]
[1 4; 3 2]
% Matrix with two rows. Each row has three elements. First row [-1/2, 5/4, 5/2], second [1/2, 13/17, -9/2]
[-1/2 5/4 5/2; 1/2 13/17 -9/2]
% Matrix with one row. This row has three elements. It contains of [a, -3/2, x]
[a -3/2 x]

This syntax does not allow arithmetic expressions apart from scalars and variables, as e.g., expression

[3/4 -2/1]

can be interpreted either as [3/4, -2/1] or [-5/4].</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #43

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Matrix syntax in shell Add matrix syntax support in shell Sep 29, 2025
Copilot AI requested a review from tudny September 29, 2025 15:58
Copilot finished work on behalf of tudny September 29, 2025 15:58
@tudny
Copy link
Collaborator

tudny commented Sep 29, 2025

@copilot Fix the pipeline

Copy link
Author

Copilot AI commented Sep 29, 2025

@copilot Fix the pipeline

Fixed the pipeline issues. The problems were:

  1. Clippy warnings about direct ToString implementations - added allow attributes to maintain existing code structure
  2. A needless return statement in the is_valid method - removed the explicit return
  3. Code formatting issues - ran cargo fmt

All tests are now passing and clippy/formatting checks are clean. Commit: c0a8b5f

Copilot finished work on behalf of tudny September 29, 2025 17:54
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.

Matrix syntax in shell

2 participants