[Top][All Lists]

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

Re: [Help-source-highlight] C-sharp; number of double type highlighting

From: Lorenzo Bettini
Subject: Re: [Help-source-highlight] C-sharp; number of double type highlighting
Date: Sun, 07 May 2006 12:06:25 +0200
User-agent: Thunderbird (X11/20060501)

HEMMI, Shigeru wrote:
Dear Lorenzo Bettini,

2006/4/25, Lorenzo Bettini wote:

I encounterd a small problem for a C-sharp source,
namespace Foo
using System;
public class Foo
  public double one=1.0d;
  public double fr4=0.25d;
class testing
  public static void Main()
    Foo x =3D new Foo();
      Console.WriteLine("one,fr4=3D"", "+x.fr4);
Hilighting 1.0d and 0.25d seems a bit wrong.

mhhh... yes that should be a problem in the regular expressions for
numbers (I'll fix it); do you happen to know whether that's the same of
C/C++ numbers (I mean are 1.0d and 0.25d valid C/C++ literals)?


As you supposed, 1.0d and 0.25d are NOT valid C/C++ literals.
I checked it out in the following docs.

C# Real literals:
For definition, see " Real literals" of page 73.
For examples, see "8.2.1 Predefined types" of page 17.

C++ Floating-Point Constants:



I attach the modified language definition file and a test

thanks again

|  Lorenzo Bettini          ICQ# lbetto, 16080134     |
|  PhD in Computer Science                            |
|  Dip. Sistemi e Informatica, Univ. di Firenze       |
|  Florence - Italy        (GNU/Linux User # 158233)  |
|  Home Page        :    |
|         XKlaim language  |
| Deep Purple Cover Band |
|           |
|              |
|       |
|    |
// classic HelloWorld in C#
using System;

/// <summary> 
/// classic HelloWorld in C#
/// </summary> 
class HelloWorld
	public double one=1.0d;
  	public double fr4=0.25d;
	public ulong val1 = 34Ul;

	/// <summary> The main method </summary> 
	static void Main() 
		Console.WriteLine("Hello, World!");
# definitions for C-sharp
# by S. HEMMI, updated by L. Bettini.
preproc = "using"

number = 

include "cpp.lang"

subst keyword = "abstract|event|new|struct ",

subst type = "bool|byte|sbyte|char|decimal|double",

reply via email to

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