Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile.cbm
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ frontend:
cd graph-ui && npm ci && npm run build

embed: frontend
scripts/embed-frontend.sh graph-ui/dist $(BUILD_DIR)/embedded
sh scripts/embed-frontend.sh graph-ui/dist $(BUILD_DIR)/embedded

cbm-with-ui: embed $(OBJS_VENDORED_PROD)
$(CC) $(CFLAGS_PROD) -o $(BUILD_DIR)/codebase-memory-mcp \
Expand Down
1 change: 1 addition & 0 deletions internal/cbm/cbm.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ typedef enum {
CBM_LANG_SOSL,
CBM_LANG_KUSTOMIZE, // kustomization.yaml — Kubernetes overlay tool
CBM_LANG_K8S, // Generic Kubernetes manifest (apiVersion: detected)
CBM_LANG_PINE, // Pine Script
CBM_LANG_COUNT
} CBMLanguage;

Expand Down
3 changes: 3 additions & 0 deletions internal/cbm/grammar_pine.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Vendored tree-sitter grammar: pine
#include "vendored/grammars/pine/parser.c"
#include "vendored/grammars/pine/scanner.c"
16 changes: 16 additions & 0 deletions internal/cbm/lang_specs.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ extern const TSLanguage *tree_sitter_gomod(void);
extern const TSLanguage *tree_sitter_apex(void);
extern const TSLanguage *tree_sitter_soql(void);
extern const TSLanguage *tree_sitter_sosl(void);
extern const TSLanguage *tree_sitter_pine(void);

// -- Empty sentinel --
static const char *empty_types[] = {NULL};
Expand Down Expand Up @@ -1478,6 +1479,16 @@ static const char *sosl_module_types[] = {"source_file", NULL};

static const char *make_func_types[] = {"recipe", NULL};
static const char *make_import_types[] = {"include", "include_directive", NULL};

// ==================== PINE SCRIPT ====================
static const char *pine_func_types[] = {"function_declaration_statement", NULL};
static const char *pine_class_types[] = {"type_definition_statement", NULL};
static const char *pine_module_types[] = {"source_file", NULL};
static const char *pine_call_types[] = {"call", NULL};
static const char *pine_var_types[] = {"variable_definition_statement", "tuple_declaration_statement", NULL};
static const char *pine_branch_types[] = {"if_statement", "switch_statement", "for_statement", "for_in_statement", "while_statement", NULL};
static const char *pine_assign_types[] = {"reassignment_statement", NULL};

// ==================== SPEC TABLE ====================

static const CBMLangSpec lang_specs[CBM_LANG_COUNT] = {
Expand Down Expand Up @@ -2402,6 +2413,11 @@ static const CBMLangSpec lang_specs[CBM_LANG_COUNT] = {
empty_types, empty_types, empty_types, empty_types, empty_types, empty_types,
empty_types, NULL, empty_types, NULL, NULL, tree_sitter_yaml},

// CBM_LANG_PINE
[CBM_LANG_PINE] = {CBM_LANG_PINE, pine_func_types, pine_class_types, empty_types, pine_module_types,
pine_call_types, empty_types, empty_types, pine_branch_types, pine_var_types,
pine_assign_types, empty_types, NULL, empty_types, NULL, NULL, tree_sitter_pine},

};

_Static_assert(sizeof(lang_specs) / sizeof(lang_specs[0]) == CBM_LANG_COUNT,
Expand Down
Loading