Skip to content

Commit

Permalink
add true literal
Browse files Browse the repository at this point in the history
  • Loading branch information
rkh committed Sep 11, 2011
1 parent 8c1d2e1 commit c7f8318
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/reak/compiler/ast/TrueLiteral.st
@@ -0,0 +1,12 @@
Rubinius.AST.TrueLiteral subclass: 'TrueLiteral' in: Reak.AST [
Reak.AST.Primary unshift: self.
self include: Reak.AST.Node.

(self class) >> grammar: g [
^ g str: 'true'
].

(self class) >> for: line with: aString [
^ self new: line
].
]
1 change: 1 addition & 0 deletions lib/reak/kernel/Alpha.st
Expand Up @@ -21,3 +21,4 @@ Reak on: (Reak.CodeLoader class) as: 'run:' expose: 'run'.

Reak run: 'compiler/KPeg'.
Reak run: 'compiler/ast/Self'.
Reak run: 'compiler/ast/TrueLiteral'.
3 changes: 3 additions & 0 deletions test/bootstrap/ast/TrueLiteralTest.st
@@ -0,0 +1,3 @@
MiniTest.Unit.TestCase subclass: 'ASTTrueLiteralTest' [
self test: 'is truthy' [ self assert: true ].
]

0 comments on commit c7f8318

Please sign in to comment.