Skip to content

Commit 4d922da

Browse files
committed
Merge branch 'development' into master
2 parents 9ee9242 + 0d48c9c commit 4d922da

File tree

4 files changed

+330
-253
lines changed

4 files changed

+330
-253
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ updates:
44
- package-ecosystem: github-actions
55
directory: /
66
schedule:
7-
interval: weekly
7+
interval: monthly
88
open-pull-requests-limit: 1

bin/mqlc

Lines changed: 50 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
#
3-
# A script for compiling MQL4.0, MQL4.5 and MQL5 source files. Supports batch-processing of multiple files and directories.
3+
# A script for compiling MQL4.0, MQL4.5 and MQL5 source files. Supports batch-processing of multiple files and directories.
44
# Prints results to STDOUT and follows standard rules for the exit status. The syntax is backward compatible to MetaEditor.
55
#
66
# Configuration via environment and/or config file.
@@ -34,6 +34,8 @@
3434
#
3535
set -eEuo pipefail
3636

37+
NL=$'\n'
38+
3739

3840
# --- functions ----------------------------------------------------------------------------------------------------------------------------
3941

@@ -50,8 +52,8 @@ Usage: mqlc [options] [--] SOURCES...
5052
5153
Arguments:
5254
SOURCES One or more MQL files or source directories to compile. Supports wildcards.
53-
54-
Options:
55+
56+
Options:
5557
-h, --help This screen.
5658
/compile:FILE Source file to compile. Doesn't support wildcards.
5759
/compile:DIR Source directory to compile. Recompiles new and modified sources (not in subdirectories).
@@ -355,38 +357,6 @@ function compileMql40() {
355357
}
356358

357359

358-
#
359-
# Format a log message produced by the MQL4.0 compiler.
360-
#
361-
# @param _InOut_ $1 - named reference to the log message
362-
# @param _In_ $2 - source file of the compilation
363-
# @param _In_ $3 - number of errors during the compilation
364-
# @param _In_ $4 - number of warnings during the compilation
365-
#
366-
function formatCompiler40Msg() {
367-
((BASH_SUBSHELL)) && fail "${FUNCNAME[0]}() can't write to outer scope from subshell"
368-
local -n msg="$1"
369-
local srcFile="$2" errors="$3" warnings="$4" cols type level levelS file location='' descr len
370-
371-
readarray -t cols < <(printf '%s\n' "${msg//;/$'\n'}")
372-
((${#cols[@]} != 5)) && fail "unexpected number of fields (${#cols[@]}) in compiler message: \"$msg\""
373-
374-
type="${cols[0]}"
375-
[[ "$type" == [12] ]] || fail "unexpected message type ($type) in compiler message: \"$msg\""
376-
((type == 1)) && level='warn' || level='error'
377-
((errors)) && len=6 || len=5
378-
levelS="$level: "
379-
levelS="${levelS:0:$len}"
380-
381-
file="${cols[2]}"
382-
[[ -n "${cols[3]}" ]] && location=" (${cols[3]})"
383-
descr="${cols[4]}"
384-
385-
msg="${levelS} ${file}${location}: ${descr}"
386-
#msg="${file}${location}: ${level}: ${descr}"
387-
}
388-
389-
390360
#
391361
# Compile an MQL4.5 or MQL5 source file.
392362
#
@@ -466,39 +436,72 @@ function compileMql5() {
466436

467437

468438
#
469-
# Format a log message produced by the MQL4.5 or MQL5 compiler.
439+
# Reformat a single log message produced by the MQL4.0 compiler.
470440
#
471441
# @param _InOut_ $1 - named reference to the log message
472442
# @param _In_ $2 - source file of the compilation
473443
# @param _In_ $3 - number of errors during the compilation
474444
# @param _In_ $4 - number of warnings during the compilation
475445
#
476-
function formatCompiler5Msg() {
446+
function formatCompiler40Msg() {
477447
((BASH_SUBSHELL)) && fail "${FUNCNAME[0]}() can't write to outer scope from subshell"
478-
local -n msg="$1"
479-
[[ -z "$msg" ]] && { unset "$1"; return; }
480-
local srcFile="$2" errors="$3" warnings="$4" cols level levelS file location='' descr len
448+
local -n logmsg="$1"
449+
local srcFile="$2" errors="$3" warnings="$4" type code level levelS file location message len
481450

482-
[[ "$msg" =~ ^(.*):\ (info|warn|error)[^:]*:\ (.+)$ ]] || fail "unexpected format of compiler message: \"$msg\""
451+
[[ "$logmsg" =~ ^([0-9]+)\;([0-9]+)\;(.+)\;([0-9]+:[0-9]+)?\;(.*)$ ]] || fail "unexpected format of compiler message:$NL\"$logmsg\""
452+
type="${BASH_REMATCH[1]}"
453+
code="${BASH_REMATCH[2]}"
454+
file="${BASH_REMATCH[3]}"
455+
location="${BASH_REMATCH[4]}"
456+
message="${BASH_REMATCH[5]}"
483457

484-
descr="${BASH_REMATCH[3]}"
485-
486-
level="${BASH_REMATCH[2]}"
458+
[[ "$type" == [12] ]] || fail "unexpected message type $type in compiler message:$NL\"$logmsg\""
459+
((type == 1)) && level='warn' || level='error'
487460
((errors)) && len=6 || len=5
488461
levelS="$level: "
489462
levelS="${levelS:0:$len}"
490463

464+
[[ -n "$location" ]] && location=" ($location)"
465+
466+
logmsg="${levelS} ${file}${location}: ${message}"
467+
#logmsg="${file}${location}: ${level}: ${message}"
468+
}
469+
470+
471+
#
472+
# Reformat a single log message produced by the MQL4.5 or MQL5 compiler.
473+
#
474+
# @param _InOut_ $1 - named reference to the log message
475+
# @param _In_ $2 - source file of the compilation
476+
# @param _In_ $3 - number of errors during the compilation
477+
# @param _In_ $4 - number of warnings during the compilation
478+
#
479+
function formatCompiler5Msg() {
480+
((BASH_SUBSHELL)) && fail "${FUNCNAME[0]}() can't write to outer scope from subshell"
481+
local -n logmsg="$1"
482+
[[ -z "$logmsg" ]] && { unset "$1"; return; }
483+
local srcFile="$2" errors="$3" warnings="$4" level levelS file location='' message len
484+
485+
[[ "$logmsg" =~ ^(.*):\ (info|warn|error)[^:]*:\ (.+)$ ]] || fail "unexpected format of compiler message:$NL\"$logmsg\""
486+
491487
file="${BASH_REMATCH[1]}"
492488
file="${file%"${file##*[![:space:]]}"}" # trim trailing white space
493489
if [[ "$file" =~ \([0-9,]+\)$ ]]; then
494490
file="${file%"${BASH_REMATCH[0]}"}"
495491
location=" ${BASH_REMATCH[0]}"
496492
fi
497493

494+
level="${BASH_REMATCH[2]}"
495+
((errors)) && len=6 || len=5
496+
levelS="$level: "
497+
levelS="${levelS:0:$len}"
498+
499+
message="${BASH_REMATCH[3]}"
500+
498501
if [[ -z "$file" ]]; then
499-
msg="$levelS $descr"
502+
logmsg="$levelS $message"
500503
else
501-
msg="$levelS ${file}${location}: $descr"
504+
logmsg="$levelS ${file}${location}: $message"
502505
fi
503506
}
504507

@@ -1230,7 +1233,7 @@ metaeditor64.exe
12301233
12311234
UltraEdit
12321235
---------
1233-
If a tool returns errors to the output window, UltraEdit and UEStudio will open the referenced file at the specified line on double-click.
1236+
If a tool returns errors to the output window, UltraEdit and UEStudio will open the referenced file at the specified line on double-click.
12341237
For this to work the error message must in the following format "FULL PATH(Line Number,Column Number): Error Message" i.e.:
12351238
12361239
C:\Development Path\ProjectDev\EditWindow.c(341): some error message

mql40/include/rsf/indicators/chartinfos/init.mqh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ int onInit() {
88
mm.done = false;
99
mm.externalAssetsCached = false; // invalidate cached external assets
1010
positions.analyzed = false; // reparse configuration
11+
ArrayResize(config.terms, 0); //
1112
ArrayResize(config.sData, 0); //
1213
ArrayResize(config.dData, 0); //
13-
ArrayResize(configTerms, 0); //
1414
ArrayResize(positions.data, 0); //
1515
ArrayResize(trackedOrders, 0);
1616

0 commit comments

Comments
 (0)