Skip to content

Commit

Permalink
feat: add Enforce support
Browse files Browse the repository at this point in the history
  • Loading branch information
simonvic authored and lewis6991 committed Feb 17, 2025
1 parent 5ca508f commit 198720b
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Note: support for specific languages is strictly community maintained and can br
- [x] `devicetree`
- [x] `diff`
- [x] `elixir`
- [x] `enforce`
- [x] `elm`
- [x] `fennel`
- [x] `fish`
Expand Down Expand Up @@ -153,7 +154,6 @@ Note: support for specific languages is strictly community maintained and can br
- [ ] `elsa`
- [ ] `elvish`
- [ ] `embedded_template`
- [ ] `enforce`
- [ ] `erlang`
- [ ] `facility`
- [ ] `faust`
Expand Down
23 changes: 23 additions & 0 deletions queries/enforce/context.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
(if
(block) @context.end) @context

(decl_method
body: (_) @context.end) @context

(for
body: (_) @context.end) @context

(foreach
body: (_) @context.end) @context

(decl_class
body: (_) @context.end) @context

(decl_enum
body: (_) @context.end) @context

(switch
body: (_) @context.end) @context

(switch_case
label: (_) @context.end) @context
45 changes: 45 additions & 0 deletions test/lang/test.enforce
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// {{TEST}}
class Foo { // {{CONTEXT}}



// {{CONTEXT}}
}


// {{TEST}}
class Foo { // {{CONTEXT}}
void Foo() { // {{CONTEXT}}



// {{CURSOR}}
}
}

// {{TEST}}
class Foo { // {{CONTEXT}}
void foo() { // {{CONTEXT}}
if (true) { // {{CONTEXT}}
switch (foo) { // {{CONTEXT}}
case "foo": // {{CONTEXT}}



// {{CURSOR}}
break;
}
}
}
}


// {{TEST}}
enum Foo { // {{CONTEXT}}



// {{CURSOR}}
}

// vim: ft=enforce

0 comments on commit 198720b

Please sign in to comment.