-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(javascript) fix regex inside parens after a non-regex (#2531)
* make the object attr container smarter * deal with multi-line comments also * comments in any order, spanning multiple lines Essentially makes the object attr container much more sensitive by allowing it to look-ahead thru comments to find object keys - and therefore prevent them from being incorrectly matched by the "value container" rule.
- Loading branch information
1 parent
9e4f2dc
commit 5c125b9
Showing
5 changed files
with
46 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
{ | ||
<span class="hljs-attr">key</span>: value, <span class="hljs-comment">// with comment</span> | ||
<span class="hljs-attr">key2</span>: value, | ||
<span class="hljs-attr">key2clone</span>: value, | ||
<span class="hljs-string">'key-3'</span>: value, | ||
<span class="hljs-attr">key4</span>: <span class="hljs-literal">false</span> ? <span class="hljs-literal">undefined</span> : <span class="hljs-literal">true</span> | ||
<span class="hljs-attr">key4</span>: <span class="hljs-literal">false</span> ? <span class="hljs-literal">undefined</span> : <span class="hljs-literal">true</span>, | ||
<span class="hljs-attr">key5</span>: value, <span class="hljs-comment">/* with a multiline comment */</span> | ||
<span class="hljs-attr">key6</span>: value, | ||
<span class="hljs-attr">key7</span>: value, <span class="hljs-comment">/* with a multiline comment */</span> <span class="hljs-comment">// another comment</span> | ||
<span class="hljs-attr">key8</span>: value, | ||
<span class="hljs-attr">key9</span>: value, <span class="hljs-comment">/* with a REAL multiline | ||
comment */</span> | ||
<span class="hljs-attr">key10</span>: value, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
{ | ||
key: value, // with comment | ||
key2: value, | ||
key2clone: value, | ||
'key-3': value, | ||
key4: false ? undefined : true | ||
key4: false ? undefined : true, | ||
key5: value, /* with a multiline comment */ | ||
key6: value, | ||
key7: value, /* with a multiline comment */ // another comment | ||
key8: value, | ||
key9: value, /* with a REAL multiline | ||
comment */ | ||
key10: value, | ||
} | ||
|