Re: [PEPr] Comment on Web Services::Services_JSON

From: Date: Mon, 10 Oct 2005 15:34:32 +0000
Subject: Re: [PEPr] Comment on Web Services::Services_JSON
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-40126@lists.php.net to get a copy of this message
On 10 Oct 2005 05:16:22 -0000, Michal Migurski <mike-pear@teczno.com> wrote: > > Michal Migurski (http://pear.php.net/user/migurski) has commented on the proposal for Web > Services::Services_JSON. > > Comment: > > reduce_string() is called in two places to handle two possible locations > for "/*...*/" style comments - once at the very start of decode(), to > account for comments at the start & end of the entire JSON string, and > again inside the array/object literal parsing area to account for comments > inside brackets. > > This is the only way I know of to remove such comments without > accidentally munging strings that may contain "/*" or "*/". I'm confused now. I see comment handling in the main parsing loop: } elseif (($substr_chrs_c_2 == '/*') && in_array($top['what'], array(JSON_SLICE, JSON_IN_ARR, JSON_IN_OBJ))) { which should already handle comments inside of arrays and objects. If you just make that $top['what'] != JSON_IN_STR won't it just handle all comments anywhere except inside strings for you? I would much rather have all of your parsing be in the main parsing function than have those special comment cases. > > Proposal information: > http://pear.php.net/pepr/pepr-proposal-show.php?id=198 > > -- > Sent by PEPr, the automatic proposal system at http://pear.php.nety\d–?×$e4Ö > S“­ý > > -- > PEAR Development Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Justin Patrin

« previous php.pear.dev (#40126) next »