Skip to content

Commit

Permalink
refactor grammar a bit more
Browse files Browse the repository at this point in the history
  • Loading branch information
amchiclet committed Mar 27, 2024
1 parent ea10bc4 commit 2f77e1b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lang/semgrep-grammars/src/semgrep-kotlin/grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,18 @@ module.exports = grammar(standard_grammar, {
// add, and the second seems to be unused.
// So we just need to fix _statement.
_statement: ($, previous) => choice(
previous,
$.partial_class_declaration,
...previous.members,
$.partial_class_declaration,
),

partial_class_declaration: $ => prec.left(seq(
optional($.type_parameters),
seq(optional($.modifiers), "constructor"),
$._class_parameters,
optional(seq(":", $._delegation_specifiers)),
optional($.type_constraints),
optional($.class_body)
)),
partial_class_declaration: $ => prec.left(seq(
optional($.type_parameters),
seq(optional($.modifiers), "constructor"),
$._class_parameters,
optional(seq(":", $._delegation_specifiers)),
optional($.type_constraints),
optional($.class_body)
)),

class_parameter: ($, previous) => {
return choice(
Expand Down

0 comments on commit 2f77e1b

Please sign in to comment.