gameServer2/src/protocol/hwprotocol.lalrpop
author unc0rr
Thu, 05 Jan 2017 19:07:01 +0300
changeset 12130 6273f89ab13d
child 12131 a4d22f197bd2
permissions -rw-r--r--
Start on messages parser
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12130
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
     1
use std::str;
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
     2
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
     3
use super::messages::HWProtocolMessage::*;
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
     4
use super::messages::HWProtocolMessage;
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
     5
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
     6
grammar;
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
     7
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
     8
pub ProtocolMessage: HWProtocolMessage<'input> = {
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
     9
    "NICK" <s:Str> => Nick(s),
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    10
};
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    11
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    12
Str: &'input str = {
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    13
    <s:r"[^\n]\n"> => s,
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    14
};
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    15
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    16
6273f89ab13d Start on messages parser
unc0rr
parents:
diff changeset
    17
//Num32: i32 = <s:r"[0-9]+"> => i32::from_str(s).unwrap();