This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Why does treelang not support tabs?
- From: ja2morri at csclub dot uwaterloo dot ca (James Morrison)
- To: gcc at gcc dot gnu dot org
- Cc: tej at melbpc dot org dot au
- Date: Mon, 1 Dec 2003 23:34:52 -0500 (EST)
- Subject: Why does treelang not support tabs?
Hey,
I'm curious, why doesn't treelang support tabs? It's a really
easy change as demonstrated with the patch below.
Jim
2003-12-01 James A. Morrison <ja2morri@uwaterloo.ca>
* lex.l: Add \t as a whitespace character.
* treelang.texi (Lexical Syntax): Document a tab as whitespace.
Index: lex.l
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/treelang/lex.l,v
retrieving revision 1.7
diff -u -r1.7 lex.l
--- lex.l 6 May 2003 09:18:46 -0000 1.7
+++ lex.l 2 Dec 2003 04:25:28 -0000
@@ -78,7 +78,7 @@
((struct prod_token_parm_item *)yylval)->tp.tok.charno = next_tree_charno;
}
-[ \n]+ {
+[ \n\t]+ {
update_lineno_charno ();
NOT_RETURN (WHITESPACE);
}
Index: treelang.texi
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/treelang/treelang.texi,v
retrieving revision 1.8
diff -u -r1.8 treelang.texi
--- treelang.texi 4 Feb 2003 01:27:51 -0000 1.8
+++ treelang.texi 2 Dec 2003 04:25:31 -0000
@@ -399,8 +399,8 @@
@itemize @bullet
@item
-Whitespace consists of the space character and the end of line
-character. Tabs are not allowed. Line terminations are as defined by the
+Whitespace consists of the space character, a tab, and the end of line
+character. Line terminations are as defined by the
standard C library. Whitespace is ignored except within comments,
and where it separates parts of the program. In the example below, A and
B are two separate names separated by whitespace.