-
-
Notifications
You must be signed in to change notification settings - Fork 735
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ac37b27
commit e5c2212
Showing
5 changed files
with
83 additions
and
0 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
18 changes: 18 additions & 0 deletions
18
compiler-core/src/parse/snapshots/gleam_core__parse__tests__if_like_expression.snap
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
source: compiler-core/src/parse/tests.rs | ||
expression: "\npub fn main() {\n let a = if wibble {\n wobble\n }\n}\n" | ||
--- | ||
error: Syntax error | ||
┌─ /src/parse/error.gleam:3:11 | ||
│ | ||
3 │ let a = if wibble { | ||
│ ^^ Gleam doesn't have if expressions | ||
|
||
If you want to write a conditional expression you can use a `case`: | ||
|
||
case condition { | ||
True -> todo | ||
False -> todo | ||
} | ||
|
||
See: https://tour.gleam.run/flow-control/case-expressions/ |
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