From f23b9bc6375797d03dee54a31fcaa634f8376975 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 26 Jul 2021 20:59:45 -0700 Subject: Introduced cache to greatly speed up many use cases --- grammars/c++.bp | 4 ++-- grammars/c.bp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'grammars') diff --git a/grammars/c++.bp b/grammars/c++.bp index 30f47aa..333e9f3 100644 --- a/grammars/c++.bp +++ b/grammars/c++.bp @@ -24,5 +24,5 @@ keyword: "unsigned" / "using" / "virtual" / "void" / "volatile" / "wchar_t" / "while" / "xor" / "xor_eq" function-def: ^_ 2+(id / keyword / anglebraces / `*) % __ parens (__`; / >(__`{)) function: function-def __ braces -macro: ^"#define"} ..$ *(<`\ \n..$) -import: ^("#include"}/"#import"}) __ (string / `<..`>) +macro: ^"#define"\b ..$ *(<`\ \n..$) +import: ^`#("include"/"import")\b __ (string / `<..`>) diff --git a/grammars/c.bp b/grammars/c.bp index 36f580b..015e5ed 100644 --- a/grammars/c.bp +++ b/grammars/c.bp @@ -17,5 +17,5 @@ keyword: "volatile" / "while" function-def: ^_ 2+(id / keyword / `*) % __ parens (__`; / >(__`{)) function: function-def __ braces -macro: ^"#define"} ..$ *(<`\ \n..$) -import: ^"#include"} __ (string / `<..`>) +macro: ^"#define"\b ..$ *(<`\ \n..$) +import: ^"#include"\b __ (string / `<..`>) -- cgit v1.2.3