changes for new grammar, fixes

This commit is contained in:
ProgramSnail 2023-06-03 19:01:03 +03:00
parent 91f9affadc
commit 3106a64949
35 changed files with 605 additions and 550 deletions

View file

@ -1,44 +1,18 @@
namespace Employee {
decl gen_employee : Unit -> Employee
def gen_employee = {
var x = $@Complex & 11.3 & 15.87 // construct on heap
namespace \employee {
decl gen-employee : \unit -> \employee
def gen-employee = {
var x = $@complex & 11.3 & 15.87 // construct on heap
return
$Employee // construct on stack
$employee // construct on stack
& name = "John"
& role =
($Manager
($manager
& "John"
& productivity =
($Productivity::High
($productivity.high
& duration = 10.3
& sleep_on_work = ($Productivity::SleepOnWork::No))
& sleep-on-work = ($productivity.sleep-on-work.no))
& salary = 123)
}
}
/*
class Employee =
& name : String
& role :
( | Director
& importance : Float
& share : Float
| Manager
& productivity :
( Productivity
| .Low
| .Average
| .High
& duration : Float
& sleep_on_work :
(SleepOnWork
| ..Yes
| ..No
))
& salary : Int
| Programmer
& skills : Float
& current_task : Optional Task
& salary : Int)
*/