gboere / tree-sitter-fountain

Fountain grammar for tree-sitter.
MIT License
0 stars 1 forks source link

bug: Missing grammar rules #2

Open Evrey opened 2 weeks ago

Evrey commented 2 weeks ago

Did you check existing issues?

Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)

No response

Describe the bug

Heyo, i was investigating whether this parser would be capable of processing the scripts i have written. Here’s a list of grammar rules that would have to be implemented for that to happen. I’m aware this parser is described as »rudimentary«, so view this as a kind of To-Do list towards eventual feature completeness.

Nice to haves:

Steps To Reproduce/Bad Parse Tree

Example structure for the scripts i’m writing:

Title:
    _**MY SCRIPT**_
Credit: Written by
Author: Me
Source: Based on That Thing
        by These Guys
Draft date: 1997-01-31

.PAGE. Location, Sublocation - NIGHT #1#

= Introduces this or that concept.

!**PANEL 1 - FULL ROW, NO BORDER**

Abusing action text as panel headings, scene headings as page headings, turning this into a comic book script. The `!` above should not appear as action text, for it’s a forced-action marker character.

SFX
poof

CHARACTER (V.O.)
Stuff happened.

> TO DOUBLE:

===

.PAGES①. Location, Sublocation - CONTINUOUS #2#

Custom scene transition with `>`, explicit page break.

> CONT:

===

>(CONTINUE)<
.PAGES②. Location, Sublocation - CONTINUOUS #3#

TO:

===

Expected Behavior/Parse Tree

Semantics of title page metadata, custom transitions, forced actions, etc. should’ve been recognised and preserved.

Repro

No response

emalcxe commented 1 week ago

3 meets Most of these tasks, I wrote a tree-sitter test based on the example. Text emphasis left out, and a few rules here and there

Evrey commented 1 week ago

Hi, awesome, thanks! I’ll take a look.