Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sublimehq/Packages to master #644

Merged
merged 1 commit into from
Sep 23, 2019
Merged

Update sublimehq/Packages to master #644

merged 1 commit into from
Sep 23, 2019

Conversation

benwaffle
Copy link
Contributor

@benwaffle benwaffle commented Sep 2, 2019

Fixes #499
Fixes #443

@sharkdp
Copy link
Owner

sharkdp commented Sep 2, 2019

Thank you very much for looking into this. Great that we can now actually upgrade the submodule to the latest state without getting any errors. Unfortunately, things are not that simple.

The syntect crate comes with an example program called "syntest". It runs syntax definition tests that come with some of the Sublime text syntaxes. With the old version of sublimehq/Packages (the one syntect currently points to), there are only a few failures (the first number in each line is the number of failed tests):

> cargo run -q --example syntest | rg Failed    
Ok(FailedAssertions(38, 43))
Ok(FailedAssertions(1, 639))
Ok(FailedAssertions(6, 612))

After updating to the lastest version of sublimehq/Packages, there are quite a few more:

> # edit the yaml-rust dependency in `Cargo.toml` to point at version 0.4.3
> git submodule update --recursive --remote
> make packs
> cargo run -q --example syntest | rg Failed             
Ok(FailedAssertions(1, 6297))
Ok(FailedAssertions(17, 3487))
Ok(FailedAssertions(3, 1055))
Ok(FailedAssertions(817, 6814))
Ok(FailedAssertions(6, 165))
Ok(FailedAssertions(1, 935))
Ok(FailedAssertions(6, 739))
Ok(FailedAssertions(61, 6695))
Ok(FailedAssertions(29, 6138))
Ok(FailedAssertions(15, 2886))

Having more test failures isn't necessarily a sign that things got worse (it could just be more tests), but I'm afraid it might very well be.

I think this is also the reason why trishume/syntect#246 has not been merged.

(also, after updating the yaml-rust dependency, there are three failing unit tests: html::tests::tokens, html::tests::strings, parsing::parser::tests::can_parse_includes)

/cc @keith-hall: FYI

@benwaffle
Copy link
Contributor Author

If i run make update-known-failures in syntest, then update sublime text Packages, then run make syntest, it passes. This way doesn't show any more failures than before the update.

@keith-hall
Copy link
Collaborator

some of the failing syntax test assertions are false positives due to syntect behaving differently than Sublime wrt how it handles assertions which span the end of the line, and would be fixed by trishume/syntect#185. I've just seen I need to fix some conflicts on that PR.
As to whether the quality of the highlighting will suffer more with those newer definitions and syntect's incorrect embed/escape handling compared to the older definitions, I couldn't really say... I guess it is subjective based on the input and the color schemes etc. IIRC it mainly affects files with JavaDoc comments and PHP embedded in Markdown code fences.

@sharkdp
Copy link
Owner

sharkdp commented Sep 3, 2019

Thank you both for the information!

I was about to say "let's give this a try" when I ran bat test.* on a folder of test inputs I collected over the last year and saw that bat now panics on simple JSON files (modified example to make it smaller):

{
  "a": {
    "b": 1
  }
}
> bat test.json
▶ RUST_BACKTRACE=1 bat test.json
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:347:21
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/git.luolix.top-1ecc6299db9ec823/backtrace-0.3.29/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/git.luolix.top-1ecc6299db9ec823/backtrace-0.3.29/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:47
   3: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:36
   4: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:200
   5: std::panicking::default_hook
             at src/libstd/panicking.rs:214
   6: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:477
   7: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:384
   8: rust_begin_unwind
             at src/libstd/panicking.rs:311
   9: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
  10: core::panicking::panic
             at src/libcore/panicking.rs:49
  11: <syntect::highlighting::highlighter::HighlightIterator as core::iter::traits::iterator::Iterator>::next
  12: <syntect::highlighting::highlighter::HighlightIterator as core::iter::traits::iterator::Iterator>::next
  13: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::from_iter
  14: syntect::easy::HighlightLines::highlight
  15: <bat::printer::InteractivePrinter as bat::printer::Printer>::print_line
  16: bat::controller::Controller::run
  17: bat::main
  18: std::rt::lang_start::{{closure}}
  19: std::rt::lang_start_internal::{{closure}}
             at src/libstd/rt.rs:49
  20: std::panicking::try::do_call
             at src/libstd/panicking.rs:296
  21: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:82
  22: std::panicking::try
             at src/libstd/panicking.rs:275
  23: std::panic::catch_unwind
             at src/libstd/panic.rs:394
  24: std::rt::lang_start_internal
             at src/libstd/rt.rs:48
  25: main
  26: __libc_start_main
  27: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
───────┬───────────────────────────────────────────────────────
       │ File: test.json
───────┼───────────────────────────────────────────────────────
   1   │ {
   2   │   "a": {
   3   │     "b": 1
   4   │   }

@keith-hall
Copy link
Collaborator

That is interesting, and definitely worth looking into - thanks for the minimal test case @sharkdp. I can't promise when I will find time to do so, however, so if someone else gets chance to investigate, please do! I wonder if it is related to the yaml-rust dependency, or the syntax definition changes. (presumably the latter but it would be nice to isolate to confirm)

I believe the syntect unit test failures are just because they are brittle tests relying on some of the syntaxes from the sublimehq packages and color schemes which are also submodules and occasionally updated. Any change is likely to break the tests unfortunately.

@keith-hall
Copy link
Collaborator

keith-hall commented Sep 3, 2019

I can confirm that syntects syncat example suffers from the same problem with JSON files, and it seems to be sublimehq/Packages#862 which triggers it, as it works with the previous commit. This will need to be fixed upstream in syntect.

note to self: I had some fun getting my old copy of the `syntect` repo up to date.

cargo run --example syncat -- testdata/Packages/JavaScript/tests/syntax_test_json.json causes a panic, cargo run --example syntest -- testdata/Packages/JavaScript/tests/syntax_test_json.json shows some test failures. It may be related to clearing and restoring scopes

Testing file testdata/Packages/JavaScript/tests/syntax_test_json.json
The test file references syntax definition file: Packages/JavaScript/JSON.sublime-syntax
-- debugging line 1 -- scope stack: ScopeStack { clear_stack: [], scopes: [] }
// SYNTAX TEST "Packages/JavaScript/JSON.sublime-syntax"
^ +source.json
// SYNTAX TEST "Packages/JavaScript/JSON.sublime-syntax"
^ +comment.line.double-slash.js
// SYNTAX TEST "Packages/JavaScript/JSON.sublime-syntax"
^ +punctuation.definition.comment.json
// SYNTAX TEST "Packages/JavaScript/JSON.sublime-syntax"
  ^ pop 1
// SYNTAX TEST "Packages/JavaScript/JSON.sublime-syntax"
                                                         ^ pop 1
-- debugging line 2 -- scope stack: ScopeStack { clear_stack: [], scopes: [<source.json>] }
no operations for this line...
-- debugging line 3 -- scope stack: ScopeStack { clear_stack: [], scopes: [<source.json>] }
{
^ +meta.mapping.json
{
^ +punctuation.section.mapping.begin.json
{
 ^ pop 1
-- debugging line 5 -- scope stack: ScopeStack { clear_stack: [], scopes: [<source.json>, <meta.mapping.json>] }
  "bool": false,
  ^ clear TopN(1)
  "bool": false,
  ^ +meta.mapping.key.json
  "bool": false,
  ^ +string.quoted.double.json
  "bool": false,
  ^ +punctuation.definition.string.begin.json
  "bool": false,
   ^ pop 1
  "bool": false,
       ^ +punctuation.definition.string.end.json
  "bool": false,
        ^ pop 1
  "bool": false,
        ^ pop 2
  "bool": false,
        ^ restore
  "bool": false,
        ^ +punctuation.separator.mapping.key-value.json
  "bool": false,
         ^ pop 1
  "bool": false,
          ^ +meta.mapping.value.json
  "bool": false,
          ^ pop 1
  "bool": false,
          ^ clear TopN(1)
  "bool": false,
          ^ +meta.mapping.value.json
  "bool": false,
          ^ +constant.language.json
  "bool": false,
               ^ pop 1
  "bool": false,
               ^ pop 1
  "bool": false,
               ^ +punctuation.separator.mapping.pair.json
  "bool": false,
                ^ pop 1
-- debugging line 9 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>]], scopes: [<source.json>] }
no operations for this line...
-- debugging line 10 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>]], scopes: [<source.json>] }
  "dict": { "key": "value" }
  ^ clear TopN(1)
  "dict": { "key": "value" }
  ^ +meta.mapping.key.json
  "dict": { "key": "value" }
  ^ +string.quoted.double.json
  "dict": { "key": "value" }
  ^ +punctuation.definition.string.begin.json
  "dict": { "key": "value" }
   ^ pop 1
  "dict": { "key": "value" }
       ^ +punctuation.definition.string.end.json
  "dict": { "key": "value" }
        ^ pop 1
  "dict": { "key": "value" }
        ^ pop 2
  "dict": { "key": "value" }
        ^ restore
  "dict": { "key": "value" }
        ^ +punctuation.separator.mapping.key-value.json
  "dict": { "key": "value" }
         ^ pop 1
  "dict": { "key": "value" }
          ^ +meta.mapping.value.json
  "dict": { "key": "value" }
          ^ pop 1
  "dict": { "key": "value" }
          ^ clear TopN(1)
  "dict": { "key": "value" }
          ^ +meta.mapping.value.json
  "dict": { "key": "value" }
          ^ +meta.mapping.json
  "dict": { "key": "value" }
          ^ +punctuation.section.mapping.begin.json
  "dict": { "key": "value" }
           ^ pop 1
  "dict": { "key": "value" }
            ^ clear TopN(1)
  "dict": { "key": "value" }
            ^ +meta.mapping.key.json
  "dict": { "key": "value" }
            ^ +string.quoted.double.json
  "dict": { "key": "value" }
            ^ +punctuation.definition.string.begin.json
  "dict": { "key": "value" }
             ^ pop 1
  "dict": { "key": "value" }
                ^ +punctuation.definition.string.end.json
  "dict": { "key": "value" }
                 ^ pop 1
  "dict": { "key": "value" }
                 ^ pop 2
  "dict": { "key": "value" }
                 ^ restore
  "dict": { "key": "value" }
                 ^ +punctuation.separator.mapping.key-value.json
  "dict": { "key": "value" }
                  ^ pop 1
  "dict": { "key": "value" }
                   ^ +meta.mapping.value.json
  "dict": { "key": "value" }
                   ^ pop 1
  "dict": { "key": "value" }
                   ^ clear TopN(1)
  "dict": { "key": "value" }
                   ^ +meta.mapping.value.json
  "dict": { "key": "value" }
                   ^ +string.quoted.double.json
  "dict": { "key": "value" }
                   ^ +punctuation.definition.string.begin.json
  "dict": { "key": "value" }
                    ^ pop 1
  "dict": { "key": "value" }
                         ^ +punctuation.definition.string.end.json
  "dict": { "key": "value" }
                          ^ pop 1
  "dict": { "key": "value" }
                          ^ pop 1
  "dict": { "key": "value" }
                          ^ pop 1
  "dict": { "key": "value" }
                           ^ +punctuation.section.mapping.end.json
  "dict": { "key": "value" }
                            ^ pop 1
  "dict": { "key": "value" }
                            ^ pop 1
  "dict": { "key": "value" }
                            ^ pop 1
  Assertion selector "meta.mapping.value.json meta.mapping - meta.mapping meta.mapping meta.mapping" from line 11 failed against line 10, column range 26-27 (with text " ") has scope [<meta.mapping.value.json>]
  Assertion selector "meta.mapping.value.json meta.mapping - meta.mapping meta.mapping meta.mapping" from line 11 failed against line 10, column range 27-28 (with text "}") has scope [<meta.mapping.value.json>, <punctuation.section.mapping.end.json>]
  Assertion selector "meta.mapping.value.json meta.mapping.json" from line 18 failed against line 10, column range 26-27 (with text " ") has scope [<meta.mapping.value.json>]
  Assertion selector "meta.mapping.value.json meta.mapping.json" from line 18 failed against line 10, column range 27-28 (with text "}") has scope [<meta.mapping.value.json>, <punctuation.section.mapping.end.json>]
-- debugging line 19 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>]], scopes: [] }
no operations for this line...
-- debugging line 20 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>]], scopes: [] }
, ,
^ +punctuation.separator.mapping.pair.json
, ,
 ^ pop 1
, ,
  ^ +invalid.illegal.expected-mapping-key.json
, ,
   ^ pop 1
-- debugging line 23 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>]], scopes: [] }
no operations for this line...
-- debugging line 24 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>]], scopes: [] }
  "sep": {},
  ^ clear TopN(1)
  "sep": {},
  ^ +meta.mapping.key.json
  "sep": {},
  ^ +string.quoted.double.json
  "sep": {},
  ^ +punctuation.definition.string.begin.json
  "sep": {},
   ^ pop 1
  "sep": {},
      ^ +punctuation.definition.string.end.json
  "sep": {},
       ^ pop 1
  "sep": {},
       ^ pop 2
  "sep": {},
       ^ restore
  "sep": {},
       ^ +punctuation.separator.mapping.key-value.json
  "sep": {},
        ^ pop 1
  "sep": {},
         ^ +meta.mapping.value.json
  "sep": {},
         ^ pop 1
  "sep": {},
         ^ clear TopN(1)
  "sep": {},
         ^ +meta.mapping.value.json
  "sep": {},
         ^ +meta.mapping.json
  "sep": {},
         ^ +punctuation.section.mapping.begin.json
  "sep": {},
          ^ pop 1
  "sep": {},
          ^ +punctuation.section.mapping.end.json
  "sep": {},
           ^ pop 1
  "sep": {},
           ^ pop 1
  "sep": {},
           ^ pop 1
  "sep": {},
           ^ +punctuation.separator.mapping.pair.json
  "sep": {},
            ^ pop 1
-- debugging line 26 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], []], scopes: [] }
no operations for this line...
-- debugging line 27 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], []], scopes: [] }
  "array": [ /**/ ],
  ^ clear TopN(1)
  "array": [ /**/ ],
  ^ +meta.mapping.key.json
  "array": [ /**/ ],
  ^ +string.quoted.double.json
  "array": [ /**/ ],
  ^ +punctuation.definition.string.begin.json
  "array": [ /**/ ],
   ^ pop 1
  "array": [ /**/ ],
        ^ +punctuation.definition.string.end.json
  "array": [ /**/ ],
         ^ pop 1
  "array": [ /**/ ],
         ^ pop 2
  "array": [ /**/ ],
         ^ restore
  "array": [ /**/ ],
         ^ +punctuation.separator.mapping.key-value.json
  "array": [ /**/ ],
          ^ pop 1
  "array": [ /**/ ],
           ^ +meta.mapping.value.json
  "array": [ /**/ ],
           ^ pop 1
  "array": [ /**/ ],
           ^ clear TopN(1)
  "array": [ /**/ ],
           ^ +meta.mapping.value.json
  "array": [ /**/ ],
           ^ +meta.sequence.json
  "array": [ /**/ ],
           ^ +punctuation.section.sequence.begin.json
  "array": [ /**/ ],
            ^ pop 1
  "array": [ /**/ ],
             ^ +comment.block.json
  "array": [ /**/ ],
             ^ +punctuation.definition.comment.json
  "array": [ /**/ ],
               ^ pop 1
  "array": [ /**/ ],
                 ^ pop 1
  "array": [ /**/ ],
                  ^ +punctuation.section.sequence.end.json
  "array": [ /**/ ],
                   ^ pop 1
  "array": [ /**/ ],
                   ^ pop 1
  "array": [ /**/ ],
                   ^ pop 1
  "array": [ /**/ ],
                   ^ +punctuation.separator.mapping.pair.json
  "array": [ /**/ ],
                    ^ pop 1
-- debugging line 32 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], []], scopes: [] }
no operations for this line...
-- debugging line 33 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], []], scopes: [] }
  "string": "string",
  ^ clear TopN(1)
  "string": "string",
  ^ +meta.mapping.key.json
  "string": "string",
  ^ +string.quoted.double.json
  "string": "string",
  ^ +punctuation.definition.string.begin.json
  "string": "string",
   ^ pop 1
  "string": "string",
         ^ +punctuation.definition.string.end.json
  "string": "string",
          ^ pop 1
  "string": "string",
          ^ pop 2
  "string": "string",
          ^ restore
  "string": "string",
          ^ +punctuation.separator.mapping.key-value.json
  "string": "string",
           ^ pop 1
  "string": "string",
            ^ +meta.mapping.value.json
  "string": "string",
            ^ pop 1
  "string": "string",
            ^ clear TopN(1)
  "string": "string",
            ^ +meta.mapping.value.json
  "string": "string",
            ^ +string.quoted.double.json
  "string": "string",
            ^ +punctuation.definition.string.begin.json
  "string": "string",
             ^ pop 1
  "string": "string",
                   ^ +punctuation.definition.string.end.json
  "string": "string",
                    ^ pop 1
  "string": "string",
                    ^ pop 1
  "string": "string",
                    ^ pop 1
  "string": "string",
                    ^ +punctuation.separator.mapping.pair.json
  "string": "string",
                     ^ pop 1
-- debugging line 37 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], []], scopes: [] }
no operations for this line...
-- debugging line 38 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], []], scopes: [] }
  "num": 20.09,
  ^ clear TopN(1)
  "num": 20.09,
  ^ +meta.mapping.key.json
  "num": 20.09,
  ^ +string.quoted.double.json
  "num": 20.09,
  ^ +punctuation.definition.string.begin.json
  "num": 20.09,
   ^ pop 1
  "num": 20.09,
      ^ +punctuation.definition.string.end.json
  "num": 20.09,
       ^ pop 1
  "num": 20.09,
       ^ pop 2
  "num": 20.09,
       ^ restore
  "num": 20.09,
       ^ +punctuation.separator.mapping.key-value.json
  "num": 20.09,
        ^ pop 1
  "num": 20.09,
         ^ +meta.mapping.value.json
  "num": 20.09,
         ^ pop 1
  "num": 20.09,
         ^ clear TopN(1)
  "num": 20.09,
         ^ +meta.mapping.value.json
  "num": 20.09,
         ^ +constant.numeric.json
  "num": 20.09,
              ^ pop 1
  "num": 20.09,
              ^ pop 1
  "num": 20.09,
              ^ +punctuation.separator.mapping.pair.json
  "num": 20.09,
               ^ pop 1
-- debugging line 40 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], []], scopes: [] }
no operations for this line...
-- debugging line 41 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], []], scopes: [] }
  "neg": -9,
  ^ clear TopN(1)
  "neg": -9,
  ^ +meta.mapping.key.json
  "neg": -9,
  ^ +string.quoted.double.json
  "neg": -9,
  ^ +punctuation.definition.string.begin.json
  "neg": -9,
   ^ pop 1
  "neg": -9,
      ^ +punctuation.definition.string.end.json
  "neg": -9,
       ^ pop 1
  "neg": -9,
       ^ pop 2
  "neg": -9,
       ^ restore
  "neg": -9,
       ^ +punctuation.separator.mapping.key-value.json
  "neg": -9,
        ^ pop 1
  "neg": -9,
         ^ +meta.mapping.value.json
  "neg": -9,
         ^ pop 1
  "neg": -9,
         ^ clear TopN(1)
  "neg": -9,
         ^ +meta.mapping.value.json
  "neg": -9,
         ^ +constant.numeric.json
  "neg": -9,
           ^ pop 1
  "neg": -9,
           ^ pop 1
  "neg": -9,
           ^ +punctuation.separator.mapping.pair.json
  "neg": -9,
            ^ pop 1
-- debugging line 43 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], [], []], scopes: [] }
no operations for this line...
-- debugging line 44 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], [], []], scopes: [] }
  "E": 20e10,
  ^ clear TopN(1)
  "E": 20e10,
  ^ +meta.mapping.key.json
  "E": 20e10,
  ^ +string.quoted.double.json
  "E": 20e10,
  ^ +punctuation.definition.string.begin.json
  "E": 20e10,
   ^ pop 1
  "E": 20e10,
    ^ +punctuation.definition.string.end.json
  "E": 20e10,
     ^ pop 1
  "E": 20e10,
     ^ pop 2
  "E": 20e10,
     ^ restore
  "E": 20e10,
     ^ +punctuation.separator.mapping.key-value.json
  "E": 20e10,
      ^ pop 1
  "E": 20e10,
       ^ +meta.mapping.value.json
  "E": 20e10,
       ^ pop 1
  "E": 20e10,
       ^ clear TopN(1)
  "E": 20e10,
       ^ +meta.mapping.value.json
  "E": 20e10,
       ^ +constant.numeric.json
  "E": 20e10,
            ^ pop 1
  "E": 20e10,
            ^ pop 1
  "E": 20e10,
            ^ +punctuation.separator.mapping.pair.json
  "E": 20e10,
             ^ pop 1
-- debugging line 48 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], [], [], []], scopes: [] }
no operations for this line...
-- debugging line 49 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], [], [], []], scopes: [] }
  "escape": "\n",
  ^ clear TopN(1)
  "escape": "\n",
  ^ +meta.mapping.key.json
  "escape": "\n",
  ^ +string.quoted.double.json
  "escape": "\n",
  ^ +punctuation.definition.string.begin.json
  "escape": "\n",
   ^ pop 1
  "escape": "\n",
         ^ +punctuation.definition.string.end.json
  "escape": "\n",
          ^ pop 1
  "escape": "\n",
          ^ pop 2
  "escape": "\n",
          ^ restore
  "escape": "\n",
          ^ +punctuation.separator.mapping.key-value.json
  "escape": "\n",
           ^ pop 1
  "escape": "\n",
            ^ +meta.mapping.value.json
  "escape": "\n",
            ^ pop 1
  "escape": "\n",
            ^ clear TopN(1)
  "escape": "\n",
            ^ +meta.mapping.value.json
  "escape": "\n",
            ^ +string.quoted.double.json
  "escape": "\n",
            ^ +punctuation.definition.string.begin.json
  "escape": "\n",
             ^ pop 1
  "escape": "\n",
             ^ +constant.character.escape.json
  "escape": "\n",
               ^ pop 1
  "escape": "\n",
               ^ +punctuation.definition.string.end.json
  "escape": "\n",
                ^ pop 1
  "escape": "\n",
                ^ pop 1
  "escape": "\n",
                ^ pop 1
  "escape": "\n",
                ^ +punctuation.separator.mapping.pair.json
  "escape": "\n",
                 ^ pop 1
-- debugging line 52 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], [], [], [], []], scopes: [] }
no operations for this line...
-- debugging line 53 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], [], [], [], []], scopes: [] }
  "illegal": "\.",
  ^ clear TopN(1)
  "illegal": "\.",
  ^ +meta.mapping.key.json
  "illegal": "\.",
  ^ +string.quoted.double.json
  "illegal": "\.",
  ^ +punctuation.definition.string.begin.json
  "illegal": "\.",
   ^ pop 1
  "illegal": "\.",
          ^ +punctuation.definition.string.end.json
  "illegal": "\.",
           ^ pop 1
  "illegal": "\.",
           ^ pop 2
  "illegal": "\.",
           ^ restore
  "illegal": "\.",
           ^ +punctuation.separator.mapping.key-value.json
  "illegal": "\.",
            ^ pop 1
  "illegal": "\.",
             ^ +meta.mapping.value.json
  "illegal": "\.",
             ^ pop 1
  "illegal": "\.",
             ^ clear TopN(1)
  "illegal": "\.",
             ^ +meta.mapping.value.json
  "illegal": "\.",
             ^ +string.quoted.double.json
  "illegal": "\.",
             ^ +punctuation.definition.string.begin.json
  "illegal": "\.",
              ^ pop 1
  "illegal": "\.",
              ^ +invalid.illegal.unrecognized-string-escape.json
  "illegal": "\.",
                ^ pop 1
  "illegal": "\.",
                ^ +punctuation.definition.string.end.json
  "illegal": "\.",
                 ^ pop 1
  "illegal": "\.",
                 ^ pop 1
  "illegal": "\.",
                 ^ pop 1
  "illegal": "\.",
                 ^ +punctuation.separator.mapping.pair.json
  "illegal": "\.",
                  ^ pop 1
-- debugging line 55 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], [], [], [], [], []], scopes: [] }
no operations for this line...
-- debugging line 56 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], [], [], [], [], []], scopes: [] }
  "unterminated string
  ^ clear TopN(1)
  "unterminated string
  ^ +meta.mapping.key.json
  "unterminated string
  ^ +string.quoted.double.json
  "unterminated string
  ^ +punctuation.definition.string.begin.json
  "unterminated string
   ^ pop 1
  "unterminated string
                      ^ +invalid.illegal.unclosed-string.json
  "unterminated string
                       ^ pop 1
  "unterminated string
                       ^ pop 2
  "unterminated string
                       ^ restore
-- debugging line 59 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], [], [], [], [], []], scopes: [] }
no operations for this line...
-- debugging line 61 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], [], [], [], [], []], scopes: [] }
no operations for this line...
-- debugging line 62 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], [], [], [], [], []], scopes: [] }
/**/: "test",
^ +comment.block.json
/**/: "test",
^ +punctuation.definition.comment.json
/**/: "test",
  ^ pop 1
/**/: "test",
    ^ pop 1
/**/: "test",
    ^ +punctuation.separator.mapping.key-value.json
/**/: "test",
     ^ pop 1
/**/: "test",
      ^ +meta.mapping.value.json
/**/: "test",
      ^ pop 1
/**/: "test",
      ^ clear TopN(1)
/**/: "test",
      ^ +meta.mapping.value.json
/**/: "test",
      ^ +string.quoted.double.json
/**/: "test",
      ^ +punctuation.definition.string.begin.json
/**/: "test",
       ^ pop 1
/**/: "test",
           ^ +punctuation.definition.string.end.json
/**/: "test",
            ^ pop 1
/**/: "test",
            ^ pop 1
/**/: "test",
            ^ pop 1
/**/: "test",
            ^ +punctuation.separator.mapping.pair.json
/**/: "test",
             ^ pop 1
  Assertion selector "meta.mapping.json comment.block.json" from line 63 failed against line 62, column range 3-4 (with text "/") has scope [<comment.block.json>]
-- debugging line 66 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], [], [], [], [], [], []], scopes: [] }
no operations for this line...
-- debugging line 67 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], [], [], [], [], [], []], scopes: [] }
  "array2":
  ^ clear TopN(1)
  "array2":
  ^ +meta.mapping.key.json
  "array2":
  ^ +string.quoted.double.json
  "array2":
  ^ +punctuation.definition.string.begin.json
  "array2":
   ^ pop 1
  "array2":
         ^ +punctuation.definition.string.end.json
  "array2":
          ^ pop 1
  "array2":
          ^ pop 2
  "array2":
          ^ restore
  "array2":
          ^ +punctuation.separator.mapping.key-value.json
  "array2":
           ^ pop 1
-- debugging line 68 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], [], [], [], [], [], []], scopes: [] }
    [
    ^ +meta.mapping.value.json
    [
    ^ pop 1
    [
    ^ clear TopN(1)
    [
    ^ +meta.mapping.value.json
    [
    ^ +meta.sequence.json
    [
    ^ +punctuation.section.sequence.begin.json
    [
     ^ pop 1
-- debugging line 69 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], [], [], [], [], [], [], []], scopes: [<meta.mapping.value.json>, <meta.sequence.json>] }
      "foobar",
      ^ +string.quoted.double.json
      "foobar",
      ^ +punctuation.definition.string.begin.json
      "foobar",
       ^ pop 1
      "foobar",
             ^ +punctuation.definition.string.end.json
      "foobar",
              ^ pop 1
      "foobar",
              ^ pop 1
      "foobar",
              ^ +punctuation.separator.sequence.json
      "foobar",
               ^ pop 1
-- debugging line 71 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], [], [], [], [], [], [], []], scopes: [<meta.mapping.value.json>, <meta.sequence.json>] }
    ]
    ^ +punctuation.section.sequence.end.json
    ]
     ^ pop 1
    ]
     ^ pop 1
    ]
     ^ pop 1
-- debugging line 72 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], [], [], [], [], [], [], []], scopes: [] }
no operations for this line...
-- debugging line 73 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], [], [], [], [], [], [], []], scopes: [] }
   [],
  ^ +invalid.illegal.expected-mapping-separator.json
   [],
   ^ pop 1
   [],
   ^ +invalid.illegal.expected-mapping-key.json
   [],
    ^ pop 1
   [],
    ^ +invalid.illegal.expected-mapping-key.json
   [],
     ^ pop 1
   [],
     ^ +invalid.illegal.expected-mapping-key.json
   [],
      ^ pop 1
-- debugging line 76 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], [], [], [], [], [], [], []], scopes: [] }
no operations for this line...
-- debugging line 77 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], [], [], [], [], [], [], []], scopes: [] }
  "typing json": {}
  ^ clear TopN(1)
  "typing json": {}
  ^ +meta.mapping.key.json
  "typing json": {}
  ^ +string.quoted.double.json
  "typing json": {}
  ^ +punctuation.definition.string.begin.json
  "typing json": {}
   ^ pop 1
  "typing json": {}
              ^ +punctuation.definition.string.end.json
  "typing json": {}
               ^ pop 1
  "typing json": {}
               ^ pop 2
  "typing json": {}
               ^ restore
  "typing json": {}
               ^ +punctuation.separator.mapping.key-value.json
  "typing json": {}
                ^ pop 1
  "typing json": {}
                 ^ +meta.mapping.value.json
  "typing json": {}
                 ^ pop 1
  "typing json": {}
                 ^ clear TopN(1)
  "typing json": {}
                 ^ +meta.mapping.value.json
  "typing json": {}
                 ^ +meta.mapping.json
  "typing json": {}
                 ^ +punctuation.section.mapping.begin.json
  "typing json": {}
                  ^ pop 1
  "typing json": {}
                  ^ +punctuation.section.mapping.end.json
  "typing json": {}
                   ^ pop 1
  "typing json": {}
                   ^ pop 1
  "typing json": {}
                   ^ pop 1
-- debugging line 78 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], [], [], [], [], [], [], [], []], scopes: [] }
  ,,,, "another key": false,
  ^ +punctuation.separator.mapping.pair.json
  ,,,, "another key": false,
   ^ pop 1
  ,,,, "another key": false,
   ^ +invalid.illegal.expected-mapping-key.json
  ,,,, "another key": false,
    ^ pop 1
  ,,,, "another key": false,
    ^ +invalid.illegal.expected-mapping-key.json
  ,,,, "another key": false,
     ^ pop 1
  ,,,, "another key": false,
     ^ +invalid.illegal.expected-mapping-key.json
  ,,,, "another key": false,
      ^ pop 1
  ,,,, "another key": false,
       ^ clear TopN(1)
  ,,,, "another key": false,
       ^ +meta.mapping.key.json
  ,,,, "another key": false,
       ^ +string.quoted.double.json
  ,,,, "another key": false,
       ^ +punctuation.definition.string.begin.json
  ,,,, "another key": false,
        ^ pop 1
  ,,,, "another key": false,
                   ^ +punctuation.definition.string.end.json
  ,,,, "another key": false,
                    ^ pop 1
  ,,,, "another key": false,
                    ^ pop 2
  ,,,, "another key": false,
                    ^ restore
  ,,,, "another key": false,
                    ^ +punctuation.separator.mapping.key-value.json
  ,,,, "another key": false,
                     ^ pop 1
  ,,,, "another key": false,
                      ^ +meta.mapping.value.json
  ,,,, "another key": false,
                      ^ pop 1
  ,,,, "another key": false,
                      ^ clear TopN(1)
  ,,,, "another key": false,
                      ^ +meta.mapping.value.json
  ,,,, "another key": false,
                      ^ +constant.language.json
  ,,,, "another key": false,
                           ^ pop 1
  ,,,, "another key": false,
                           ^ pop 1
  ,,,, "another key": false,
                           ^ +punctuation.separator.mapping.pair.json
  ,,,, "another key": false,
                            ^ pop 1
-- debugging line 79 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], [], [], [], [], [], [], [], [], []], scopes: [] }
no operations for this line...
-- debugging line 80 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], [], [], [], [], [], [], [], [], []], scopes: [] }
  "ke//y": "value"
  ^ clear TopN(1)
  "ke//y": "value"
  ^ +meta.mapping.key.json
  "ke//y": "value"
  ^ +string.quoted.double.json
  "ke//y": "value"
  ^ +punctuation.definition.string.begin.json
  "ke//y": "value"
   ^ pop 1
  "ke//y": "value"
        ^ +punctuation.definition.string.end.json
  "ke//y": "value"
         ^ pop 1
  "ke//y": "value"
         ^ pop 2
  "ke//y": "value"
         ^ restore
  "ke//y": "value"
         ^ +punctuation.separator.mapping.key-value.json
  "ke//y": "value"
          ^ pop 1
  "ke//y": "value"
           ^ +meta.mapping.value.json
  "ke//y": "value"
           ^ pop 1
  "ke//y": "value"
           ^ clear TopN(1)
  "ke//y": "value"
           ^ +meta.mapping.value.json
  "ke//y": "value"
           ^ +string.quoted.double.json
  "ke//y": "value"
           ^ +punctuation.definition.string.begin.json
  "ke//y": "value"
            ^ pop 1
  "ke//y": "value"
                 ^ +punctuation.definition.string.end.json
  "ke//y": "value"
                  ^ pop 1
  "ke//y": "value"
                  ^ pop 1
  "ke//y": "value"
                  ^ pop 1
-- debugging line 82 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], [], [], [], [], [], [], [], [], [], []], scopes: [] }
no operations for this line...
-- debugging line 83 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], [], [], [], [], [], [], [], [], [], []], scopes: [] }
/**
^ +comment.block.documentation.json
/**
^ +punctuation.definition.comment.json
/**
   ^ pop 1
-- debugging line 84 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], [], [], [], [], [], [], [], [], [], []], scopes: [<comment.block.documentation.json>] }
    *
    ^ +punctuation.definition.comment.json
    *
     ^ pop 1
  Assertion selector "meta.mapping.json comment.block.documentation.json punctuation.definition.comment.json" from line 85 failed against line 84, column range 4-5 (with text "*") has scope [<comment.block.documentation.json>, <punctuation.definition.comment.json>]
-- debugging line 86 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], [], [], [], [], [], [], [], [], [], []], scopes: [<comment.block.documentation.json>] }
*/
  ^ pop 1
-- debugging line 87 -- scope stack: ScopeStack { clear_stack: [[<meta.mapping.json>], [<source.json>], [<meta.mapping.json>], [], [], [], [], [], [], [], [], [], [], [], [], []], scopes: [] }
}
^ +punctuation.section.mapping.end.json
}
 ^ pop 1
}
 ^ pop 1
Ok(FailedAssertions(6, 165))
exiting with code 1

@sharkdp
Copy link
Owner

sharkdp commented Sep 22, 2019

A new version of syntect has been released (trishume/syntect#259 (comment)) which includes the fix by @keith-hall.

@benwaffle If possible, could you please update the PR and have bat depend on the latest version of syntect?

@sharkdp
Copy link
Owner

sharkdp commented Sep 23, 2019

Nevermind, the update was already done in #671. I rebased your branch onto master.

@sharkdp
Copy link
Owner

sharkdp commented Sep 23, 2019

I tested this on my (small) collection of files and couldn't see any obvious regression. I think we should give this a try.

@sharkdp sharkdp merged commit 7ba5bc7 into sharkdp:master Sep 23, 2019
@sharkdp
Copy link
Owner

sharkdp commented Sep 23, 2019

@benwaffle @keith-hall Thank you!

@sharkdp
Copy link
Owner

sharkdp commented Mar 22, 2020

This has been released in bat 0.13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can not update sublimehq/Packages to the latest state .sc files should be treated as scala files
3 participants