giellalt / giella-core

Build tools and build support files as well as developer support tools for the GiellaLT repositories.
https://giellalt.uit.no
GNU General Public License v3.0
7 stars 2 forks source link

Parsing errors in lexc2markdown using new variables #18

Closed snomos closed 2 years ago

snomos commented 2 years ago

The following lexc code:

LEXICON NounRoot
!! ## The lexicon @LEXNAME@
!! This lexicon is the start of all noun lemmas. It splits the nouns in three
!! classes as follows:

!! ```mermaid
!! stateDiagram-v2
!! direction LR
  FirstComponent ; !!≈ @LEXNAME@ --> @LEMMA@
  HyphNouns      ; !!≈ @LEXNAME@ --> @LEMMA@
  Noun           ; !!≈ @LEXNAME@ --> @CONTLEX@
!! ```

results in the following markdown fragment:

## The lexicon NounRoot
This lexicon is the start of all noun lemmas. It splits the nouns in three
classes as follows:

```mermaid
stateDiagram-v2
direction LR
FirstComponent ;   FirstComponent ;  NounRoot --> FirstComponent
HyphNouns ;   HyphNouns      ;  NounRoot --> HyphNouns
Noun ;   Noun           ;  NounRoot --> ;

Expected:

````md
## The lexicon NounRoot
This lexicon is the start of all noun lemmas. It splits the nouns in three
classes as follows:

```mermaid
stateDiagram-v2
direction LR
NounRoot --> 
NounRoot --> 
NounRoot --> Noun
flammie commented 2 years ago

It should work if the epsilon lemma is written explicitly as 0 or 0:0 :-)

snomos commented 2 years ago

I added 0's, and the output got cleaner, but not as it should be 🙂 :

LEXICON NounRoot
!! ## The lexicon @LEXNAME@
!! This lexicon is the start of all noun lemmas. It splits the nouns in three
!! classes as follows:

!! ```mermaid
!! stateDiagram-v2
!! direction LR
 0 FirstComponent ; !!= @LEXNAME@ --> @CONTLEX@
 0 HyphNouns      ; !!= @LEXNAME@ --> @CONTLEX@
 0 Noun           ; !!= @LEXNAME@ --> @CONTLEX@
!! ```

Results in this:

## The lexicon NounRoot
This lexicon is the start of all noun lemmas. It splits the nouns in three
classes as follows:

```mermaid
stateDiagram-v2
direction LR
 0 FirstComponent ;  NounRoot --> FirstComponent
 0 HyphNouns      ;  NounRoot --> HyphNouns
 0 Noun           ;  NounRoot --> Noun

That is, the raw lexc code is also included.