| 1 | pub const omega = 3 // should be first |
| 2 | |
| 3 | pub const alpha = 5 // should be in the middle |
| 4 | |
| 5 | pub const beta = 2 // should be at the end |
| 6 | |
| 7 | // def - should be first |
| 8 | pub fn def() { |
| 9 | println(1) |
| 10 | } |
| 11 | |
| 12 | // xyz - should be in the middle |
| 13 | // a small script <script>console.log('hello');</script> |
| 14 | // bold text <b>bold</b> end |
| 15 | // underlined text <u>underline</u> end |
| 16 | // a link [main v repo](https://github.com/vlang/v) |
| 17 | pub fn xyz() { |
| 18 | println(2) |
| 19 | } |
| 20 | |
| 21 | // abc - should be last |
| 22 | pub fn abc() { |
| 23 | println(3) |
| 24 | } |
| 25 | |
| 26 | // MyXMLDocument is here just to test the different combinations of methods/output types |
| 27 | pub struct MyXMLDocument { |
| 28 | path string |
| 29 | } |
| 30 | |
| 31 | // MyXMLDocument.from_text processes the file path, and returns an error |
| 32 | pub fn MyXMLDocument.from_file(path string) !MyXMLDocument { |
| 33 | return error('TODO') |
| 34 | } |
| 35 | |
| 36 | // MyXMLDocument.from_text processes text and produces none |
| 37 | pub fn MyXMLDocument.from_text(text string) ?MyXMLDocument { |
| 38 | return none |
| 39 | } |
| 40 | |
| 41 | // MyXMLDocument.abc does something too... I just do not know what. |
| 42 | pub fn MyXMLDocument.abc(text string) ?(string, int) { |
| 43 | return 'xyz', 123 |
| 44 | } |
| 45 | |
| 46 | // instance_from_file does stuff with path |
| 47 | pub fn (x &MyXMLDocument) instance_from_file(path string) !MyXMLDocument { |
| 48 | return error('TODO') |
| 49 | } |
| 50 | |
| 51 | // instance_from_text does stuff with text |
| 52 | pub fn (x &MyXMLDocument) instance_from_text(text string) ?MyXMLDocument { |
| 53 | return none |
| 54 | } |
| 55 | |
| 56 | // instance_abc does stuff too |
| 57 | pub fn (x &MyXMLDocument) instance_abc(text string) ?(string, int) { |
| 58 | return 'xyz', 123 |
| 59 | } |
| 60 | |
| 61 | // instance_void does stuff too |
| 62 | pub fn (x &MyXMLDocument) instance_void() { |
| 63 | return 123 |
| 64 | } |
| 65 | |
| 66 | // instance_int does stuff too |
| 67 | pub fn (x &MyXMLDocument) instance_int() int { |
| 68 | return 123 |
| 69 | } |
| 70 | |
| 71 | // instance_error does stuff too |
| 72 | pub fn (x &MyXMLDocument) instance_result() ! { |
| 73 | return 123 |
| 74 | } |
| 75 | |
| 76 | // instance_option does stuff too |
| 77 | pub fn (x &MyXMLDocument) instance_option() ? { |
| 78 | return 123 |
| 79 | } |
| 80 | |