Update submodules#166
Conversation
|
I just found out about |
e64d430 to
a0808ae
Compare
|
The 104 "Java properties" failures ( --- Shipped Packages/Java/JavaProperties.sublime-syntax 2018-03-29 12:10:14
+++ Packages/Java/JavaProperties.sublime-syntax 2018-05-29 10:41:34
@@ -28,23 +28,29 @@
set:
- match: '[:=]'
scope: punctuation.separator.java-props
set: property-value
- include: property-value
- with_prototype:
+ #with_prototype:
- match: (?=\n)
pop: true
property-value:
- match: (?=\S)
set:
- meta_content_scope: string.unquoted.java-props
- include: backslash
+
+ - match: (?=\n)
+ pop: true
backslash:
- match: (\\)\n
captures:
1: punctuation.separator.continuation.java-props
- match: \\u[[:xdigit:]]{4}
scope: constant.character.escape.unicode.java-props
- match: \\[^u]
scope: constant.character.escape.java-props
+
+ - match: (?=\n)
+ pop: trueThis could answer why |
I tried that out with this change: diff --git a/src/parsing/parser.rs b/src/parsing/parser.rs
index da747bf..7f482e9 100644
--- a/src/parsing/parser.rs
+++ b/src/parsing/parser.rs
@@ -595,11 +595,11 @@ impl ParseState {
/// Returns true if the stack was changed
fn perform_op(&mut self, line: &str, regions: &Region, pat: &MatchPattern) -> bool {
- let ctx_refs = match pat.operation {
- MatchOperation::Push(ref ctx_refs) => ctx_refs,
+ let (ctx_refs, old_proto) = match pat.operation {
+ MatchOperation::Push(ref ctx_refs) => (ctx_refs, None),
MatchOperation::Set(ref ctx_refs) => {
- self.stack.pop();
- ctx_refs
+ let old_proto = self.stack.pop().and_then(|s| s.prototype);
+ (ctx_refs, old_proto)
}
MatchOperation::Pop => {
self.stack.pop();
@@ -613,7 +613,9 @@ impl ParseState {
// top most on the stack after all the contexts are pushed - this is also
// referred to as the "target" of the push by sublimehq - see
// https://forum.sublimetext.com/t/dev-build-3111/19240/17 for more info
- let proto = if i == ctx_refs.len() - 1 {
+ let proto = if i == 0 && pat.with_prototype.is_none() {
+ old_proto.clone()
+ } else if i == ctx_refs.len() - 1 {
pat.with_prototype.clone()
} else {
NoneIt fixes I think maybe we need to sit down and systematically go through the prototype logic. By that I mean write a minimal test case in Sublime and put it in the parser test cases and see if we do the right thing. Repeat for all the intersections with other features. |
|
It looks like that error isn't caused by your changes, it's a bug in the Markdown syntax referencing a scope/syntax definition that doesn't exist. See sublimehq/Packages#1618. We will need to change So your fix looks correct, it seems to reduce the number of |
a0808ae to
73cc43b
Compare
|
A new submodule update fails with the following: which seems to come from https://github.com/sublimehq/Packages/blob/181aa52de5f9f8d7f49be0d9beae90107db3547e/Perl/Perl.sublime-syntax#L247 which had a full refactor merged a few days ago |
|
yup, not sure why/how it works in Sublime Text, but I've already reported it at sublimehq/Packages#1564 (comment), so we just have to wait for the new PR to be merged. |
|
I'm closing this now to keep the PR inbox clean. Of course feel free to re-open if the change still makes sense to do. |
This supersedes #154.