Skip to content

MQL compiler script fails if filename or log message contain semicolons #42

@rosasurfer

Description

@rosasurfer

@see /bin/mqlc

  • Splitting error messages fails if the message contains a ; semicolon.
  • The bug also illustrates how the same problem will occur if the file name of the script itself contains a semicolon.

Bug:

$ mqlc TMA+CG-mtf.mq4
Compiling "TMA+CG-mtf.mq4" as MQL4.0
ERROR: unexpected number of fields (6) in compiler message: "2;84;C:\z\F\Projects\mt4\mql\mql40\indicators\TMA\TMA+CG-mtf.mq4;197:33;';' - assignment expected"

Original output:

$ ORIG=1 mqlc TMA+CG-mtf.mq4
MetaQuotes Language 4 compiler version 4.00 build 224 (14 May 2009)
Copyright 2001-2009, MetaQuotes Software Corp.

2;94;C:\z\F\Projects\mt4\mql\mql40\indicators\TMA\TMA+CG-mtf.mq4;197:22;'=' - illegal assignment used
2;84;C:\z\F\Projects\mt4\mql\mql40\indicators\TMA\TMA+CG-mtf.mq4;197:33;';' - assignment expected
2;84;C:\z\F\Projects\mt4\mql\mql40\indicators\TMA\TMA+CG-mtf.mq4;197:36;'<=' - assignment expected
2;84;C:\z\F\Projects\mt4\mql\mql40\indicators\TMA\TMA+CG-mtf.mq4;197:48;';' - assignment expected
2;99;C:\z\F\Projects\mt4\mql\mql40\indicators\TMA\TMA+CG-mtf.mq4;197:53;',' - semicolon expected
2;93;C:\z\F\Projects\mt4\mql\mql40\indicators\TMA\TMA+CG-mtf.mq4;197:53;',' - unexpected token
2;99;C:\z\F\Projects\mt4\mql\mql40\indicators\TMA\TMA+CG-mtf.mq4;197:58;')' - semicolon expected
2;93;C:\z\F\Projects\mt4\mql\mql40\indicators\TMA\TMA+CG-mtf.mq4;197:58;')' - unexpected token
2;98;C:\z\F\Projects\mt4\mql\mql40\indicators\TMA\TMA+CG-mtf.mq4;209:38;'continue' - 'break' or 'continue' used within some cycle only
2;98;C:\z\F\Projects\mt4\mql\mql40\indicators\TMA\TMA+CG-mtf.mq4;224:13;'continue' - 'break' or 'continue' used within some cycle only

Errors--10
See logfile "TMA+CG-mtf.log"
10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions