From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,c689b55786a9f2bd X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!.POSTED!not-for-mail From: Warren Newsgroups: comp.lang.ada Subject: Re: for S'Image use Func?? Date: Mon, 10 May 2010 20:16:37 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <4be417b4$0$6992$9b4e6d93@newsspool4.arcor-online.net> <1qcb6z4i20dyb.1dz2hd4c0vx69.dlg@40tude.net> <84r4k5Ftk8U1@mid.individual.net> Injection-Date: Mon, 10 May 2010 20:16:37 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="9f8M0iN5t54V+4DF/iqO8g"; logging-data="15188"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+PdzoRRm69nwe0/GWmCwaFK1PGdKeVJHI=" User-Agent: Xnews/5.04.25 X-Face: &6@]C2>ZS=NM|HE-^zWuryN#Z/2_.s9E|G&~DRi|sav9{E}XQJb*\_>=a5"q]\%A;5}LKP][1mA{gZ,Q!j Cancel-Lock: sha1:YSh7WuIwz6/pZgXNXQ5pgTbGYbU= Xref: g2news2.google.com comp.lang.ada:11468 Date: 2010-05-10T20:16:37+00:00 List-Id: Niklas Holsti expounded in news:84r4k5Ftk8U1@mid.individual.net: > Warren wrote: >> Dmitry A. Kazakov expounded in >> news:1qcb6z4i20dyb.1dz2hd4c0vx69.dlg@40tude.net: >> >>> On Mon, 10 May 2010 16:52:18 +0000 (UTC), Warren wrote: >>>> But if I recall correctly, I also cannot get an >>>> empty string as input. An empty string is still >>>> valid input. >>> Hmm, try this: >> >> Ok, good- that at least works. >> >> But you have no way to know when you've read >> a empty line in a lexer routine that is reading >> character by character. > > Yes you do... > >> What you end up having to do is to >> test for line number changes instead-- yuk. > > ... if you read character by character, use the function > Text_IO.End_Of_Line to detect the end of an input line. This works > the same way in all systems, whatever line termination character > (sequence), if any, is used. Follow with Skip_Line to go to the start > of the next line. I assume that is true before you read the next "char". If I then Skip_Line as you say, will I also get End_Of_Line true if the next line is empty (null)? If true, then it may be time for me to reconsider how my current lexer works. > To return to the subject: I too often use 'Image for normal output, > not just for debugging. And I find the extra blank annoying. But it is > a very small annoyance, considering what else life offers :-) I just now use: function Trim(S : String) return String is begin for X in S'Range loop if S(X) /= ' ' then return S(X..S'Last); end if; end loop; return ""; end; to trim off leading the blanks. This could be simpler, if you only use it for S'Image. ;-) Thanks for the tip, Warren