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

Overzealous warnings with the Syntax Test - Regex Compatibility build system #2465

Open
keith-hall opened this issue Oct 29, 2018 · 0 comments

Comments

@keith-hall
Copy link
Collaborator

Summary

The Syntax Test - Regex Compatibility build system warns about variables that are incompatible with sregex without checking the context in which those variables are applied.

Expected behavior

Variables would not be checked for compatibility directly, only the (expanded) match patterns should be checked and reported on.

Actual behavior

Packages/User/test-var-with-backref.sublime-syntax:6:12: Back references are unsupported
FAILED: 1 pattern in "Packages/User/test-var-with-backref.sublime-syntax" are incompatible with the new regex engine
[Finished]

Steps to reproduce

  • Create a syntax definition with the following content:
%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
scope: source.test-var-with-backref
variables:
  testme: '\1'
contexts:
  main:
    - match: (hello)
      scope: constant.language
      push:
        - match: '{{testme}}'
          scope: keyword.other
          pop: true
  • Save it, for example as Packages/User/test-var-with-backref.sublime-syntax
  • Tools menu -> Build With...
  • Syntax Tests - Regex Compatibility
  • See the warning despite there not being any if the {{testme}} reference is replaced with the contents of the variable directly and the variable definition removed.

Environment

  • Operating system and version:
    • Windows 10
  • Monitor:
    • Resolution: 1920x1080
    • dpi_scale used in ST: 0
    • ui_scale: 1.0
    • DPI mode: per-monitor v2
  • Sublime Text:
    • Build 3180
    • 64 bit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant