Pages: 1
Author Topic: Enumerations are not working  (33,076 Views)
Offline (Unknown gender) egofree

Contributor
Joined: Jun 2013
Posts: 601
View profile
Posted on: April 30, 2014, 12:01:16 PM
I tried to declare enumerations, and so far i've only error messages. For example, if i take the example found in the wiki (c.f http://enigma-dev.org/docs/Wiki/ENIGMA:Specification):

enum {
  a,
  b,
  c,
  d = 10,
  e,
  f
}


I've the following error message :

QuotePreprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h:41:3: warning: no return statement in function returning non-void [-Wreturn-type]
   }
   ^
C:/ProgramData/ENIGMA/Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h: At global scope:
C:/ProgramData/ENIGMA/Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h:44:3: error: expected unqualified-id before 'return'
   return 0;
   ^
C:/ProgramData/ENIGMA/Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h:45:1: error: expected declaration before '}' token
}
^
In file included from SHELLmain.cpp:102:0:
C:/ProgramData/ENIGMA/Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h: In function 'variant _SCR_scr_0(variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant)':
C:/ProgramData/ENIGMA/Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h:35:5: error: new types may not be defined in a return type
     enum
     ^
C:/ProgramData/ENIGMA/Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h:35:5: note: (perhaps a semicolon is missing after the definition of '_SCR_scr_0(variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant)::<anonymous enum>')
C:/ProgramData/ENIGMA/Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h:37:36: error: invalid use of qualified-name '::varaccess_a'
       enigma::varaccess_a(int(self)), enigma::varaccess_b(int(self)), enigma::varaccess_c(int(self)), enigma::varaccess_d(int(self))= 10, enigma::varaccess_e(int(self)), enigma::varaccess_f(int(self));
                                    ^
C:/ProgramData/ENIGMA/Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h:35:5: error: new types may not be defined in a return type
     enum
     ^
C:/ProgramData/ENIGMA/Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h:35:5: note: (perhaps a semicolon is missing after the definition of '_SCR_scr_0(variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant)::<anonymous enum>')
C:/ProgramData/ENIGMA/Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h:37:68: error: invalid use of qualified-name 'enigma::varaccess_b'
       enigma::varaccess_a(int(self)), enigma::varaccess_b(int(self)), enigma::varaccess_c(int(self)), enigma::varaccess_d(int(self))= 10, enigma::varaccess_e(int(self)), enigma::varaccess_f(int(self));
                                                                    ^
C:/ProgramData/ENIGMA/Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h:35:5: error: new types may not be defined in a return type
     enum
     ^
C:/ProgramData/ENIGMA/Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h:35:5: note: (perhaps a semicolon is missing after the definition of '_SCR_scr_0(variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant)::<anonymous enum>')
C:/ProgramData/ENIGMA/Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h:37:100: error: invalid use of qualified-name 'enigma::varaccess_c'
       enigma::varaccess_a(int(self)), enigma::varaccess_b(int(self)), enigma::varaccess_c(int(self)), enigma::varaccess_d(int(self))= 10, enigma::varaccess_e(int(self)), enigma::varaccess_f(int(self));
                                                                                                    ^
C:/ProgramData/ENIGMA/Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h:35:5: error: new types may not be defined in a return type
     enum
     ^
C:/ProgramData/ENIGMA/Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h:35:5: note: (perhaps a semicolon is missing after the definition of '_SCR_scr_0(variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant, variant)::<anonymous enum>')
C:/ProgramData/ENIGMA/Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h:37:132: error: invalid use of qualified-name 'enigma::varaccess_d'
       enigma::varaccess_a(int(self)), enigma::varaccess_b(int(self)), enigma::varaccess_c(int(self)), enigma::varaccess_d(int(self))= 10, enigma::varaccess_e(int(self)), enigma::varaccess_f(int(self));
                                                                                                                                    ^
C:/ProgramData/ENIGMA/Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h:37:137: error: invalid pure specifier (only '= 0' is allowed) before ',' token
       enigma::varaccess_a(int(self)), enigma::varaccess_b(int(self)), enigma::varaccess_c(int(self)), enigma::varaccess_d(int(self))= 10, enigma::varaccess_e(int(self)), enigma::varaccess_f(int(self));
                                                                                                                                         ^
C:/ProgramData/ENIGMA/Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h:41:3: warning: no return statement in function returning non-void [-Wreturn-type]
   }
   ^
C:/ProgramData/ENIGMA/Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h: At global scope:
C:/ProgramData/ENIGMA/Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h:44:3: error: expected unqualified-id before 'return'
   return 0;
   ^
C:/ProgramData/ENIGMA/Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h:45:1: error: expected declaration before '}' token
}
^

I didn't have this problem last year. This seems to be new.
Offline (Unknown gender) egofree

Contributor
Joined: Jun 2013
Posts: 601
View profile
Reply #1 Posted on: May 06, 2014, 12:32:58 PM
Declarations of enumerations are not working in scripts or objects, but i've found that you can declare them in 'Enigma settings -> Definitions'.
Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #2 Posted on: May 07, 2014, 04:29:36 AM
Yes that was the exact issue egofree, the compiler needs some fixes.
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Reply #3 Posted on: May 17, 2014, 04:42:46 PM
Those aren't supported in the current EDL spec. They are planned for the future.

You can include them in definitions, presently, under ENIGMA settings.
Offline (Unknown gender) egofree

Contributor
Joined: Jun 2013
Posts: 601
View profile
Reply #4 Posted on: May 17, 2014, 08:59:57 PM
Quote from: Josh @ Dreamland on May 17, 2014, 04:42:46 PM
Those aren't supported in the current EDL spec. They are planned for the future.

Ok, but in this case, they should removed from the wiki ! :
http://enigma-dev.org/docs/Wiki/ENIGMA:Specification#Enumerations
Offline (Unknown gender) TheExDeus

Developer
Joined: Apr 2008
Posts: 1,860
View profile
Reply #5 Posted on: May 18, 2014, 09:28:05 AM
It's in the wiki because that IS the specification. So it's a guideline on what the planned functions are.
But maybe a small note on what is currently supported and what is not could be added to those sections.

I think this "cryptic" line was the original note: "This specification is part plan, part fact of life. "
Pages: 1