support empty param in lg template (#2855)
This commit is contained in:
Родитель
1ff28118b2
Коммит
c20ac4ce0e
|
@ -40,7 +40,7 @@ templateName
|
|||
;
|
||||
|
||||
parameters
|
||||
: OPEN_PARENTHESIS? IDENTIFIER (COMMA IDENTIFIER)* CLOSE_PARENTHESIS?
|
||||
: OPEN_PARENTHESIS (IDENTIFIER (COMMA IDENTIFIER)*)? CLOSE_PARENTHESIS
|
||||
;
|
||||
|
||||
templateBody
|
||||
|
|
|
@ -209,16 +209,6 @@ namespace Microsoft.Bot.Builder.LanguageGeneration
|
|||
{
|
||||
result.AddRange(Visit(context.templateBody()));
|
||||
}
|
||||
|
||||
var parameters = context.templateNameLine().parameters();
|
||||
if (parameters != null)
|
||||
{
|
||||
if (parameters.CLOSE_PARENTHESIS() == null
|
||||
|| parameters.OPEN_PARENTHESIS() == null)
|
||||
{
|
||||
result.Add(BuildLGDiagnostic($"parameters: {parameters.GetText()} format error", context: context.templateNameLine()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
> Welcome Phrase template
|
||||
> LG runtime will pick a text value from the one-of collection list at random.
|
||||
# wPhrase
|
||||
# wPhrase ()
|
||||
- Hi
|
||||
- Hello
|
||||
- Hiya
|
||||
|
||||
> Using a template in another template
|
||||
> Sometimes the bot will say 'Hi' and other times it will say 'Hi :)'
|
||||
# welcome-user
|
||||
# welcome-user()
|
||||
- [wPhrase]
|
||||
- [wPhrase] :)
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче