diff -r 6273f89ab13d -r a4d22f197bd2 gameServer2/src/protocol/hwprotocol.lalrpop --- a/gameServer2/src/protocol/hwprotocol.lalrpop Thu Jan 05 19:07:01 2017 +0300 +++ b/gameServer2/src/protocol/hwprotocol.lalrpop Fri Jan 06 01:00:21 2017 +0300 @@ -1,17 +1,40 @@ -use std::str; +use std::string; +use std::str::FromStr; use super::messages::HWProtocolMessage::*; -use super::messages::HWProtocolMessage; +use super::messages::*; grammar; -pub ProtocolMessage: HWProtocolMessage<'input> = { - "NICK" => Nick(s), +pub ProtocolMessage: HWProtocolMessage = { + "\n\n", +}; + +SpecificMessage: HWProtocolMessage = { + "NICK" "\n" => Nick(<>), + "PONG" => Pong, + "PING" => Ping, + "PROTO" "\n" => Proto(<>), }; -Str: &'input str = { - => s, +Num32: u32 = + => number(<>); + +ProtocolString: String = + => <>.join(""); + +ProtocolChar: &'input str = + r"[^\n]" => <>; + +Digit: u8 = { + "0" => 0, + "1" => 1, + "2" => 2, + "3" => 3, + "4" => 4, + "5" => 5, + "6" => 6, + "7" => 7, + "8" => 8, + "9" => 9, }; - - -//Num32: i32 = => i32::from_str(s).unwrap();