Skip to content

Commit

Permalink
* and + rules with \n terminator
Browse files Browse the repository at this point in the history
 - Having the `\n` terminator reproduces the exact matching
  as languages such as Java and JavaScript
  • Loading branch information
dvmarcilio committed Dec 2, 2022
1 parent f11f6ef commit c10f4a8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions polyglot/piranha/src/cleanup_rules/go/rules.toml
Original file line number Diff line number Diff line change
Expand Up @@ -342,11 +342,11 @@ query = """
(
(block
(statement_list
(_)* @pre
(block
(((_) "\\n"?)* @pre)
((block
(statement_list) @nested.statements
) @nested.block
(_)* @post
) @nested.block)
(((_) "\\n"?)* @post)
) @outer.stmt_list
) @outer.block
)
Expand All @@ -364,9 +364,9 @@ query = """
(
(block
(statement_list
((statement)* @pre)
(((statement) "\\n"?)* @pre)
((return_statement) @r)
((statement)+ @post)
(((statement) "\\n"?)+ @post)
) @stmt_list
) @b
)
Expand Down

0 comments on commit c10f4a8

Please sign in to comment.