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

Replace regexp for matching regexeps with atom's version. #133

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 13 additions & 31 deletions Syntaxes/Ruby.plist
Original file line number Diff line number Diff line change
Expand Up @@ -926,37 +926,19 @@
</dict>
<dict>
<key>begin</key>
<string>(?x)
(?:
^ # beginning of line
| (?&lt;= # or look-behind on:
[=&gt;~(?:\[,|&amp;;]
| [\s;]if\s # keywords
| [\s;]elsif\s
| [\s;]while\s
| [\s;]unless\s
| [\s;]when\s
| [\s;]assert_match\s
| [\s;]or\s # boolean opperators
| [\s;]and\s
| [\s;]not\s
| [\s.]index\s # methods
| [\s.]scan\s
| [\s.]sub\s
| [\s.]sub!\s
| [\s.]gsub\s
| [\s.]gsub!\s
| [\s.]match\s
)
| (?&lt;= # or a look-behind with line anchor:
^when\s # duplication necessary due to limits of regex
| ^if\s
| ^elsif\s
| ^while\s
| ^unless\s
)
)
\s*((/))(?![*+{}?])
<string>
(?x)
(?&lt;![\w)])((/))(?![?*+])
(?=
(?:\\/|[^/])*+ # Do NOT change the order
Copy link
Contributor Author

@graceful-potato graceful-potato Feb 18, 2020

Choose a reason for hiding this comment

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

looks like /\\/ is not highlighted by this rule. And I think that this can be fixed with
(?:\\\\|\\/|[^/])*+

/[eimnosux]*\s*
(?:
[)\]}#.,?:]|\|\||&amp;&amp;|&lt;=&gt;|=&gt;|==|=~|!~|!=|;|$|
if|else|elsif|then|do|end|unless|while|until|or|and
)
|
$
)
</string>
<key>captures</key>
<dict>
Expand Down