diff options
Diffstat (limited to 'core/syntax.zig')
| -rw-r--r-- | core/syntax.zig | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/core/syntax.zig b/core/syntax.zig index 1147b6b9..19831ec2 100644 --- a/core/syntax.zig +++ b/core/syntax.zig @@ -7,7 +7,7 @@ const regexp = @import("regexp.zig"); const c_heap = @import("c_heap"); const diff = @import("diff.zig"); -const minimal_grammars = config.grammars == .minimal or config.grammars == .full; +const minimal_grammars = config.grammars != .none; const full_grammars = config.grammars == .full; pub const ts = @import("tree-sitter"); @@ -37,7 +37,6 @@ const Spec = struct { fn grammarSelected(comptime g: grammar_manifest.Grammar) bool { return switch (g.tier) { - .zig => true, .minimal => minimal_grammars, .full => full_grammars, }; @@ -1314,7 +1313,7 @@ test "syntax context multiline bindings and C++ namespaces preserve declaration try std.testing.expectEqual(@as(usize, 1), zig_declarations.len); try std.testing.expectEqual(@as(usize, 0), zig_declarations[0].start_line); try std.testing.expectEqual(@as(usize, 1), zig_declarations[0].header_end_line); - if (!minimal_grammars and !full_grammars) return; + if (!minimal_grammars) return; const cpp_source = "namespace example {\nstruct Outer {\n int run() {\n return 1;\n }\n};\n}\n"; const cpp_declarations = try contextDeclarations(gpa, "nested.cpp", cpp_source); defer gpa.free(cpp_declarations); @@ -1342,7 +1341,7 @@ test "syntax context Rust modules impls and methods remain nested" { } test "syntax formatted locations color hidden context and preserve multiline source" { - if (!minimal_grammars and !full_grammars) return; + if (!minimal_grammars) return; const gpa = std.testing.allocator; start(gpa); defer stop(); @@ -1889,7 +1888,7 @@ test "syntax allocator switching clears default-runtime caches" { } test "syntax location context snapshots retain omitted multiline comment scope" { - if (!minimal_grammars and !full_grammars) return; + if (!minimal_grammars) return; const gpa = std.testing.allocator; start(gpa); defer stop(); @@ -1934,7 +1933,7 @@ test "syntax declaration locations clear snapshots without muting ordinary conte } test "syntax stacked addresses do not split multiline source groups" { - if (!minimal_grammars and !full_grammars) return; + if (!minimal_grammars) return; const gpa = std.testing.allocator; start(gpa); defer stop(); |
