forked from tweag/nickel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Final import syntax for import with explicit format (tweag#2070)
* Change import syntax and change raw -> text Change the syntax of import with explicit format specification from the temporary `import '<Format> <file>` to `import <file> as 'Format`, as decided with the Nickel team. Doing so, we also make the various input and export formats name consistent: we get rid of `raw`, and use `text` instead, which is more precise. For backward compatibility reason, we still support `raw` as an alias on the CLI. The pretty-printer is also fixed: some spaces were previously missing around import with explicit format specification. * Apply suggestions from code review Co-authored-by: jneem <[email protected]> --------- Co-authored-by: jneem <[email protected]>
- Loading branch information
Showing
13 changed files
with
70 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
# test.type = 'pass' | ||
|
||
[ | ||
(import 'Nickel "imported/file_without_extension") == 1234, | ||
(import 'Raw "imported/file_without_extension") |> std.string.is_match "^1200\\+34\\s*$", | ||
(import 'Nickel "imported/file_with_unknown_extension.tst") == 1234, | ||
(import 'Raw "imported/file_with_unknown_extension.tst") |> std.string.is_match "^34\\+1200\\s*$", | ||
(import 'Raw "imported/empty.yaml") == "", | ||
(import 'Raw "imported/two.ncl") |> std.string.is_match "^\\s*\\#", | ||
(import "imported/file_without_extension" as 'Nickel) == 1234, | ||
(import "imported/file_without_extension" as 'Text) |> std.string.is_match "^1200\\+34\\s*$", | ||
(import "imported/file_with_unknown_extension.tst" as 'Nickel) == 1234, | ||
(import "imported/file_with_unknown_extension.tst" as 'Text) |> std.string.is_match "^34\\+1200\\s*$", | ||
(import "imported/empty.yaml" as 'Text) == "", | ||
(import "imported/two.ncl" as 'Text) |> std.string.is_match "^\\s*\\#", | ||
] | ||
|> std.test.assert_all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
# [test.metadata] | ||
# error = 'ParseError' | ||
|
||
import 'Qqq "imported/empty.yaml" | ||
import "imported/empty.yaml" as 'Qqq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters