changeset 5066:05e4d8c0a840

[project @ 2004-11-04 20:38:46 by jwe]
author jwe
date Thu, 04 Nov 2004 20:38:50 +0000
parents 1312d3af9eb0
children 50f9e343a3ff
files src/ChangeLog src/pt-colon.cc src/pt-colon.h
diffstat 3 files changed, 24 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Thu Nov 04 20:12:11 2004 +0000
+++ b/src/ChangeLog	Thu Nov 04 20:38:50 2004 +0000
@@ -1,5 +1,8 @@
 2004-11-04  John W. Eaton  <jwe@octave.org>
 
+	* pt-colon.cc (tree_colon_expression::line,
+	tree_colon_expression::column): New functions.
+
 	* oct-stream.cc (octave_stream::seek (long, int)): Return error
 	(but leave file position unchanged) for attempt to seek beyond end
 	of file.
--- a/src/pt-colon.cc	Thu Nov 04 20:12:11 2004 +0000
+++ b/src/pt-colon.cc	Thu Nov 04 20:38:50 2004 +0000
@@ -168,6 +168,24 @@
 	   line (), column ());
 }
 
+int
+tree_colon_expression::line (void) const
+{
+  return (op_base ? op_base->line ()
+	  : (op_inc ? op_inc->line ()
+	     : (op_limit ? op_limit->line ()
+		: -1)));
+}
+
+int
+tree_colon_expression::column (void) const
+{
+  return (op_base ? op_base->column ()
+	  : (op_inc ? op_inc->column ()
+	     : (op_limit ? op_limit->column ()
+		: -1)));
+}
+
 void
 tree_colon_expression::accept (tree_walker& tw)
 {
--- a/src/pt-colon.h	Thu Nov 04 20:12:11 2004 +0000
+++ b/src/pt-colon.h	Thu Nov 04 20:38:50 2004 +0000
@@ -86,6 +86,9 @@
 
   tree_expression *increment (void) { return op_increment; }
 
+  int line (void) const;
+  int column (void) const;
+
   void accept (tree_walker& tw);
 
 private: