Skip to content

Commit 863b0f3

Browse files
committed
fix: address PR #68 review — remove ANTLR visitors, fix error handling, clean up docs
- Regenerate ANTLR parser with -no-visitor flag, removing 2649 lines of unused visitor code (mdlparser_base_visitor.go, mdlparser_visitor.go) - Restore .interp and .tokens files that were accidentally deleted - Fix opAttributeObjects silently discarding createAttributeObject errors - Fix deepCloneTemplate errors ignored in 3 test sites - Add warning logs in augmentFromMPK when clone/augment fails - Remove Claude-specific design docs from docs/plans/ Addresses remaining items from @ako's second review on PR #68.
1 parent bb4ca54 commit 863b0f3

16 files changed

Lines changed: 4193 additions & 6608 deletions

docs/plans/2026-03-30-widget-docs-and-customwidget.md

Lines changed: 0 additions & 129 deletions
This file was deleted.

docs/plans/2026-03-30-widget-docs-generation-design.md

Lines changed: 0 additions & 59 deletions
This file was deleted.

mdl/executor/widget_engine.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package executor
55
import (
66
"encoding/hex"
77
"fmt"
8+
"log"
89
"regexp"
910
"strings"
1011

@@ -338,10 +339,12 @@ func opAttributeObjects(obj bson.D, propTypeIDs map[string]pages.PropertyTypeIDE
338339
objects = append(objects, int32(2)) // BSON array version marker
339340

340341
for _, attrPath := range ctx.AttributePaths {
341-
attrObj, _ := ctx.pageBuilder.createAttributeObject(attrPath, entry.ObjectTypeID, nestedEntry.PropertyTypeID, nestedEntry.ValueTypeID)
342-
if attrObj != nil {
343-
objects = append(objects, attrObj)
342+
attrObj, err := ctx.pageBuilder.createAttributeObject(attrPath, entry.ObjectTypeID, nestedEntry.PropertyTypeID, nestedEntry.ValueTypeID)
343+
if err != nil {
344+
log.Printf("warning: skipping attribute %s: %v", attrPath, err)
345+
continue
344346
}
347+
objects = append(objects, attrObj)
345348
}
346349

347350
result := make(bson.D, 0, len(val))

mdl/grammar/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ endif
2727

2828
generate: check-antlr $(LEXER) $(PARSER)
2929
@mkdir -p $(OUTPUT_DIR)
30-
$(ANTLR4) -Dlanguage=Go -package $(PACKAGE) -o $(OUTPUT_DIR) $(LEXER) $(PARSER)
30+
$(ANTLR4) -Dlanguage=Go -no-visitor -package $(PACKAGE) -o $(OUTPUT_DIR) $(LEXER) $(PARSER)
3131
@echo "Generated Go parser in $(OUTPUT_DIR)/"
3232

3333
clean:

0 commit comments

Comments
 (0)