aya-lang / aya

Pocket sized programs
MIT License
54 stars 3 forks source link

fix #82 ( `:D` Operator with String key) #83

Closed BlazingTwist closed 1 year ago

BlazingTwist commented 1 year ago

Dev test:

aya> "value" "key" {,} :D
{,
  "value":key;
} 

aya> "value" ::sym_key {,} :D
{,
  "value":sym_key;
} 

aya> "value" ["list" ::of "keys"] {,} :D
{,
  "value":of;
  "value":keys;
  "value":list;
} 

Resolves #82

BlazingTwist commented 1 year ago

I felt that the operand order for errors was misleading. (It says that it expects the Dict as the last operand, but outputs it as the first)

aya> "value" "key" "dict" :D
Type error at (:D):
    Expected ((ASD|AJD))
    Received ("dict" "key" "value" )
   in :D .. }

The second commit changes the order, so that it matches the DocTypeStr

aya> "value" "key" "dict" :D
Type error at (:D):
    Expected ((ASD|AJD))
    Received ("value" "key" "dict" )
   in :D .. }
nick-paul commented 1 year ago

Looks great! Thanks!