-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #476 from nevalang/enums
feat(parser): add syntax for enum const literals
- Loading branch information
Showing
33 changed files
with
2,082 additions
and
1,693 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
interface IPrinter<T>(data T) (sig T) | ||
|
||
component { | ||
Main(start any) (stop any) { | ||
nodes { | ||
subNode SecondComponent { | ||
depNode Printer<any> | ||
} | ||
} | ||
net { | ||
:start -> subNode:msg | ||
subNode:msg -> :stop | ||
} | ||
} | ||
|
||
SecondComponent (msg any) (msg any) { | ||
nodes { depNode IPrinter<any> } | ||
net { | ||
:msg -> depNode:data | ||
depNode:sig -> :msg | ||
} | ||
} | ||
} |
4 changes: 1 addition & 3 deletions
4
examples/3_interfaces/main.neva → examples/3_interfaces/with_imports/main.neva
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,4 +1,3 @@ | ||
// FIXME def conns | ||
component Main(start any) (stop any) { | ||
nodes { | ||
adder Adder<int> | ||
|
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
component Main(start any) (stop any) { | ||
nodes { DayPrinter } | ||
net { | ||
:start -> (Day::Monday -> dayPrinter:day) | ||
dayPrinter:sig -> :stop | ||
} | ||
} | ||
|
||
type Day enum { | ||
Monday, | ||
Tuesday, | ||
Wednesday, | ||
Thursday, | ||
Friday, | ||
Saturday, | ||
Sunday | ||
} | ||
|
||
component DayPrinter(day Day) (sig any) { | ||
nodes { Printer<Day> } | ||
net { | ||
:day -> printer:data | ||
printer:sig -> :sig | ||
} | ||
} |
Oops, something went wrong.