1. bug in the intinit.e file

There is a bug in the intinit.e file at line 60 when Argv = {} the slice will  
 
cause an error condition. 
 
I am running the eu.ex files in a directory other than the source directory. 
 
NOTE: I should get display of the options not a slice error. 
 
 
This other directory contains the following : 
 
global.e 
keylist.e 
symtab.e 
scanner.e 
parser.e 
emit.e 
pathopen.e 
eu.ex 
reswords.e 
error.e 
main.e 
opnames.e 
execute.e 
 
Enviroment: 
 
E:\WORKCDE4>set eudir 
EUDIR=E:\EU4 
 
E:\WORKCDE4>set euinc 
EUINC=E:\EU4\include;E:\EU4\source;E:\EU4\MTRINC 
 
   

 
This will work OK running from the source directory. 
 
 
   55:          Argv = expand_config_options(Argv) 
   56:          m:map opts = cmd_parse( get_options(), 
   57:                  { NO_VALIDATION_AFTER_FIRST_EXTRA, PAUSE_MSG, pause_msg 
   58:  trace(1) 
   59:          sequence tmp_Argv = Argv 
   60==>        Argv = Argv[1..2] & GetDefaultArgs() 
   61:          Argc = length(Argv) 
   62: 
   63:          m:map default_opts = cmd_parse( get_options(), , Argv ) 
   64:          merge_maps( opts, default_opts ) 
   65: 
   66:          Argv = tmp_Argv 
   67:          Argc = length( Argv ) 
   68: 
variable name? Argv 
Argv={{101e,58:,92\,101e,117u,524,92\,98b,105i,110n,92\,101e,117u,105i,46.,... 
 

 
This will FAIL running eu.ex from the different directory with 
 
source directory set in the path.  
 
 
 
   55:          Argv = expand_config_options(Argv) 
   56:          m:map opts = cmd_parse( get_options(), 
   57:                  { NO_VALIDATION_AFTER_FIRST_EXTRA, PAUSE_MSG, pause_msg 
   58:  trace(1) 
   59:          sequence tmp_Argv = Argv 
   60==>        Argv = Argv[1..2] & GetDefaultArgs() 
   61:          Argc = length(Argv) 
   62: 
   63:          m:map default_opts = cmd_parse( get_options(), , Argv ) 
   64:          merge_maps( opts, default_opts ) 
   65: 
   66:          Argv = tmp_Argv 
   67:          Argc = length( Argv ) 
   68: 
variable name? Argv 
Argv={} 
 

new topic     » topic index » view message » categorize

2. Re: bug in the intinit.e file

bugfinder said...

{{{ There is a bug in the intinit.e file at line 60 when Argv = {} the slice will

cause an error condition.

I am running the eu.ex files in a directory other than the source directory.

NOTE: I should get display of the options not a slice error.

This is really confusing.

  1. Where is eu.ex?
  2. Where is the rest of the source?
  3. What is your current directory in your shell?
  4. What did you try to run?

Matt

new topic     » goto parent     » topic index » view message » categorize

3. Re: bug in the intinit.e file

On Linux, but I can not reproduce these steps with eui r3414.

cp -a /home/eu/source/global.e /home/eu/source/keylist.e /home/eu/source/scanner.e /home/eu/source/parser.e /home/eu/source/emit.e /home/eu/source/pathopen.e /home/eu/source/eu.ex /home/eu/source/reswords.e /home/eu/source/error.e /home/eu/source/main.e /home/eu/source/opnames.e /home/eu/source/execute.e /tmp/y/ 
cd /tmp/y 
EUDIR=/home/eu EUINC=/home/eu/include:/home/eu/source eui eu.ex 

This gives me the help screen - or the display of the list of options.

bugfinder said...

There is a bug in the intinit.e file at line 60 when Argv = {} the slice will  
 
cause an error condition. 
 
I am running the eu.ex files in a directory other than the source directory. 
 
NOTE: I should get display of the options not a slice error. 
 
 
This other directory contains the following : 
 
global.e 
keylist.e 
symtab.e 
scanner.e 
parser.e 
emit.e 
pathopen.e 
eu.ex 
reswords.e 
error.e 
main.e 
opnames.e 
execute.e 
 
Enviroment: 
 
E:\WORKCDE4>set eudir 
EUDIR=E:\EU4 
 
E:\WORKCDE4>set euinc 
EUINC=E:\EU4\include;E:\EU4\source;E:\EU4\MTRINC 
 
   

 
This will work OK running from the source directory. 
 
 
   55:          Argv = expand_config_options(Argv) 
   56:          m:map opts = cmd_parse( get_options(), 
   57:                  { NO_VALIDATION_AFTER_FIRST_EXTRA, PAUSE_MSG, pause_msg 
   58:  trace(1) 
   59:          sequence tmp_Argv = Argv 
   60==>        Argv = Argv[1..2] & GetDefaultArgs() 
   61:          Argc = length(Argv) 
   62: 
   63:          m:map default_opts = cmd_parse( get_options(), , Argv ) 
   64:          merge_maps( opts, default_opts ) 
   65: 
   66:          Argv = tmp_Argv 
   67:          Argc = length( Argv ) 
   68: 
variable name? Argv 
Argv={{101e,58:,92\,101e,117u,524,92\,98b,105i,110n,92\,101e,117u,105i,46.,... 
 

 
This will FAIL running eu.ex from the different directory with 
 
source directory set in the path.  
 
 
 
   55:          Argv = expand_config_options(Argv) 
   56:          m:map opts = cmd_parse( get_options(), 
   57:                  { NO_VALIDATION_AFTER_FIRST_EXTRA, PAUSE_MSG, pause_msg 
   58:  trace(1) 
   59:          sequence tmp_Argv = Argv 
   60==>        Argv = Argv[1..2] & GetDefaultArgs() 
   61:          Argc = length(Argv) 
   62: 
   63:          m:map default_opts = cmd_parse( get_options(), , Argv ) 
   64:          merge_maps( opts, default_opts ) 
   65: 
   66:          Argv = tmp_Argv 
   67:          Argc = length( Argv ) 
   68: 
variable name? Argv 
Argv={} 
 

new topic     » goto parent     » topic index » view message » categorize

4. Re: bug in the intinit.e file

mattlewis said...
  1. Where is eu.ex?

The contents of the other directory e:\workcde4 is described in 
the first blue section of my first posting. It has a eu.ex file. 
 
The source is in  e:\eu4\source   directory also has eu.ex file. 
 
I am running from two different directories.  
 
Also if you look at the first blue section of my first posting you 
will see what my euinc and eudir look like.   
 

mattlewis said...
  1. Where is the rest of the source?

The source is in the e:\eu4\source directory as it normal is distributed. 

mattlewis said...
  1. What is your current directory in your shell?

e:\eu4\source when running with no error. 
 
e:\workcde4 when running causes error. 
 
look at the first blue section of the my first posting !    

mattlewis said...
  1. What did you try to run?

Just eui.exe eu.ex  

new topic     » goto parent     » topic index » view message » categorize

5. Re: bug in the intinit.e file

bugfinder said...

The contents of the other directory e:\workcde4 is described in the first blue section of my first posting. It has a eu.ex file.

The source is in e:\eu4\source directory also has eu.ex file.

I am running from two different directories.

Also if you look at the first blue section of my first posting you will see what my euinc and eudir look like.

Sorry, reading more closely, I see that it is. Originally, I copied the eu.ex source to a different directory and it ran fine. I can't see why or where the contents of Argv are disappearing. What was it before being passed to expand_config_options()?

Matt

new topic     » goto parent     » topic index » view message » categorize

6. Re: bug in the intinit.e file

 
Matt: 
 
If you add this line it will fix the problem. 
 
          Argv = expand_config_options(Argv) 
          m:map opts = cmd_parse( get_options(), 
                { NO_VALIDATION_AFTER_FIRST_EXTRA, PAUSE_MSG, pause_msg }, Arg 
 
add ==>>  if length(Argv) = 0 then Argv = getenv("eudir") end if 
 
          sequence tmp_Argv = Argv 
          Argv = Argv[1..2] & GetDefaultArgs() 
        Argc = length(Argv) 
 

new topic     » goto parent     » topic index » view message » categorize

7. Re: bug in the intinit.e file

bugfinder said...

 
Matt: 
 
If you add this line it will fix the problem. 
 
          Argv = expand_config_options(Argv) 
          m:map opts = cmd_parse( get_options(), 
                { NO_VALIDATION_AFTER_FIRST_EXTRA, PAUSE_MSG, pause_msg }, Arg 
 
add ==>>  if length(Argv) = 0 then Argv = getenv("eudir") end if 
 
          sequence tmp_Argv = Argv 
          Argv = Argv[1..2] & GetDefaultArgs() 
        Argc = length(Argv) 
 

This is wrong for a couple of different reasons:

1) EUDIR is not guaranteed to be set for 4.0 (we're moving to use of eu.cfg)

2) if EUDIR is not set, then getenv() returns -1, which could cause a crash as Argv is a sequence

3) even if EUDIR is set, Argv is meant to be a list of strings. Setting it equal to the contents of EUDIR will make Argv into a single string (or a list of characters)

4) Most importantly, the real problem seems to be in getting the list of config options. That is the reason why Argv is empty. It's not clear to any of us why that is failing for you...

new topic     » goto parent     » topic index » view message » categorize

8. Re: bug in the intinit.e file

bugfinder said...

If you add this line it will fix the problem.

          Argv = expand_config_options(Argv) 
          m:map opts = cmd_parse( get_options(), 
                { NO_VALIDATION_AFTER_FIRST_EXTRA, PAUSE_MSG, pause_msg }, Arg 
 
add ==>>  if length(Argv) = 0 then Argv = getenv("eudir") end if 
 
          sequence tmp_Argv = Argv 
          Argv = Argv[1..2] & GetDefaultArgs() 
        Argc = length(Argv) 
 

No, it really won't for several reasons. Argv is meant to hold the command line options. The interpreter has to pick out those meant for it vs the path for your program and any arguments meant for it. Somewhere along the line, it's apparently losing all of that, which shouldn't be happening.

Furthermore, eu4.0 is able to run without EUDIR or EUINC or any environment variables. I haven't set one in a long, long time. That information can be set through eu.cfg files. So, in case EUDIR isn't set, you'll get a type check error back from getenv().

We need to know why and where the contents of Argv are being erased. What version of the code are you using? Are there any local modifications?

Matt

new topic     » goto parent     » topic index » view message » categorize

9. Re: bug in the intinit.e file

mattlewis said...

We need to know why and where the contents of Argv are being erased. What version of the code are you using? Are there any local modifications?

I am using SVN 3474 with no modifications. That fix only got me the option list so it did not solve anything anyways.

I looked at the option list displayed and there is no comment about how to pass a file to run on the command line ( example: eui.exe eu.ex test.ex ) The eui.exe file and euiw.exe should give a simple example with an option to display help; not just scroll off the screen with all the options.

The options used by developers should be a separate help display from the user options display.

new topic     » goto parent     » topic index » view message » categorize

10. Re: bug in the intinit.e file

bugfinder said...

The options used by developers should be a separate help display from the user options display.

Strongly disagree. eu.ex is intended for use by developers only.

new topic     » goto parent     » topic index » view message » categorize

11. Re: bug in the intinit.e file

jimcbrown said...
bugfinder said...

The options used by developers should be a separate help display from the user options display.

Strongly disagree. eu.ex is intended for use by developers only.

Yes, but if you run eui by itself, or with -?, it should probably have something like:

Usage: eui [options] <program> [program arguments] 

Matt

new topic     » goto parent     » topic index » view message » categorize

12. Re: bug in the intinit.e file

jimcbrown said...
bugfinder said...

The options used by developers should be a separate help display from the user options display.

Strongly disagree. eu.ex is intended for use by developers only.

[/quote source doc]
This directory contains a Euphoria interpreter written in Euphoria. It was developed by Rapid Deployment Software. There are no restrictions on how you may use these files.
[/quote]

eu.ex has been available for users in any recent version 2.4 2.5 3.1 etc.

new topic     » goto parent     » topic index » view message » categorize

13. Re: bug in the intinit.e file

bugfinder said...
jimcbrown said...
bugfinder said...

The options used by developers should be a separate help display from the user options display.

Strongly disagree. eu.ex is intended for use by developers only.

[/quote source doc]
This directory contains a Euphoria interpreter written in Euphoria. It was developed by Rapid Deployment Software. There are no restrictions on how you may use these files.

eu.ex has been available for users in any recent version 2.4 2.5 3.1 etc.

[/quote]

So has, e.g., dis.ex - but not very many users use it.

Aside from that, eu.ex does not have any special options of its own. It has the same options as eui.

With the exception of the new coverage options, very few of eui's options are intended for developers only. Maybe -test and -strict. Most of what you see is intended for use by the end-user.

new topic     » goto parent     » topic index » view message » categorize

14. Re: bug in the intinit.e file

bugfinder said...

eu.ex has been available for users in any recent version 2.4 2.5 3.1 etc.

Minor correction: it appeared with 2.5 and will not run (unaltered) on 2.4

Pete

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu