help-source-highlight
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-source-highlight] Re: "<" and "->" operator precedence ignorance.


From: Lorenzo Bettini
Subject: [Help-source-highlight] Re: "<" and "->" operator precedence ignorance.
Date: Tue, 07 Dec 2004 12:52:04 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040929

Subject:
Parsing error: "<" and "->" operator precedence ignorance.
From:
"Maxim Dementiev" <address@hidden>
Date:
Tue, 7 Dec 2004 12:56:57 +0300
To:
<address@hidden>

Hi!

Assume a little following program:

int main( int , char ** )
{
  int a = 1;
  struct B { int b; };
  B b = { 2 };
  B * const p = &b;
  return a<p->b ? a : 3;
}

Last line is legal and must be interpreted as

  return a < (p->b) ? a : 3;

and here parentheses do nothing (in comparison with original line)
because of operators precedence.

But in source-highlight's (GNU source-highlight 1.11, Win32 version)
output we will see (with "-fhtml -cmono.css" options):

  ... <span class="normal">a</span><span
class="string">&lt;p-&gt;</span><span class="normal">b</span> ...

i.e. "<p->" is interpreted as string!!!

You're perfectly right!

I'll correct this problem in the next release of source-highlight.

thanks!

P.S. the right list to post such a message is this one (and you must be subscribed), not info-source-highlight :-)

--
+-----------------------------------------------------+
|  Lorenzo Bettini          ICQ# lbetto, 16080134     |
|  PhD in Computer Science                            |
|  Dip. Sistemi e Informatica, Univ. di Firenze       |
|  Tel +39 055 4796741, Fax +39 055 4796730           |
|  Florence - Italy        (GNU/Linux User # 158233)  |
|  Home Page        : http://www.lorenzobettini.it    |
|  http://music.dsi.unifi.it         XKlaim language  |
|  http://www.lorenzobettini.it/purple    Cover Band  |
|  http://www.gnu.org/software/src-highlite           |
|  http://www.gnu.org/software/gengetopt              |
|  http://www.lorenzobettini.it/software/gengen       |
|  http://www.lorenzobettini.it/software/doublecpp    |
+-----------------------------------------------------+





reply via email to

[Prev in Thread] Current Thread [Next in Thread]