-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Be less restrictive when writing function calls
- Loading branch information
Showing
6 changed files
with
62 additions
and
1 deletion.
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
28 changes: 28 additions & 0 deletions
28
tests/Visp.Compiler.UnitTests/snapshots/tests_macros_up-macro-0.can parse.verified.txt
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,28 @@ | ||
// This file is auto-generated | ||
|
||
#nowarn "0020" // unused results from functions | ||
|
||
open Visp.Runtime.Library | ||
|
||
let state = { Todo = () } | ||
// line 8 @"up-macro-0.visp" | ||
let DoingThings () = | ||
// line 9 @"up-macro-0.visp" | ||
let mutable items = | ||
// line 9 @"up-macro-0.visp" | ||
[] |> Set.ofList | ||
// line 11 @"up-macro-0.visp" | ||
for i = 0 to 5 do | ||
// line 12 @"up-macro-0.visp" | ||
|
||
// line 12 @"up-macro-0.visp" | ||
items <- Set.add i items | ||
items | ||
|
||
// line 17 @"up-macro-0.visp" | ||
let visp_result_todo = | ||
// line 17 @"up-macro-0.visp" | ||
printfn "%A" (DoingThings ()) | ||
// line 17 @"up-macro-0.visp" | ||
printfn "%A" visp_result_todo | ||
|
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
4 changes: 4 additions & 0 deletions
4
tests/Visp.ExecutionTests/snapshots/tests_macros_up-macro-0.can execute.verified.txt
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,4 @@ | ||
set [0; 1; 2; 3; 4; 5] | ||
() | ||
|
||
ExitCode: 0 |
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,17 @@ | ||
;; Copyright 2023 Ville Penttinen | ||
;; Distributed under the MIT License. | ||
;; https://github.com/vipentti/visp-fs/blob/main/LICENSE.md | ||
;; | ||
;; for basic syntax highlighting | ||
;; vim: set syntax=clojure: | ||
|
||
(fn DoingThings () | ||
(mut items (!set)) | ||
|
||
(for/to [i (0 to 5)] | ||
(up! items (Set.add i))) | ||
|
||
items) | ||
|
||
|
||
(printfn "%A" (DoingThings)) |