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

Support substitution #67

Merged
merged 15 commits into from
Oct 30, 2022
Merged

Support substitution #67

merged 15 commits into from
Oct 30, 2022

Conversation

odashi
Copy link
Collaborator

@odashi odashi commented Oct 29, 2022

Overview

Add codegen rules for subscription x[i][j][...] -> $x_{i,j,...}$.
CC: @MAKMED1337

Details

Codegen strategy:

  1. Converts nested ast.Subscript to a tuple of the root value and the sequence of indices.
  2. Applies the codegen rule {value}_{", ".join(indices)}

References

Fixes #52

Blocked by

NA

@odashi odashi added this to the v0.2 milestone Oct 29, 2022
@odashi odashi added the feature label Oct 29, 2022
@odashi
Copy link
Collaborator Author

odashi commented Oct 29, 2022

Test is failing due to syntax incompatibility in some versions. Fixing it

Copy link
Collaborator

@ShigekiKarita ShigekiKarita left a comment

Choose a reason for hiding this comment

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

LGTM. Maybe latexify should provide a flag to opt-out this like use_raw_function_name (for example use_raw_subscript).

@odashi odashi merged commit 1df1a44 into main Oct 30, 2022
@odashi odashi deleted the 50-support-substitution branch October 30, 2022 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support indicies
2 participants