-
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.
Fix attribute argument parsing and support -|| operator as replacemen…
…t for ||
- Loading branch information
Showing
12 changed files
with
1,795 additions
and
1,606 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
1,567 changes: 795 additions & 772 deletions
1,567
src/Visp.Compiler/Syntax/FsLexYaccOutput/Lexer.fs
Large diffs are not rendered by default.
Oops, something went wrong.
1,669 changes: 841 additions & 828 deletions
1,669
src/Visp.Compiler/Syntax/FsLexYaccOutput/Parser.fs
Large diffs are not rendered by default.
Oops, something went wrong.
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
38 changes: 38 additions & 0 deletions
38
tests/Visp.Compiler.UnitTests/snapshots/tests_parsing_operators-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,38 @@ | ||
// This file is auto-generated | ||
|
||
#nowarn "0020" // unused results from functions | ||
|
||
open Visp.Runtime.Library | ||
|
||
let state = { Todo = () } | ||
// line 8 @"operators-0.visp" | ||
let OrTest a b = | ||
// line 8 @"operators-0.visp" | ||
a || b | ||
|
||
// line 9 @"operators-0.visp" | ||
let AndTest a b = | ||
// line 9 @"operators-0.visp" | ||
a && b | ||
|
||
// line 11 @"operators-0.visp" | ||
printfn "OrTest %A" (OrTest false false) | ||
// line 12 @"operators-0.visp" | ||
printfn "OrTest %A" (OrTest false true) | ||
// line 13 @"operators-0.visp" | ||
printfn "OrTest %A" (OrTest true false) | ||
// line 14 @"operators-0.visp" | ||
printfn "OrTest %A" (OrTest true true) | ||
// line 16 @"operators-0.visp" | ||
printfn "AndTest %A" (AndTest false false) | ||
// line 17 @"operators-0.visp" | ||
printfn "AndTest %A" (AndTest false true) | ||
// line 18 @"operators-0.visp" | ||
printfn "AndTest %A" (AndTest true false) | ||
// line 19 @"operators-0.visp" | ||
let visp_result_todo = | ||
// line 19 @"operators-0.visp" | ||
printfn "AndTest %A" (AndTest true true) | ||
// line 19 @"operators-0.visp" | ||
printfn "%A" visp_result_todo | ||
|
35 changes: 35 additions & 0 deletions
35
tests/Visp.Compiler.UnitTests/snapshots/tests_type_record-4.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,35 @@ | ||
// This file is auto-generated | ||
|
||
#nowarn "0020" // unused results from functions | ||
|
||
open Visp.Runtime.Library | ||
|
||
let state = { Todo = () } | ||
[<StructuredFormatDisplay"{Structuredtext}">] | ||
// line 8 @"record-4.visp" | ||
type TestRec = | ||
{ value: int } | ||
// line 12 @"record-4.visp" | ||
member t.Structuredtext = | ||
// line 12 @"record-4.visp" | ||
t.ToString() | ||
// line 14 @"record-4.visp" | ||
override t.ToString () = | ||
// line 14 @"record-4.visp" | ||
sprintf "TestRec(%i)" ((t.value)) | ||
|
||
// line 19 @"record-4.visp" | ||
printfn "%A" ({ | ||
// line 19 @"record-4.visp" | ||
value = 99 | ||
}) | ||
// line 20 @"record-4.visp" | ||
let visp_result_todo = | ||
// line 20 @"record-4.visp" | ||
printfn "%A" ({ | ||
// line 20 @"record-4.visp" | ||
value = 1 | ||
}) | ||
// line 20 @"record-4.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
11 changes: 11 additions & 0 deletions
11
tests/Visp.ExecutionTests/snapshots/tests_parsing_operators-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,11 @@ | ||
OrTest false | ||
OrTest true | ||
OrTest true | ||
OrTest true | ||
AndTest false | ||
AndTest false | ||
AndTest false | ||
AndTest true | ||
() | ||
|
||
ExitCode: 0 |
5 changes: 5 additions & 0 deletions
5
tests/Visp.ExecutionTests/snapshots/tests_type_record-4.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,5 @@ | ||
TestRec(99) | ||
TestRec(1) | ||
() | ||
|
||
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,19 @@ | ||
;; 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 OrTest (a b) (-|| a b)) | ||
(fn AndTest (a b) (&& a b)) | ||
|
||
(printfn "OrTest %A" (OrTest false false)) | ||
(printfn "OrTest %A" (OrTest false true)) | ||
(printfn "OrTest %A" (OrTest true false)) | ||
(printfn "OrTest %A" (OrTest true true)) | ||
|
||
(printfn "AndTest %A" (AndTest false false)) | ||
(printfn "AndTest %A" (AndTest false true)) | ||
(printfn "AndTest %A" (AndTest true false)) | ||
(printfn "AndTest %A" (AndTest true true)) |
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,20 @@ | ||
;; 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: | ||
|
||
(#[StructuredFormatDisplay("{Structuredtext}")] | ||
record TestRec | ||
[value: int] | ||
|
||
(member t.Structuredtext (.ToString t)) | ||
|
||
(override fn t.ToString() (sprintf "TestRec(%i)" (+value t))) | ||
) | ||
|
||
|
||
|
||
(printfn "%A" {| [value 99] |}) | ||
(printfn "%A" {| [value 1] |}) |