Small bug in parser

 

Hello,

One small bug in the parser:

 

void OnStart()
{ 
    some sval;  
    sval.val=2; 
 
    Alert(sval.val); 
} 
  
struct some {  
    ushort val;
}  // <<< semicolon absent   

 

The above example will compile just fine.. It happens in general when the semicolon is absent on the last variable in the page..

What's more, if we write as follows

void OnStart()
{ 
    
} 
  
enum ENUM_SOME { 
        SOME_VAL 
}

 the compilation will fail, but the message of "semicolon expected" will point to line 1 

The version of the terminal is beta 5488

greets

MQL Parsing by Means of MQL
MQL Parsing by Means of MQL
  • 2019.03.27
  • www.mql5.com
The article describes a preprocessor, a scanner, and a parser to be used in parsing the MQL-based source codes. MQL implementation is attached.