Skip to content

Commit bbc3db1

Browse files
committed
feat: Add a dsl member for Field
1 parent 91b3424 commit bbc3db1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/sphinxnotes/data/data.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,8 @@ class Field(Unpicklable):
260260
ctype: type | None = None
261261
#: Flags of field.
262262
flags: dict[str, Value] = dataclass_field(default_factory=dict)
263+
#: The orginal DSL.
264+
dsl: str | None = None
263265

264266
# Type hints for builtin flags.
265267
if TYPE_CHECKING:
@@ -343,7 +345,7 @@ class DSLParser:
343345

344346
def parse(self, dsl: str) -> None:
345347
"""Parses the DSL string into a Field object."""
346-
# Initialize form as None, implied scalar unless modifiers change it.
348+
self.dsl = dsl
347349
for mod in self._split_modifiers(dsl):
348350
if mod.strip():
349351
self._apply_modifier(mod.strip())

0 commit comments

Comments
 (0)