From 096b91e93aeb0f7057c5204da9a9ab1435f093f6 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Sun, 15 Mar 2015 21:13:26 -0300 Subject: [PATCH] cameo/lang.l: require all commands followed by file name to end with whitespace This avoids embarrassment after typos like write-gerber foo.g --- cameo/lang.l | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cameo/lang.l b/cameo/lang.l index e1155e9..dac599a 100644 --- a/cameo/lang.l +++ b/cameo/lang.l @@ -62,19 +62,19 @@ NUM -?[0-9]+\.?[0-9]* y return TOK_Y; z return TOK_Z; -append { BEGIN(FILENAME); +append/[ \t\n] { BEGIN(FILENAME); return TOK_APPEND; } gerber { file_name_follows = 1; return TOK_GERBER; } gnuplot { file_name_follows = 1; return TOK_GNUPLOT; } -excellon { BEGIN(FILENAME); +excellon/[ \t\n] { BEGIN(FILENAME); return TOK_EXCELLON; } -stl { BEGIN(FILENAME); +stl/[ \t\n] { BEGIN(FILENAME); return TOK_STL; } -write { BEGIN(FILENAME); +write/[ \t\n] { BEGIN(FILENAME); return TOK_WRITE; } -write_gerber { BEGIN(FILENAME); +write_gerber/[ \t\n] { BEGIN(FILENAME); return TOK_WRITE_GERBER; } dog return TOK_DOG;