Skip to content

Commit

Permalink
[readme] minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
0exp committed Jun 23, 2019
1 parent 2967095 commit e1e2049
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Jaina.fetch_expression("KEK")
### Full example

```ruby
# step 1: register new operand
# step 1: create new operand
class AddNumber < Jaina::TerminalExpr
token 'ADD'

Expand All @@ -160,7 +160,7 @@ class AddNumber < Jaina::TerminalExpr
end
end

# step 2: register another new operand
# step 2: create another new operand
class CheckNumber < Jaina::TerminalExpr
token 'CHECK'

Expand All @@ -169,6 +169,7 @@ class CheckNumber < Jaina::TerminalExpr
end
end

# step 4: and another new :)
class InitState < Jaina::TerminalExpr
token 'INIT'

Expand All @@ -177,12 +178,12 @@ class InitState < Jaina::TerminalExpr
end
end

# step 3: register new oeprands
# step 5: register new oeprands
Jaina.register_expression(AddNumber)
Jaina.register_expression(CheckNumber)
Jaina.register_expression(InitState)

# step 4: run your program
# step 6: run your program

# NOTE: with initial context
Jaina.evaluate('CHECK AND ADD', current_value: -1) # => false
Expand Down

0 comments on commit e1e2049

Please sign in to comment.