1#! This test case is derived from #1810, a pull request submitted by @p-vitt 2#! and parser-java.r/enum.java.d/input.java 3#! Callable needs only string argument 4#:def debug_code(code) 5 #:if DEBUG > 0 6 $:code 7 #:endif 8#:enddef debug_code 9public enum e { 10 A, // should be 'e', not 'f' 11 B(), // should be 'e', not 'm' 12 C(1), // should be 'e', not missing 13 14#! Pass code block as first positional argument 15#:call debug_code 16 if (size(array) > 100) then 17 print *, "DEBUG: spuriously large array"x 18 end if 19#:endcall debug_code 20 D, // should be 'e', not 'f' 21 E(), // should be 'e', not 'm' 22 F(1), // should be 'e', not missing 23 ; 24#! Callable needs also non-string argument types 25#:def repeat_code(code, repeat) 26 #:for ind in range(repeat) 27 $:code 28 #:endfor 29#:enddef repeat_code 30 31 e(int x) {} 32 e() {} 33 34 public String string; 35 public final Shape shape; 36 public final boolean twoKeywordsInARow; 37 38#! fypp preprocessor comments here, and 39 public String getString() { 40 return string; 41 } 42 43#! there 44 public final Shape getShape() { 45 return shape; 46 } 47#! Pass code block as positional argument and 3 as keyword argument "repeat" 48#:call repeat_code(repeat=3) 49this will be repeated 3 times 50#:endcall repeat_code 51} 52