Skip to content

Pass source line:offset info to treebuilders #169

Open
@yurikhan

Description

@yurikhan

After attempting to implement content model validation (#166), I am convinced it is best implemented as a postprocessing step on the tree already built (because of all the context-sensitive content model rules).

In order to be able to report violations usefully, this needs source line:offset information in the tree, for at least one treebuilder.

The changes needed to propagate relevant data from the stream would most probably involve at least tokenizer, token structure, and treebuilders.

Some treebuilders wouldn’t know by default what to do about the source offset (lxml’s Element is sealed to property extension and going custom element may be a performance issue) but that’s okay as long as the information is available.

Extends: #97
Blocks: #166

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions