polserver/testsuite/escript/func/func1b.src
Kevin Eady 3ccf701ce9
Format testsuite scripts, pol-core support modules (#713)
* Format escript testsuite

* Manual formatting for escript testsuite
- Add format-off to places where formatter does what it should, but we don't like the results
- Manually change places where formatter outputs weird things _without_ format-off, so next format-all would show changes if not fixed

* Update .err files; add update_err.py helper script

Use the format `:line:col: message` for all .err file checks. This
allows us to change the file names without needing to edit the .err
contents.

Note that `in/inc0{1,2}.err` need have error messages between POSIX and
Windows, so their messages are a bit more "generic" than the other errs.

* Format pol testsuite

* Manual formatting for pol testsuite

* Format pol-core modules

* Manual formatting for pol-core modules

* Additional format pol-core modules

Use FormatterLineWidth=10000 since module functions must be on one line
because of the parse_modules target

* Address Discord comments

- Support multi-line module function declarations in parse_modules

* Format on df07831
2024-10-04 10:29:55 +02:00

70 lines
1.2 KiB
Text

// declare function foo2();
// declare function foo3(a, b, c);
// declare function foo5(a , g);
var a := "ll"; // MID( "hello world", 3, 2 );
function foo1()
print( "foo1" );
endfunction
function foo2( a )
print( "foo2: a=" + a );
endfunction
function foo3( a := 5 )
print( "foo3: a=" + a );
endfunction
function foo4( a, b := "hello" )
print( "foo4: a=" + a );
print( "foo4: b=" + b );
endfunction
function foo5( a := 1, b := 2 )
print( "foo5: a=" + a );
print( "foo5: b=" + b );
endfunction
function foo6( a := 2, b )
print( "foo6: a=" + a );
print( "foo6: b=" + b );
endfunction
function foo7( a := 2, b, c := 7 )
print( "foo7: a=" + a );
print( "foo7: b=" + b );
print( "foo7: c=" + c );
endfunction
// Program Start
var b, c;
print( "Program Starting - Function Test (Func1.src)" );
a := 5;
b := 7 + 8;
foo5( 6, 2 );
c := foo5( 7, 1 );
foo1();
foo2( "hello" );
foo3();
foo3( "hello foo3" );
foo3( 5.4 );
foo3( a := 6 );
foo3( a := "hey" );
foo4( a := 3, b := 6 );
foo5( 17, 32 );
foo5( 12 );
foo5();
foo5( a := 2 );
foo5( a := 8, b := 4 );
foo5( b := 3 );
foo5( b := 9, a := 3 );
// Any of these lines should break the compile.
// foo1( 3 );
// foo1( "hello" );
// foo1( a := 4 );
// foo7( b := "blah blah" , 3, 2);