Skip to content

uchijo/orelang_dart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Orelang implementation using dart

about

implemented orelang with dart language.

c.f. https://qiita.com/Uchijo/items/4fd9849ac223b80d7615

usage

dart run 'some program here'

example

$ dart run bin/orelang_dart.dart '["+", 40, 2]'
result: 42

value types

  • integer
  • bool
  • novalue
    • something like null or nil in other language.

supported features

  • >, <, ==, +, *, and, or
    • [op, expression1, expression2]
    • operators.
  • while
    • ["while", condition, expression]
    • evaluates expression while condition is true.
    • returns result of evaluation on last expression.
      • novalue is not counted as "last expression".
      • if there's no valid expression evaluation in while loop, it will return novalue.
  • set
    • ["set", "identifier", expression]
    • variable named identifier will be initialized with value expression. overwrite is allowed.
    • returns evaluated value of expression
  • get
    • ["get", "identifier"]
    • retrieves value of variable with the identifier.
  • step
    • ["step", expression, ...]
    • evaluates all given expressions.
    • returns result of evaluation on last expression.
      • novalue is not counted as "last expression".
      • if there's no valid expression evaluation in steps, it will return novalue.
  • if
    • ["if", cond, on_true, on_false]
  • skip
    • ["skip"]
    • doees nothing.
    • returns novalue.

About

implemented orelang using dart.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages