uben0 / tree-sitter-typst

Tree Sitter grammar for Typst
MIT License
114 stars 10 forks source link

fix: lable + reference syntax (TOKEN_LABEL) #13

Closed Ziqi-Yang closed 11 months ago

Ziqi-Yang commented 11 months ago

When writing my assignment today, I noticed that label and reference can starts with number, like <123>, @123. Typst Source Code

            '@' => self.ref_marker(),
            // ...
            _ => self.text(),

ref_marker appears before text and the definition of ref_marker uses only is_id_continue function.


I'm busy with academic stuffs recent months. Sorry for lazy contribution.

Ziqi-Yang commented 11 months ago

Find error in this fix: it allows space inside label, <el psy> or @ el(reference only allows the space at the beginning), while official online application doesn't allow this rule.