Skip to content

Commit

Permalink
Change output
Browse files Browse the repository at this point in the history
  • Loading branch information
heshanpadmasiri committed Oct 23, 2024
1 parent 1e62858 commit 71a8d44
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/raw-templates/raw_templates.bal
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ public function main() {
int col2 = 10;

// No static type validation for interpolation
object:RawTemplate rawTemplate = `${col1}, ${col2}, ${col3()}`;
object:RawTemplate rawTemplate = `${col1}, fixed_string1, ${col2}, ${col3()}, fixed_string3`;
io:println(rawTemplate.strings);
io:println(rawTemplate.insertions);

// validate interpolations at compile time
MyCSVRawTemplate myCSVRawTemplate = `${col1}, ${col2}, ${col3()}`;
MyCSVRawTemplate myCSVRawTemplate = `fixed_string4, ${col1}, ${col2}, fixed_string_5, ${col3()}`;
io:println(myCSVRawTemplate.strings);
io:println(myCSVRawTemplate.insertions);
}
4 changes: 2 additions & 2 deletions examples/raw-templates/raw_templates.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$ bal run
["",", ",", ",""]
["",", fixed_string1, ",", ",", fixed_string3"]
[5,10,false]
["",", ",", ",""]
["fixed_string4, ",", ",", fixed_string_5, ",""]
[5,10,false]

0 comments on commit 71a8d44

Please sign in to comment.