Skip to content
Open
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
Fix / Workaround for: Error in regex: target of repeat operator is in…
…valid in regex

Fixes: #242

SublimeText 4 (as of build 4121) evaluates this valid regex: `\n?` to this invalid one: `$?`
hence causing the following error:

```
error: Error loading syntax file "Packages/<Path_To>.tmLanguage": Error in regex: target of repeat operator is invalid in regex
```

This commit is a workaround to fix this problem.
  • Loading branch information
ni-max committed Nov 22, 2021
commit e8314c6943424eefd5d49c05be0fcf754e79dfe1
14 changes: 7 additions & 7 deletions grammars/MagicPython.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ E.g. "arr[idx](args)"
<array>
<dict>
<key>match</key>
<string>(\\)\s*(\S.*$\n?)</string>
<string>(\\)\s*(\S.*$\&x6e;?)</string>
<key>captures</key>
<dict>
<key>1</key>
Expand All @@ -872,7 +872,7 @@ E.g. "arr[idx](args)"
</dict>
<dict>
<key>begin</key>
<string>(\\)\s*$\n?</string>
<string>(\\)\s*$\&x6e;?</string>
<key>end</key>
<string>(?x)
(?=^\s*$)
Expand Down Expand Up @@ -1384,7 +1384,7 @@ E.g. "arr[idx](args)"
<key>comment</key>
<string>it is illegal to have a multiline brace inside a single-line string</string>
<key>begin</key>
<string>(\{)(?=[^\n}]*$\n?)</string>
<string>(\{)(?=[^\n}]*$\&x6e;?)</string>
<key>end</key>
<string>(\})|(?=\n)</string>
<key>beginCaptures</key>
Expand Down Expand Up @@ -8181,7 +8181,7 @@ indirectly through syntactic constructs

The guard for newlines has to be separate from the
lookahead because of special $ matching rule.)
($\n?)
($\&x6e;?)
|
(?=[\\\}\{]|(['"])|((?&lt;!\\)\n))
)
Expand All @@ -8204,7 +8204,7 @@ indirectly through syntactic constructs

The guard for newlines has to be separate from the
lookahead because of special $ matching rule.)
($\n?)
($\&x6e;?)
|
(?=[\\\}\{]|(['"])|((?&lt;!\\)\n))
)
Expand Down Expand Up @@ -8553,7 +8553,7 @@ indirectly through syntactic constructs

The guard for newlines has to be separate from the
lookahead because of special $ matching rule.)
($\n?)
($\&x6e;?)
|
(?=[\\\}\{]|'''|""")
)
Expand All @@ -8576,7 +8576,7 @@ indirectly through syntactic constructs

The guard for newlines has to be separate from the
lookahead because of special $ matching rule.)
($\n?)
($\&x6e;?)
|
(?=[\\\}\{]|'''|""")
)
Expand Down