diff --git a/.gitignore b/.gitignore index 62065ab2..2a1fd28a 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,5 @@ api.json nodes.json nohup.out *.tokens +recording.jsonl + diff --git a/README.md b/README.md index 0c467200..b84315b8 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,10 @@ Algol Family [https://wiki.c2.com/?AlgolFamily](https://wiki.c2.com/?AlgolFamily - import analysis support - in C#, import `namespace` can use call in namespace +### C issue + +Since Macro can be everywhere, If your code includes lots of Macro, it will be slow. + ### Kotlin - need to implementation `warpTargetFullType` to got Class in same package. diff --git a/chapi-ast-c/src/main/antlr/C.g4 b/chapi-ast-c/src/main/antlr/C.g4 index ac518b3b..cfe83296 100644 --- a/chapi-ast-c/src/main/antlr/C.g4 +++ b/chapi-ast-c/src/main/antlr/C.g4 @@ -474,7 +474,7 @@ macroStatement singleLineMacroDeclaration : '#' include (StringLiteral | ('<' includeIdentifier '>' )) #includeDeclaration - | '#' macroKeywords expression* (',' (expression | singleLineMacroDeclaration))* #defineDeclaration + | '#' macroKeywords expression* #defineDeclaration | '#' '#'? Identifier #macroCastDeclaration ; diff --git a/chapi-ast-c/src/test/kotlin/chapi/ast/cast/CFullIdentListenerTest.kt b/chapi-ast-c/src/test/kotlin/chapi/ast/cast/CFullIdentListenerTest.kt index 1042bdde..d5531110 100644 --- a/chapi-ast-c/src/test/kotlin/chapi/ast/cast/CFullIdentListenerTest.kt +++ b/chapi-ast-c/src/test/kotlin/chapi/ast/cast/CFullIdentListenerTest.kt @@ -17,7 +17,7 @@ internal class CFullIdentListenerTest { CAnalyser().analysis(it.readText(), it.name) val end = System.currentTimeMillis() val seconds = (end - start) / 1000 - println("cost ${end - start}ms ~ ${seconds}s") + println("cost ${end - start}ms") } } }