changeset 22880:a13e9853b678

maint: Periodic merge of stable to default.
author John W. Eaton <jwe@octave.org>
date Sat, 10 Dec 2016 11:36:50 -0500
parents 3c0e70e2f51c (current diff) 194481349d22 (diff)
children f84aa17075d4
files libinterp/parse-tree/oct-parse.in.yy scripts/general/display.m test/classdef/classdef.tst
diffstat 6 files changed, 24 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/parse-tree/oct-parse.in.yy	Fri Dec 09 15:34:48 2016 -0500
+++ b/libinterp/parse-tree/oct-parse.in.yy	Sat Dec 10 11:36:50 2016 -0500
@@ -1745,7 +1745,7 @@
 property_list
                 : class_property
                   { $$ = new tree_classdef_property_list ($1); }
-                | property_list opt_sep class_property
+                | property_list sep class_property
                   {
                     YYUSE ($2);
 
@@ -1756,7 +1756,7 @@
 
 class_property  : identifier
                   { $$ = new tree_classdef_property ($1); }
-                | identifier '=' decl_param_init expression ';'
+                | identifier '=' decl_param_init expression
                   {
                     YYUSE ($2);
 
--- a/scripts/general/display.m	Fri Dec 09 15:34:48 2016 -0500
+++ b/scripts/general/display.m	Sat Dec 10 11:36:50 2016 -0500
@@ -49,11 +49,7 @@
   endif
 
   ## Only reason we got here is that there was no overloaded display function.
-  ## If obj is truly an instance of a class then there is nothing to be done.
-  ## However, if obj is really a built-in like 'double' then we can display it.
-  if (isobject (obj))
-    error ('display: not defined for class "%s"', class (obj));
-  endif
+  ## Rely on built-in functions to display whatever obj is.
 
   varname = inputname (1);
   if (! isempty (varname))
@@ -76,3 +72,4 @@
 ## Test input validation
 %!error display ()
 %!error display (1,2)
+
--- a/test/classdef/classdef.tst	Fri Dec 09 15:34:48 2016 -0500
+++ b/test/classdef/classdef.tst	Sat Dec 10 11:36:50 2016 -0500
@@ -71,3 +71,7 @@
 %! obj = foo_method_changes_property_size (3);
 %! obj = obj.move_element_to_end (2);
 %! assert (obj.element, [1 3 2]);
+
+%!error <parse error> plist_t1
+%!assert (class (plist_t2), "plist_t2")
+%!assert (class (plist_t3), "plist_t3")
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/classdef/plist_t1.m	Sat Dec 10 11:36:50 2016 -0500
@@ -0,0 +1,5 @@
+classdef plist_t1
+  properties
+    a = 1 b
+  end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/classdef/plist_t2.m	Sat Dec 10 11:36:50 2016 -0500
@@ -0,0 +1,5 @@
+classdef plist_t2
+  properties
+    a = 1; b
+  end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/classdef/plist_t3.m	Sat Dec 10 11:36:50 2016 -0500
@@ -0,0 +1,6 @@
+classdef plist_t3
+  properties
+    a = 1
+    b
+  end
+end