在修复以下代码数小时后,我陷入了以下编译错误消息,无论我尝试什么,我都无法修复它。
错误:语法错误:删除 END RPAREN FUN
代码是:
fun we (array1 , k, n, fif1) = if Queue.isEmpty fif1 then (array1, ~1 , n ,
fif1 )
else (
let
val b = Queue.head(fif1)
val y = Queue.dequeue(fif1)
val z = #1 b
in
if ( (Array.sub (array1 , z)) = (What) ) then (array1 , #2 y , n , fif1 ) else
(
if (Array.sub (array1 ,(z+n) ) <> ( Block) ) then (
( Queue.enqueue ( fif1 , (z, (#2 b) ))) ; Array.update (array1 , ((z)+n) , Block)) else ();
if ( (Array.sub (array1 , (z+1)) ) <> ( Block) ) then (
Queue.enqueue ( fif1 ,((z+1), ((#2b) + 1))); Array.update (array1 , (z+1) , Block)) else () ;
if (Array.sub (array1 , (z-1 ) ) <> ( Block) ) then (
Queue.enqueue ( fif1 , (((z-1), ((#2 b)+1) ) )) ; Array.update (array1 , (z-1) , Block)) else () ;
if ( (Array.sub (array1 , (z-n ) )) <> (Block) ) then
( Queue.enqueue ( fif1 , ((z-n), ((#2 b)+2 )) ); Array.update (array1 , (z-n) , Block) ) else () ;
we (array1 , k, n , fif1));
end )
fun tb filename =
let
val (n, array1) = parse filename
val c = findt (T, array1, 0)
val fif1 = Queue.mkQueue ()
in
#2 we (array1, 0, n, Queue.enqueue (fif1 , (c,0) ) )
end
错误信息是关于这部分代码的
we (array1 , k, n , fif1));
end )
fun tb filename =
任何可能的帮助将不胜感激,在此先感谢!