mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-17 18:33:58 +00:00
tests/debugger/list_cmd.m:
tests/debugger/list_cmd.inp:
tests/debugger/list_cmd.exp:
tests/debugger/list_cmd.exp2:
Add new test case.
tests/debugger/list_cmd.sh:
Add script to be set as the 'list_cmd'.
tests/debugger/Mmakefile:
Enable the new test.
30 lines
863 B
Bash
Executable File
30 lines
863 B
Bash
Executable File
#!/bin/sh
|
|
#---------------------------------------------------------------------------#
|
|
# vim: ts=4 sw=4 expandtab ft=sh
|
|
#---------------------------------------------------------------------------#
|
|
# Copyright (C) 2020 The Mercury team.
|
|
# This file may only be copied under the terms of the GNU General
|
|
# Public License - see the file COPYING in the Mercury distribution.
|
|
#---------------------------------------------------------------------------#
|
|
#
|
|
# list_cmd.sh <source-file> <first-line> <last-line> <mark-line>
|
|
#
|
|
|
|
SCRIPT='
|
|
NR >= first_line && NR <= last_line {
|
|
if (NR == mark_line) {
|
|
print "*" NR, $0;
|
|
} else {
|
|
print " " NR, $0;
|
|
}
|
|
}'
|
|
|
|
exec awk \
|
|
-v first_line="$2" \
|
|
-v last_line="$3" \
|
|
-v mark_line="$4" \
|
|
"${SCRIPT}" \
|
|
"$1"
|
|
|
|
#-----------------------------------------------------------------------------#
|