• source navigation  • diff markup  • identifier search  • freetext search  • 

Sources/ucode/tests/custom/04_modules/01_export_variable_declaration

  1 Variable declarations can be prepended with `export` to automatically
  2 export each variable using the same name as the variable itself.
  3 
  4 Updates to the variable after the export are reflected properly in
  5 the including scope.
  6 
  7 -- File test-var-decl.uc --
  8 export let a, b, c;
  9 export let d = 4, e = 5, f = 6;
 10 export const g = 7, h = 8, i = 9;
 11 
 12 a = 1;
 13 b = 2;
 14 c = 3;
 15 -- End --
 16 
 17 -- Testcase --
 18 import { a, b, c, d, e, f, g, h, i } from "./files/test-var-decl.uc";
 19 
 20 print([ a, b, c, d, e, f, g, h, i ], "\n");
 21 -- End --
 22 
 23 -- Args --
 24 -R
 25 -- End --
 26 
 27 -- Expect stdout --
 28 [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
 29 -- End --

This page was automatically generated by LXR 0.3.1.  •  OpenWrt