### ----------------------------------------------------
### -- LLM::Prompts
### -- Licenses: Artistic-2.0
### -- Authors: Anton Antonov
### -- File: t/02-prompt-parsing.rakutest
### ----------------------------------------------------
use v6.d;
use Test;

use LLM::Prompts;
use LLM::Prompts::Grammarish;

grammar PromptLine does LLM::Prompts::Grammarish {
    rule TOP { <prompt>  }
}

## 1
ok PromptLine.parse('This is a simple prompt');

## 2
ok PromptLine.parse('@Yoda The summer is gone.');

## 3
ok PromptLine.parse('The summer is gone, school is comming soon. #HaikuStyled');

## 4
ok PromptLine.parse('The summer is gone, school is comming soon. #HaikuStyled #Translated');

## 5
ok PromptLine.parse('The summer is gone, school is comming soon. #HaikuStyled #Translated|German');

## 6
ok PromptLine.parse('!Translated|Russian The summer is gone, school is comming soon.');

## 7
ok PromptLine.parse('!Translated|"High German" The summer is gone, school is comming soon.');

## 8
is
        (so PromptLine.parse('!Translated The summer is gone, school is comming soon.'){*;'prompt-function-cell-spec'}),
        True,
        'Parsing function cell spec';

## 9
is
        (so PromptLine.parse(' !Translated^ '){*;'prompt-function-prior-spec'}),
        True,
        'Parsing function prior spec';

done-testing;


