Fixes #66
This commit is contained in:
Родитель
25e4888eff
Коммит
7640bd6490
|
@ -1959,7 +1959,7 @@ var BeginEndRule = /** @class */ (function (_super) {
|
|||
var _this = _super.call(this, $location, id, name, contentName) || this;
|
||||
_this._begin = new RegExpSource(begin, _this.id);
|
||||
_this.beginCaptures = beginCaptures;
|
||||
_this._end = new RegExpSource(end, -1);
|
||||
_this._end = new RegExpSource(end ? end : '\uFFFF', -1);
|
||||
_this.endHasBackReferences = _this._end.hasBackReferences;
|
||||
_this.endCaptures = endCaptures;
|
||||
_this.applyEndPatternLast = applyEndPatternLast || false;
|
||||
|
|
|
@ -440,7 +440,7 @@ export class BeginEndRule extends Rule {
|
|||
super($location, id, name, contentName);
|
||||
this._begin = new RegExpSource(begin, this.id);
|
||||
this.beginCaptures = beginCaptures;
|
||||
this._end = new RegExpSource(end, -1);
|
||||
this._end = new RegExpSource(end ? end : '\uFFFF', -1);
|
||||
this.endHasBackReferences = this._end.hasBackReferences;
|
||||
this.endCaptures = endCaptures;
|
||||
this.applyEndPatternLast = applyEndPatternLast || false;
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>scopeName</key>
|
||||
<string>text.test</string>
|
||||
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>begin</key><string>^.</string>
|
||||
<key>name</key><string>comment</string>
|
||||
</dict>
|
||||
|
||||
<dict>
|
||||
<key>begin</key><string>.</string>
|
||||
<key>name</key><string>invalid</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
|
@ -1422,5 +1422,57 @@
|
|||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"grammars": [
|
||||
"fixtures/66.plist"
|
||||
],
|
||||
"grammarPath": "fixtures/66.plist",
|
||||
"desc": "Issue #66",
|
||||
"lines": [
|
||||
{
|
||||
"line": "Just some text",
|
||||
"tokens": [
|
||||
{
|
||||
"value": "J",
|
||||
"scopes": [
|
||||
"text.test",
|
||||
"comment"
|
||||
]
|
||||
},
|
||||
{
|
||||
"value": "ust some text",
|
||||
"scopes": [
|
||||
"text.test",
|
||||
"comment"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"line": "which contains undefined and then",
|
||||
"tokens": [
|
||||
{
|
||||
"value": "which contains undefined and then",
|
||||
"scopes": [
|
||||
"text.test",
|
||||
"comment"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"line": "more text",
|
||||
"tokens": [
|
||||
{
|
||||
"value": "more text",
|
||||
"scopes": [
|
||||
"text.test",
|
||||
"comment"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
Загрузка…
Ссылка в новой задаче