From 2acf71f4ed17c31f59f0449efa6793cfeb28eb85 Mon Sep 17 00:00:00 2001 From: Christian Bauer Date: Wed, 21 Jun 2000 21:05:38 +0000 Subject: [PATCH] - '#' as the first character of a line starts a comment --- ginsh/ginsh.1 | 4 +++- ginsh/ginsh_lexer.ll | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ginsh/ginsh.1 b/ginsh/ginsh.1 index b84aca96..199b0e85 100644 --- a/ginsh/ginsh.1 +++ b/ginsh/ginsh.1 @@ -39,7 +39,9 @@ or type an EOF (Ctrl-D) at the prompt. .SS COMMENTS Anything following a double slash .RB ( // ) -up to the end of the line is treated as a comment and ignored. +up to the end of the line, and all lines starting with a hash mark +.RB ( # ) +are treated as a comment and ignored. .SS NUMBERS ginsh accepts numbers in the usual decimal notations. This includes arbitrary precision integers and rationals as well as floating point numbers in standard diff --git a/ginsh/ginsh_lexer.ll b/ginsh/ginsh_lexer.ll index d27d0fe2..ff585dab 100644 --- a/ginsh/ginsh_lexer.ll +++ b/ginsh/ginsh_lexer.ll @@ -56,6 +56,7 @@ AN [0-9a-zA-Z_] [ \t\n]+ /* skip whitespace */ \\$ /* skip line continuations */ "//".* /* skip comments starting with "//" */ +^"#".* /* skip lines starting with "#" */ ^"!".* system(yytext + 1); /* execute shell command */ /* special values */ -- 2.44.0