之前的Erlang语法错误:';结束';第55行

之前的Erlang语法错误:';结束';第55行,erlang,syntax-error,Erlang,Syntax Error,找不到语法错误,我搜索了错位/缺失的“;”,“,”,“end”,还搜索了缺失的括号,但没有找到。 有什么想法吗 对不起,糟糕的英语和西班牙式英语代码 partida(ID,Tablero,Turno,Name1,Psocket1,Name2,Psocket2,SpectList) -> case (Psocket1 == " ") of true -> F = fun() -> case mnesia:read(juegos,ID) of [P1] ->

找不到语法错误,我搜索了错位/缺失的“;”,“,”,“end”,还搜索了缺失的括号,但没有找到。 有什么想法吗

对不起,糟糕的英语和西班牙式英语代码

partida(ID,Tablero,Turno,Name1,Psocket1,Name2,Psocket2,SpectList) ->
 case (Psocket1 == " ") of
 true -> F = fun() -> case mnesia:read(juegos,ID) of
        [P1] ->
            case mnesia:read(nombre,P1#juegos.jg1) of
                [] -> exit(normal);
                [A] -> P2 = A#nombre.psocket
            end,
            case mnesia:read(nombre,P1#juegos.jg2) of
                [] -> exit(normal);
                [B] -> P3 = B#nombre.psocket
            end,
            Res = {P1#juegos.jg1,P2,P1#juegos.jg2,P3,P1#juegos.spect};
         _  -> Res = ok,exit(normal)                         
        end,
        Res end,
        {atomic,Arg} = mnesia:transaction(F),
        partida(ID,Tablero,Turno,element(1,Arg),element(2,Arg),element(3,Arg),element(4,Arg),element(5,Arg))
end,
receive
    case Jugada of
        [Pj,"bye"] -> ok;
        [Pj,F]   -> Posicion = element(1,string:to_integer(F)),
                    case (Name1 == Pj) and ((Turno rem 2) == 1) of
                        true -> case not(Posicion == error) and  (Posicion < 10) of
                                    true -> ok;%%jugada valida
                                    _  -> ok %%Jugada ilegal
                                end;
                        false ->ok %%No es tu turno
                    end,
                    case (Name2 == Pj) and ((Turno rem 2) == 0) of
                        true -> case (not(Posicion == error) and (Posicion < 10)) of
                                    true ->ok; %%jugada valida
                                     _ -> ok %%Jugada ilegal
                                end;
                        false -> ok %%No es tu turno
                    end
    end
end, %% Line 55
ASD = get_spects(ID),partida(ID,Tablero,Turno,Name1,Psocket1,Name2,Psocket2,ASD).
partida(ID、Tablero、Turno、Name1、Psocket1、Name2、Psocket2、SpectList)->
的大小写(Psocket1==“”)
true->F=fun()->case mnesia:read(juegos,ID)of
[P1]>
案例记忆:阅读(nombre,P1#juegos.jg1)
[]->退出(正常);
[A] ->P2=A#nombre.psocket
终止
案例记忆:阅读(nombre,P1#juegos.jg2)
[]->退出(正常);
[B] ->P3=B#nombre.psocket
终止
Res={P1#juegos.jg1,P2,P1#juegos.jg2,P3,P1#juegos.spect};
_->Res=正常,退出(正常)
终止
最后,
{atomic,Arg}=mnesia:transaction(F),
partida(ID,Tablero,Turno,元素(1,Arg),元素(2,Arg),元素(3,Arg),元素(4,Arg),元素(5,Arg))
终止
接收
Jugada案件
[Pj,“再见”]->好的;
[Pj,F]->Posicion=元素(1,字符串:to_整数(F)),
案例(名称1==Pj)和(Turno rem 2)==1)
true->case not(Posicion==错误)和(Posicion<10)
正确->正常;%%胡加达·瓦利达
_->ok%%Jugada ilegal
终止
false->ok%%否es tu turno
终止
案例(名称2==Pj)和(Turno rem 2)==0)
true->case(非(Posicion==错误)和(Posicion<10))的
正确->正常;%%胡加达·瓦利达
_->ok%%Jugada ilegal
终止
false->ok%%否es tu turno
终止
终止
结束,%%第55行
ASD=get_spects(ID),partida(ID,Tablero,Turno,Name1,Psocket1,Name2,Psocket2,ASD)。

您在
receive
子句中有语法错误

1> case oops of _ -> ok end. % correct
ok
2> receive (case oops of _ -> ok end) end.
* 1: syntax error before: 'end'
receive
语句用于读取进程的Erlang消息。在这里,您并没有等待任何消息,而是在
receive
子句的主体中执行一些操作!如果您不想检查消息,但希望在收到第一条消息后执行某些操作,我建议使用
\uuu
进行模式匹配:

3> receive _ -> (case oops of _ -> ok end) end.
%% Waits for a message
实际上,您可以没有
receive
子句,但如下所示:

4> receive after 1000 -> done end. %% Sleeps 1000 ms and does not care about any incoming message
done

但是如果没有任何模式匹配,就不能在
receive
子句中编写代码。

似乎receive语法有问题。