mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2025-12-27 01:08:44 +00:00
changes for new grammar, fixes
This commit is contained in:
parent
91f9affadc
commit
3106a64949
35 changed files with 605 additions and 550 deletions
|
|
@ -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)
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue