This commit is contained in:
Alex Dima 2019-07-12 15:42:52 +02:00
Родитель 25e4888eff
Коммит 7640bd6490
4 изменённых файлов: 75 добавлений и 2 удалений

Просмотреть файл

@ -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"
]
}
]
}
]
}
]