Skip to content

Conversation

bcrotty
Copy link
Contributor

@bcrotty bcrotty commented Dec 12, 2014

Fixes several issues:
229: Correctly highlights the operators -clt, -cle, -cgt, -cge
235: Fixes issues highlighting paths with symbols in them
259 & 265: Fixes issues with operator highlighting, such as -NoTypeInformation being incorrectly highlighted as two elements, but allows for -Not1 to be correctly interpreted as two elements
393: Allows for permissible symbols in command names

Fixes several issues:
229: Correctly highlights the operators -clt, -cle, -cgt, cge
235: Fixes issues highlighting paths with symbols in them
259 & 265: Fixes issues with operator highlighting, such as -NoTypeInformation being incorrectly highlighted as two elements, but allows for -Not1 to be correctly interpreted as two elements
393: Allows for permissible symbols in command names
@@ -226,13 +226,13 @@
</dict>
<dict>
<key>match</key>
<string>-([lg][te]|[ci]?(eq|ne))</string>
<string>-([ci]?[lg][te]|eq|ne)</string>
Copy link
Member

Choose a reason for hiding this comment

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

I'm barely understanding what's going on here. Can you provide some comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The previous syntax did not allow for the -clt, -cle, -cgt, -cge operators. By moving the [ci] to the beginning, these are now enabled.

This now does not allow ```<```, ```>```, ```"```, ```/```, ```|```, ```?```, or ```*``` in the path.
<key>name</key>
<string>keyword.operator.logical.powershell</string>
</dict>
<dict>
<key>match</key>
<string>(?i:[a-z][a-z0-9]+-?[a-z][a-z0-9]+)(?i:\.(?:exe|cmd|bat|ps1))</string>
<string>(?i:(\S&&[^<>"/\|?*])+)(?i:\.(?:exe|cmd|bat|ps1))</string>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This now does not allow <, >, ", /, |, ?, or * in the path.

@vors
Copy link
Member

vors commented Dec 15, 2014

Great, nice job!

I will really appreciate if you can include test cases for new syntax (like in https://github.com/SublimeText/PowerShell/blob/dev/tests/syntax_def/test_syntax.py) to avoid regressions in future.

@bcrotty
Copy link
Contributor Author

bcrotty commented Jan 7, 2015

I could use some help with that. I think I figured out how to test that -cle is marked properly, but how do I test that the first 4 characters of -NoTypeInformation are not marked as keyword.operator.logical.powershell?

@vors
Copy link
Member

vors commented Jan 9, 2015

Sorry for a long reply time, I was on a vacation.

Let's work on the tests together. I should have time on this weekend.
@guillermooo should be able to help with test framework capabilities.

@vors
Copy link
Member

vors commented Jan 13, 2015

I started work on a new approach for tests: compare sublime syntax regions to PS tokens produced by parser. I hope it will allow us to avoid verbose test-writing. Because of that, I would not ask you to add tests.

vors added a commit that referenced this pull request Jan 13, 2015
Update PowershellSyntax.tmLanguage
@vors vors merged commit d610f4c into SublimeText:dev Jan 13, 2015
@bcrotty bcrotty deleted the patch-1 branch January 29, 2015 19:23
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.

2 participants