isac-java/src/java/isac/gui/mawen/editor/AstInfoUtil.scala
changeset 5214 733780043a0a
parent 5213 1f3173a59903
child 5216 a23bca3a94bd
equal deleted inserted replaced
5213:1f3173a59903 5214:733780043a0a
   106        }
   106        }
   107        return None
   107        return None
   108      }
   108      }
   109      case ast                                                   => None
   109      case ast                                                   => None
   110   }
   110   }
   111   //TODOWN ..: Option[Ast] = ...
   111   // introducing Option[Ast] would cause delicate changes
   112   def FindCursor(ast: Ast) : Ast = ast match {
   112   def FindCursor(ast: Ast) : Ast = ast match {
   113      case Appl(List(Constant("CURSOR"), a))                               => ast
   113      case Appl(List(Constant("CURSOR"), a))                               => ast
   114      case Appl(List(a, Constant("CURSOR")))                               => ast
   114      case Appl(List(a, Constant("CURSOR")))                               => ast
   115      case Appl(asts)                                                      => {
   115      case Appl(asts)                                                      => {
   116        val l = asts.map(x => FindCursor(x)).filter(y => y != null)
   116        val l = asts.map(x => FindCursor(x)).filter(y => y != null)
   119        }
   119        }
   120        return null
   120        return null
   121      }
   121      }
   122      case ast                                                             => null
   122      case ast                                                             => null
   123   }
   123   }
   124   //TODOWN ..: Option[Ast] = ...
   124   // introducing Option[Ast] would cause delicate changes
   125   def AstOfCursor(ast: Ast) : Ast = ast match {
   125   def AstOfCursor(ast: Ast) : Ast = ast match {
   126     case Appl(List(Constant("CURSOR"), a))           => a
   126     case Appl(List(Constant("CURSOR"), a))           => a
   127     case Appl(List(a, Constant("CURSOR")))           => a
   127     case Appl(List(a, Constant("CURSOR")))           => a
   128     case _ => null
   128     case _ => null
   129   }
   129   }