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

Escaping of Square Brackets Not Working #12

Open
zyf722 opened this issue Jan 15, 2024 · 2 comments
Open

Escaping of Square Brackets Not Working #12

zyf722 opened this issue Jan 15, 2024 · 2 comments

Comments

@zyf722
Copy link

zyf722 commented Jan 15, 2024

Hi there,

I've encountered an issue with the escaping of square brackets in RSyntaxTree 1.2.10, which I'm currently using for building syntax parse trees for multi-dimensional array references.

It seems that the parser is not correctly escaping the [ and ] characters. Here's the code that reproduces the issue:

[expr
  [id x
  
  ]
  [suffix
    \[
    [id 2
    
    ]
    \]
    [suffix
      \[
      [id 3
      
      ]
      \]
      [suffix
        \[
        [id 4
        
        ]
        \]
      ]
    ]
  ]
]

This will generate the following tree, which is incorrect:
image

By replace all \[ and \] with \( and \), an expected tree could be generated:
image

Any assistance or guidance would be greatly appreciated.

@yohasebe
Copy link
Owner

Hi, sorry for my belated response.

Thank you for pointing out this issue that happens when a pair of escaped brackets is embedded within another.

I cannot say when it is possible, but I'll try to solve the issue the next time I work on the code!

@yohasebe
Copy link
Owner

This problem has been corrected in version 1.3.1.

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

No branches or pull requests

2 participants