Pages: 1
  Print  
Author Topic: Enumerations are not working  (Read 1132 times)
Offline (Unknown gender) egofree
Posted on: April 30, 2014, 07:01:16 AM
Contributor
Joined: Jun 2013
Posts: 603

View Profile Email
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):

Code: [Select]
enum {
  a,
  b,
  c,
  d = 10,
  e,
  f
}

I've the following error message :

Quote
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
 }
 ^
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.
Logged
Offline (Unknown gender) egofree
Reply #1 Posted on: May 06, 2014, 07:32:58 AM
Contributor
Joined: Jun 2013
Posts: 603

View Profile Email
Declarations of enumerations are not working in scripts or objects, but i've found that you can declare them in 'Enigma settings -> Definitions'.
Logged
Offline (Male) Goombert
Reply #2 Posted on: May 06, 2014, 11:29:36 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3107

View Profile
Yes that was the exact issue egofree, the compiler needs some fixes.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Male) Josh @ Dreamland
Reply #3 Posted on: May 17, 2014, 11:42:46 AM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2950

View Profile Email
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.
« Last Edit: May 17, 2014, 11:46:02 AM by Josh @ Dreamland » Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Unknown gender) egofree
Reply #4 Posted on: May 17, 2014, 03:59:57 PM
Contributor
Joined: Jun 2013
Posts: 603

View Profile Email
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
Logged
Offline (Unknown gender) TheExDeus
Reply #5 Posted on: May 18, 2014, 04:28:05 AM

Developer
Joined: Apr 2008
Posts: 1872

View Profile
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. "
« Last Edit: May 18, 2014, 04:29:52 AM by TheExDeus » Logged
Pages: 1
  Print