mcl, docs: Use the less ambiguous form of the import

Update the style guide as well!
This commit is contained in:
James Shubin
2025-06-05 22:45:26 -04:00
parent e5ec13f592
commit 75bafa4fd3
11 changed files with 36 additions and 28 deletions

View File

@@ -1,7 +1,7 @@
-- metadata.yaml --
#files: "files/" # these are some extra files we can use (is the default)
-- main.mcl --
import "golang/strings"
import "golang/strings" as golang_strings
import "deploy"
import "second.mcl"
import "mod1/"
@@ -41,9 +41,9 @@ if $x3 != $mod1.x3 {
}
# hide the newlines from our output
test [strings.trim_space($x1),] {}
test [strings.trim_space($x2),] {}
test [strings.trim_space($x3),] {}
test [golang_strings.trim_space($x1),] {}
test [golang_strings.trim_space($x2),] {}
test [golang_strings.trim_space($x3),] {}
# debugging:
#test "f1" {
# anotherstr => $x1,

View File

@@ -1,7 +1,7 @@
-- metadata.yaml --
#files: "files/" # these are some extra files we can use (is the default)
-- main.mcl --
import "golang/strings"
import "golang/strings" as golang_strings
import "deploy"
import "second.mcl"
import "mod1/"
@@ -41,9 +41,9 @@ if $x3 != $mod1.x3 {
}
# hide the newlines from our output
test [strings.trim_space($x1),] {}
test [strings.trim_space($x2),] {}
test [strings.trim_space($x3),] {}
test [golang_strings.trim_space($x1),] {}
test [golang_strings.trim_space($x2),] {}
test [golang_strings.trim_space($x3),] {}
# debugging:
#test "f1" {
# anotherstr => $x1,

View File

@@ -1,7 +1,7 @@
-- metadata.yaml --
#files: "files/" # these are some extra files we can use (is the default)
-- main.mcl --
import "golang/strings"
import "golang/strings" as golang_strings
import "deploy"
import "second.mcl"
@@ -31,8 +31,8 @@ if $x2 != $second.x2 {
}
# hide the newlines from our output
test [strings.trim_space($x1),] {}
test [strings.trim_space($x2),] {}
test [golang_strings.trim_space($x1),] {}
test [golang_strings.trim_space($x2),] {}
-- second.mcl --
import "deploy"

View File

@@ -1,7 +1,7 @@
-- metadata.yaml --
#files: "files/" # these are some extra files we can use (is the default)
-- main.mcl --
import "golang/strings"
import "golang/strings" as golang_strings
import "deploy"
$f1 = "/files/file1"
@@ -19,7 +19,7 @@ if $x1 != deploy.readfile($f1) {
}
# hide the newlines from our output
test [strings.trim_space($x1),] {}
test [golang_strings.trim_space($x1),] {}
-- files/file1 --
This is file1 in the files/ folder.
-- OUTPUT --