diff libinterp/parse-tree/lex.h @ 16106:031117f4db7c

use enum for values returned by eat_continuation and eat_whitespace * lex.ll, lex.h (lexical_feedback::whitespace_type): New enum. (yum_yum): Delete typedef. (ATE_NOTHING, ATE_SPACE_OR_TAB, ATE_NEWLINE): Replace with NO_WHITESPACE, SPACE_OR_TAB, NEWLINE values from lexical_feedback::whitespace_type enum. When result of eat_continuation is used as a logical test for whitespace or no whitespace, compare to lexical_feedback::NO_WHITESPACE to produce bool value.
author John W. Eaton <jwe@octave.org>
date Mon, 25 Feb 2013 23:48:32 -0500
parents b7de58feb2d3
children 3b791008b88e
line wrap: on
line diff
--- a/libinterp/parse-tree/lex.h
+++ b/libinterp/parse-tree/lex.h
@@ -61,6 +61,24 @@
 {
 public:
 
+  // Did eat_whitespace or eat_continuation eat a space or tab, or a
+  // newline, or both?
+  //
+  // Functions that return this type will return a logical OR of the
+  // following values:
+  //
+  //  NO_WHITESPACE  no spaces to eat
+  //  SPACE_OR_TAB   space or tab in input
+  //  NEWLINE        bare new line in input
+
+  enum whitespace_type
+    {
+      NO_WHITESPACE = 1,
+      SPACE_OR_TAB = 2,
+      NEWLINE = 4
+    };
+
+
   // Track nesting of square brackets, curly braces, and parentheses.
 
   class bbp_nesting_level