From 25a43125262390d4376f9d138208bf58bd9ac74e Mon Sep 17 00:00:00 2001 From: tromey Date: Sun, 16 Nov 2003 21:15:55 +0000 Subject: PR libgcj/13062: * java/io/StreamTokenizer.java (commentChar): Clear other attributes for character. (quoteChar): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73653 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/java/io/StreamTokenizer.java | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'libjava/java/io/StreamTokenizer.java') diff --git a/libjava/java/io/StreamTokenizer.java b/libjava/java/io/StreamTokenizer.java index 94341fa7620..a77b699ff17 100644 --- a/libjava/java/io/StreamTokenizer.java +++ b/libjava/java/io/StreamTokenizer.java @@ -1,5 +1,5 @@ /* StreamTokenizer.java -- parses streams of characters into tokens - Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation This file is part of GNU Classpath. @@ -167,14 +167,21 @@ public class StreamTokenizer } /** - * This method sets the comment attribute on the specified character. + * This method sets the comment attribute on the specified + * character. Other attributes for the character are cleared. * * @param c The character to set the comment attribute for, passed as an int */ public void commentChar(int ch) { if (ch >= 0 && ch <= 255) - comment[ch] = true; + { + comment[ch] = true; + whitespace[ch] = false; + alphabetic[ch] = false; + numeric[ch] = false; + quote[ch] = false; + } } /** @@ -566,13 +573,20 @@ public class StreamTokenizer /** * This method sets the quote attribute on the specified character. + * Other attributes for the character are cleared. * * @param c The character to set the quote attribute for, passed as an int. */ public void quoteChar(int ch) { if (ch >= 0 && ch <= 255) - quote[ch] = true; + { + quote[ch] = true; + comment[ch] = false; + whitespace[ch] = false; + alphabetic[ch] = false; + numeric[ch] = false; + } } /** -- cgit v1.2.3