Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

camlidl and union-decl #2814

Closed
vicuna opened this issue Jun 27, 2001 · 3 comments
Closed

camlidl and union-decl #2814

vicuna opened this issue Jun 27, 2001 · 3 comments

Comments

@vicuna
Copy link

vicuna commented Jun 27, 2001

Original bug ID: 410
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: -for CamlIDL use https://github.com/xavierleroy/camlidl/issues

Bug description

Full_Name: Dmitry Bely
Version: 3.01, camlidl cvs 27.06.01
OS: Windows NT 4.0
Submission from: d009.p3.col.ru (195.210.132.9)

The second form of union-decl (according to p. 2.5 of camlidl manual) does not
work:

[union.idl]
typedef union switch(int ctx)
{
case 1: int intVal;
case 2: char charVal;
} UNION;
[end of union.idl]

D:\Work\camlidl-test>camlidl union.idl
union.idl
File union.idl, line 3, character 6: syntax error

@vicuna
Copy link
Author

vicuna commented Jun 29, 2001

Comment author: administrator

The second form of union-decl (according to p. 2.5 of camlidl
manual) does not work:

[union.idl]
typedef union switch(int ctx)
{
case 1: int intVal;
case 2: char charVal;
} UNION;

As shown in the manual, each "case" label must syntactically be an
identifier, e.g.

typedef union switch(int ctx)
{
case FIRSTCASE: int intVal;
case SECONDCASE: char charVal;
} UNION;

Otherwise, the IDL->Caml mapping cannot guess the Caml constructor
names for each case of the union type.

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Jun 29, 2001

Comment author: administrator

Behavior conforms to spec.

@vicuna
Copy link
Author

vicuna commented Jun 29, 2001

Comment author: administrator

Xavier Leroy Xavier.Leroy@inria.fr writes:

The second form of union-decl (according to p. 2.5 of camlidl
manual) does not work:

[union.idl]
typedef union switch(int ctx)
{
case 1: int intVal;
case 2: char charVal;
} UNION;

As shown in the manual, each "case" label must syntactically be an
identifier, e.g.

typedef union switch(int ctx)
{
case FIRSTCASE: int intVal;
case SECONDCASE: char charVal;
} UNION;

Otherwise, the IDL->Caml mapping cannot guess the Caml constructor
names for each case of the union type.

You are right, sorry. I've tried to find out why the following construct
from wtypes.idl generates syntax error (you know, camlidl in fact does not
point to the correct place of error):

typedef union _userCLIPFORMAT switch(long fContext) u
{
case WDT_INPROC_CALL: DWORD dwValue;
case WDT_REMOTE_CALL: [string] wchar_t * pwszName;
} userCLIPFORMAT;

and have simplified it in the wrong place. The real problem was that "u"
after switch (don't know what it means for MIDL). Sorry once again.

Hope to hear from you soon,
Dmitry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant