Re: [sv-bc] Adjacent string literals

From: Coffin, Eric <eric_coffin_at_.....>
Date: Tue Nov 20 2007 - 14:50:13 PST

Gord was quick to point out that I forgot the actual argument S in the $display().  The statement containing the $display should read:

$display("The date is November " "20th, %s", S);

-Eric

Coffin, Eric wrote:
During some internal discussions about macros, Gord, Randy and I have noticed that it would be nice to have strings literals next to each other be treated lexically as a single string literal. We were unable to think of any problems that this would create with the existing 1800 grammar.

For example:

module implicit_paste;
    string S = "20" "07";  // Implicitly token paste the two strings into a single string "2007"
    initial begin
       $display("The date is November " "20th, %s");  // Again, perform implicit gluing.
    end
endmodule

This would give the output:

The date is November 20th, 2007

-Eric


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean. Received on Tue Nov 20 14:50:33 2007

This archive was generated by hypermail 2.1.8 : Tue Nov 20 2007 - 14:50:41 PST