summaryrefslogtreecommitdiff
path: root/src/dged/syntax.c
diff options
context:
space:
mode:
authorAlbert Cervin <albert@acervin.com>2024-03-07 20:19:26 +0100
committerAlbert Cervin <albert@acervin.com>2024-03-07 20:19:26 +0100
commita13750209b3836a4a6a16a7ba881625f397f160f (patch)
tree86c6ee6af1b44b613c6abc913957dda000c069a7 /src/dged/syntax.c
parentf266c624ad197ea6add738df70702dcbf93cb198 (diff)
downloaddged-a13750209b3836a4a6a16a7ba881625f397f160f.tar.gz
dged-a13750209b3836a4a6a16a7ba881625f397f160f.tar.xz
dged-a13750209b3836a4a6a16a7ba881625f397f160f.zip
Implement timers properly
The timers shown with `M-x timers` are now actual timings.
Diffstat (limited to 'src/dged/syntax.c')
-rw-r--r--src/dged/syntax.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/src/dged/syntax.c b/src/dged/syntax.c
index 61f09c2..1544d33 100644
--- a/src/dged/syntax.c
+++ b/src/dged/syntax.c
@@ -17,6 +17,7 @@
#include "hash.h"
#include "minibuffer.h"
#include "path.h"
+#include "s8.h"
#include "settings.h"
#include "text.h"
#include "vec.h"
@@ -26,25 +27,6 @@ static uint32_t treesitter_path_len = 0;
static const char *parser_filename = "parser";
static const char *highlight_path = "queries/highlights.scm";
-// TODO: move to own file
-#define s8(s) ((struct s8){s, strlen(s)})
-
-struct s8 {
- char *s;
- uint32_t l;
-};
-
-static bool s8eq(struct s8 s1, struct s8 s2) {
- return s1.l == s2.l && memcmp(s1.s, s2.s, s1.l) == 0;
-}
-
-static char *s8tocstr(struct s8 s) {
- char *cstr = (char *)malloc(s.l + 1);
- memcpy(cstr, s.s, s.l);
- cstr[s.l] = '\0';
- return cstr;
-}
-
struct predicate {
uint32_t pattern_idx;