[Issue 9621] std.conv.parseEscape fails on octals and named

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Mar 1 04:12:39 PST 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9621



--- Comment #4 from Dmitry Olshansky <dmitry.olsh at gmail.com> 2013-03-01 04:12:34 PST ---
(In reply to comment #3)
> (In reply to comment #1)
> > If not I guess we shouldn't pretend it does and pull the whole freaking table
> > of HTML4/5 entities in *every* program that uses parse to read a couple of
> > ints.
> 
> How does std.uni does it?
> 

That's why I'm increasinlgy against of adding tables that are hidden behind
opaque interface. I feel uneasy about it. 

That's why I exposed all I  ould about tables & predefined sets in std.uni. For
instance any set is usable not only for std.uni puprposes. I also took
tremendous effort to not include tables unless user code needs them and will
seek new ways to avoid it.

Having a dead HTML5 entity table burried beneath innocently looking function is
NOT good enough. If we do it there HAS to be a way to tap into HTML entities so
that people wouldn't have to include the VERY SAME table twice should they need
full access to HTML5 entities.

> I mean, in the case I want to know if unicode character is white, does it mean
> I'll have to pull the entire unicode tables for isUpper etc. etc. etc.

Something I'm going to change. Technically there is no reason to pull these
tables. Also in case of parse the cost to benefit is far greater since if you
use isXXX you surely need the table, period. In case of parse you may easily
never hit escape sequence or even mean to unescape it in your data but you'd
pay all the same.

> I'm not trying to justify by comparison, but trying to see how other modules
> work with this "problem".

I thought std.conv.parse goal was closer to sscanf of C. In other words that
it's a backbone behind the formattedRead, readf etc.

If the goal is to parse whatever D strings are I fail to see the use case as
e.g. std.d.lexer would 100% likely to use its own tricks to process escapes
etc. to be more efficient.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list