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

Perl 6 variables #2909

Closed
MadcapJake opened this issue Mar 24, 2016 · 4 comments
Closed

Perl 6 variables #2909

MadcapJake opened this issue Mar 24, 2016 · 4 comments

Comments

@MadcapJake
Copy link

For some reason, my variable rule is being skipped (or not catching) by linguist (Atom/Highlights has no problem with it though).

Here's the rule to save you from clicking a link. It's in the variable entry of the repository and I'm sure it's not catching because the sigil ($, @, %, &) is left as bare text.

        {
          'match': '(?x)
            (\\$|@|%|&)
            (\\.|\\*|:|!|\\^|~|=|\\?)?
            (
              (?:\\p{Alpha})
              (?:
                [a-zA-Z0-9_\xc0-\xff\\$]|
                [\\-\'][a-zA-Z_\xc0-\xff\\$]
              )*
            )'
          'captures':
            '1':
              'name': 'variable.other.identifier.sigil.perl6fe'
            '2':
              'name': 'support.class.twigil.perl6fe'
            '3':
              'name': 'variable.other.identifier.perl6fe'
          'name': 'meta.variable.container.perl6fe'
        }
@pchaigno
Copy link
Contributor

We've had the same kind of grammar interpretation differences in the past between Sublime Text and Linguist. What was happening is that GitHub and Sublime Text were using different regexp processors: GitHub uses a PCRE-based engine whereas Sublime Text uses Oniguruma. I don't know what Atom is using but it could be the same kind of discrepancies.

You should try to tweak your regular expressions. In particular, I'd try to replace \\p{Alpha} ;)

@MadcapJake
Copy link
Author

Thanks for your reply! Yes I do believe this is the issue. Atom does indeed use Oniguruma and I have tried to take advantage of this fact. I will see what I can do to fix this while still remaining compatible with both engines.

@MadcapJake
Copy link
Author

@pchaigno That property was definitely the blocker for this rule! I've updated my repo and tried with Lightshow and it works perfectly.

Should I submit a PR to update the submodule or could someone just bump it to the latest commit?

@pchaigno
Copy link
Contributor

@pchaigno That property was definitely the blocker for this rule! I've updated my repo and tried with Lightshow and it works perfectly.

Glad I could help 😄

Should I submit a PR to update the submodule or could someone just bump it to the latest commit?

No need, it'll be automatically updated with the next release of Linguist ;)

@pchaigno pchaigno closed this as completed Dec 4, 2016
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