This is an automated email from the ASF dual-hosted git repository.

sergeykamov pushed a commit to branch NLPCRAFT-504
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git


The following commit(s) were added to refs/heads/NLPCRAFT-504 by this push:
     new e7c92f42 Minor fixes.
e7c92f42 is described below

commit e7c92f426d05761370c850946e41b1b82eb3ebd2
Author: Sergey Kamov <skhdlem...@gmail.com>
AuthorDate: Wed Jul 6 21:56:38 2022 +0300

    Minor fixes.
---
 .../org/apache/nlpcraft/internal/intent/compiler/NCIDLCompiler.scala    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/intent/compiler/NCIDLCompiler.scala
 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/intent/compiler/NCIDLCompiler.scala
index fcd121bf..322e7542 100644
--- 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/intent/compiler/NCIDLCompiler.scala
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/intent/compiler/NCIDLCompiler.scala
@@ -199,7 +199,7 @@ object NCIDLCompiler extends LazyLogging:
         override def exitFlowDecl(ctx: IDP.FlowDeclContext): Unit =
             val regex = NCUtils.trimQuotes(ctx.qstring().getText)
 
-            if regex != null && regex.length > 2 then flowRegex = if 
regex.nonEmpty then Option(regex) else None
+            if regex != null && regex.length > 2 then flowRegex = 
Option.when(regex.nonEmpty)(regex)
             if flowRegex.isDefined then // Pre-check.
                 try Pattern.compile(flowRegex.get)
                 catch case e: PatternSyntaxException => 
SE(s"${e.getDescription} in intent flow regex '${e.getPattern}' near index 
${e.getIndex}.")(ctx.qstring())

Reply via email to