Skip to content

Commit ae0725b

Browse files
doc: add c tips
1 parent c0e61b8 commit ae0725b

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

website/catalog/c/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
This page curates a list of example ast-grep rules to check and to rewrite C code.
44

5+
:::tip C files can be parsed as Cpp
6+
You can parse C code as Cpp to avoid rewriting similar rules. The [`languageGlobs`](/reference/sgconfig.html#languageglobs) option can force ast-grep to parse `.c` files as Cpp.
7+
:::
8+
59
<!--@include: ./match-function-call.md-->
610
<!--@include: ./rewrite-method-to-function-call.md-->
711
<!--@include: ./yoda-condition.md-->

website/catalog/cpp/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Cpp
2+
3+
This page curates a list of example ast-grep rules to check and to rewrite Cpp code.
4+
5+
:::tip Reuse Cpp rules with C
6+
Cpp is a superset of C, so you can reuse Cpp rules with C code. The [`languageGlobs`](/reference/sgconfig.html#languageglobs) option can force ast-grep to parse `.c` files as Cpp.
7+
:::

0 commit comments

Comments
 (0)