mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00

This includes a minor change to the docs .typos.toml file to not change the string 'tpe' to 'type'.
26 lines
505 B
Text
26 lines
505 B
Text
# @TEST-EXEC: echo "GET /index.html HTTP/1.0" | spicy-driver %INPUT >output
|
|
# @TEST-EXEC: btest-diff output
|
|
|
|
module MyHTTP;
|
|
|
|
const Token = /[^ \t\r\n]+/;
|
|
const WhiteSpace = /[ \t]+/;
|
|
const NewLine = /\r?\n/;
|
|
|
|
type Version = unit {
|
|
: /HTTP\//;
|
|
number: /[0-9]+\.[0-9]+/;
|
|
};
|
|
|
|
public type RequestLine = unit {
|
|
method: Token;
|
|
: WhiteSpace;
|
|
uri: Token;
|
|
: WhiteSpace;
|
|
version: Version;
|
|
: NewLine;
|
|
|
|
on %done {
|
|
print self.method, self.uri, self.version.number;
|
|
}
|
|
};
|