Mercurial > hg > octave-nkf
view test/ctor-vs-method/@parent/parent.m @ 20800:7c0e10f035bd
Extend parser to accept binary constants that begin with '0b' or '0B'.
* NEWS: Announce change:
* lex.ll: Define NUMBIN to be 0[bB] followed by 0,1, or '_'.
Define NUMBER to be NUMREAL|NUMHEX|NUMBIN.
*lex.ll (looks_like_bin): New function to detect 0[bB] prefix.
*lex.ll (handle_numbe): Call looks_like_bin() and if found then convert
binary string to double.
* parser.tst: Add tests for new behavior.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 09 Oct 2015 18:52:58 -0700 |
parents | 501cb6a90f0f |
children |
line wrap: on
line source
function rot = parent (a) __trace__ ('begin parent/parent'); if (nargin == 0) rot = class (struct (), 'parent'); else switch class (a) case 'parent' %% copy constructor rot = a; otherwise error ('type mismatch in parent constructor') end end __trace__ ('end parent/parent'); end