Building C++ modules

Jacob Carlborg doob at me.com
Wed Aug 14 10:40:00 UTC 2019


On 2019-08-13 17:21, H. S. Teoh wrote:
> On Tue, Aug 13, 2019 at 11:19:16AM +0200, Jacob Carlborg via Digitalmars-d wrote:
>> DMD is doing something similar, but at a later stage. For example, in
>> the following code snippet: "int a = foo;", "foo" is parsed as an
>> identifier expression. Then the semantic analyzer figures out if "foo"
>> is a function call or a variable.
> [...]
> 
> There's no such thing as an 'identifier expression'. `foo` is parsed as
> an expression, period.

I'm not sure if you're still talking about DMD here, but there's 
definitely an "identifier expression", it's right here [1]. It's created 
in the parser here [2]. Then during the semantic phase it's turned into 
something else.

[1] 
https://github.com/dlang/dmd/blob/b2522da8566783491648bc104a29b42dc2dc569e/src/dmd/expression.d#L2056

[2] 
https://github.com/dlang/dmd/blob/b2522da8566783491648bc104a29b42dc2dc569e/src/dmd/parse.d#L7633

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list