Files
hawk/t/e-001.err
hyung-hwan a351f7910f
continuous-integration/drone/push Build is passing
implemented deferred module constant symbols
2026-03-04 22:16:02 +08:00

190 lines
2.5 KiB
Plaintext

BEGIN {
##ERROR: unexpected end of input
---
function abc(x { ##ERROR: comma expected in place of '{'
}
---
function abc (x, ...,) { ##ERROR: right parenthesis expected in place of ','
}
---
function abc (x, ..., a) { ##ERROR: right parenthesis expected in place of ','
}
---
function abc (... ...) { ##ERROR: right parenthesis expected in place of '...'
}
---
BEGIN {
@argv = 10 ##ERROR: invalid assignment statement
}
---
BEGIN {
@argc = 10 ##ERROR: invalid assignment statement
}
---
BEGIN {
@nil = 10 ##ERROR: invalid assignment statement
}
---
BEGIN {
@{};
@{ "hello", "world } ##ERROR: colon expected in place of ','
}
---
BEGIN {
hawk::call("sys::SIGTERM", 10 20); ##ERROR: 'sys::SIGTERM' not a function or unsupported
}
---
BEGIN {
printf(@b"hello %s %c\n", "world"); ##ERROR: insufficient arguments to formatting sequence
}
---
BEGIN {
printf("hello %s %c %d\n", "world", 'h'); ##ERROR: insufficient arguments to formatting sequence
}
---
BEGIN {
print @rbc"X";
print @rbcd; ##ERROR: '@rbcd' not recognized
}
---
BEGIN {
print @bc'π'; ##ERROR: invalid byte character 'π'
}
---
@const X = 20
BEGIN {
@local Y = 20
Y = 99
X = 40 ##ERROR: cannot assign to constant 'X'
}
---
@const X = 20
BEGIN {
@const Y = 20
Y = 99 ##ERROR: cannot assign to constant 'Y'
X = 40
}
---
@pragma implicit off
@const X = 20
BEGIN {
@const Y = 20, Z ##ERROR: assignment expression expected in place of '<NL>'
Y = 99
X = 40
}
---
@pragma implicit off
@pragma pedantic on
BEGIN {
@local x = @[1,2,3]
print x[1,2] ##ERROR: single-bracketed multidimensional indices not allowed for array
}
---
@pragma implicit off
@pragma pedantic on
BEGIN {
@local x = @[ ##ERROR: unexpected newline after '@['
1, 2, 3]
}
---
@pragma implicit off
@pragma pedantic on
@global A = 30
@global B
@global X ##ERROR: unused global variable 'X'
BEGIN {
B = 30
}
---
@pragma implicit off
@pragma pedantic on
BEGIN {
@local a, b ##ERROR: unused local variable 'b'
{
@local b
b = 20
a = 20
}
}
---
@global x = 20
function x(a, b) { ##ERROR: global variable 'x' redefined
return a + b
}
---
function x(a, b) {
@local x, y = 20; ##ERROR: function 'x' redefined
{
@local y = 40;
}
}
---
@pragma defermodsym on
BEGIN {
nosuchmod::nosuchfnc(); ##ERROR: unable to resolve 'nosuchmod::nosuchfnc' at runtime
}
---
@pragma defermodsym on
BEGIN {
print nosuchmod::nosuchconst; ##ERROR: unable to resolve 'nosuchmod::nosuchconst' at runtime
}