Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
$: << File.expand_path(File.dirname(__FILE__)+"/../..") | ||
|
||
require 'transform' | ||
|
||
# The rest is shared with the parser steps | ||
|
||
When(/^I preprocess it with the compiler transformations$/) do | ||
Compiler.new.preprocess(@tree) | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
Feature: Transformations | ||
In order to implement the correct semantics, the compiler post-processes | ||
the output from the Parser to modify the AST. | ||
|
||
Scenario Outline: Simple expressions | ||
Given the expression <expr> | ||
When I parse it with the full parser | ||
And I preprocess it with the compiler transformations | ||
Then the parse tree should become <tree> | ||
|
||
Examples: | ||
| expr | tree | notes | | ||
| "1 + 2" | [:do,[:add, [:sexp,[:call, :__get_fixnum, 1]], [:sexp,[:call, :__get_fixnum, 2]]]] | | | ||
|
||
|