more error information handling touch-up in parse.c

This commit is contained in:
2020-01-03 14:16:24 +00:00
parent ec5e61278c
commit dae8b5428d
5 changed files with 60 additions and 46 deletions

View File

@ -128,3 +128,28 @@ $ ~/xxx/bin/hawk 'function test(ax, bx) { @local ARGC; }'
ERROR: CODE 65 LINE 1 COLUMN 32 - duplicate local variable name - ARGC
$ ~/xxx/bin/hawk '@global 10; '
HAWK_EBADVAR -> ERROR: CODE 67 LINE 1 COLUMN 9 - '10' not a valid variable name
$ ~/xxx/bin/hawk '{ @local 10; }'
HAWK_EBADVAR -> ERROR: CODE 67 LINE 1 COLUMN 10 - '10' not a valid variable name
$ ~/xxx/bin/hawk 'function test(10) {} '
HAWK_EBADPAR -> ERROR: CODE 66 LINE 1 COLUMN 15 - '10' not a valid parameter name
$ ~/xxx/bin/hawk 'BEGIN { print B"abc^Bdef"; }'
HAWK_EMBSCHR -> ERROR: CODE 37 LINE 1 COLUMN 15 - invalid mbs character ''
$ ~/xxx/bin/hawk "BEGIN { print B'abf^Bdef'; }"
HAWK_EMBSCHR -> ERROR: CODE 37 LINE 1 COLUMN 16 - invalid mbs character ''
$ ~/xxx/bin/hawk --implicit=off 'BEGIN { print kcx[10]; }'
HAWK_EUNDEF -> ERROR: CODE 69 LINE 1 COLUMN 16 - undefined identifier 'kcx'
$ ~/xxx/bin/hawk --implicit=off 'BEGIN { print ax; }'
ERROR: CODE 69 LINE 1 COLUMN 16 - undefined identifier 'ax'
$ ~/xxx/bin/hawk 'function 1.2(a) {}'
ERROR: CODE 54 LINE 1 COLUMN 10 - '1.2' not a valid function name