Added syntax colorization. Remove all references to deprecated lark_to_lezer module.

This commit is contained in:
2026-02-07 11:08:34 +01:00
parent 1c1ced2a9f
commit ab4f251f0c
7 changed files with 106 additions and 461 deletions

View File

@@ -9,10 +9,7 @@ from abc import ABC, abstractmethod
from functools import cached_property
from typing import List, Dict, Any
# TODO: Replace with lark_to_simple_mode when implemented
from myfasthtml.core.dsl.lark_to_lezer import (
extract_completions_from_grammar, # Will be moved to utils.py
)
from myfasthtml.core.dsl.lark_to_simple_mode import extract_completions_from_grammar
from myfasthtml.core.utils import make_safe_id
@@ -82,13 +79,13 @@ class DSLDefinition(ABC):
Returns:
Dictionary with:
- 'lezerGrammar': The Lezer grammar string
- 'simpleModeConfig': The CodeMirror Simple Mode configuration
- 'completions': The completion items
- 'name': The DSL name
"""
return {
"name": self.name,
"lezerGrammar": self.lezer_grammar,
"simpleModeConfig": self.simple_mode_config,
"completions": self.completions,
}