## $Id: seeds_cxgen.txt,v 1.4 2026/10/26 21:11:28 rec Exp $
##
## Seeds for fuzz_cxgen.c: small descriptions, valid and not.  The full
## example grammars (examples/*/*.cx, tests/*.cx) are replayed as files
## by tests/t_fuzz.sh as well, so they need not be copied here.
##
package p;
command go help "go" handler h_go;
%%
package p;
privilege { a, b };
type t : int range 1 .. 9 unit "u" help "t";
enum e { x help "x", y help "y" };
keyword set help "set";
command set <v:t> default "3" help "s" example "set 3" privilege b handler h;
command set mode <m:e> default $m help "m" handler h;
macro q "set 3" help "q" privilege b;
mode m prompt "p" { command exit help "x" exits; }
command enter help "e" enters m handler h;
%%
package p;
type t : int range 9 .. 1;
enum e { x, x };
command go go help "dup";
command go go help "dup";
%%
package p;
include "nonexistent.cx";
include "<h.h>";
command x (noise) <a:string*> help "greedy" handler h;
%%
package p; command "unterminated
%%
/* comment only, never closed
%%
## Found by the final fuzz_cxgen campaign, 2026-10-26: a lexical error
## right after an include path leaked the path.  Fixed in cxg_parse_decl().
package p;\nipackage p;\ninclude "nonexiste\xff "\xffn
%%
## Found by the second fuzz_cxgen campaign, 2026-10-26: a command spelled
## like an earlier one that had no handler reached the same node, and
## cxg_place() overwrote its strings without freeing them.
package p;\nprivilege { a, b };\ntype t : int range 0 .. 9 unit "u" help "\x8b";\nenum e { x help "x", y help "y" };\nkeyword set help "set";\ncommand set <v:t> default "3" help "s" example "s\x25t 3";\nkeyword set help "set";\ncommand set <v:t> default "3" help "s" example "s\x25t 3" privilege b handler h;\ncommand sE <m:e> default $m help "m" handler h;\nmacro q "set 3" help "q" privileenters m handler h;
%%
## Found by the third fuzz_cxgen campaign, 2026-10-26: including a
## directory sized a buffer from ftell(3) on it.  Fixed in cxg_lex_open().
package p;\ninclude ".";\ncommand x help "x" handler h;
