File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/env ruby
2+ ENV [ "INTERSCRIPT_STAGING" ] = "1"
3+ require "bundler/setup"
4+ require "interscript"
5+ require "interscript/compiler/ruby"
6+
7+ # This script has been written because there are some differences between platforms
8+ # (ie. windows vs linux) that we wish to find out more about
9+
10+ if ARGV [ 0 ] == '-b'
11+ require 'base64'
12+ $b64 = [ ]
13+ ARGV . shift
14+ end
15+
16+ map = ARGV [ 0 ]
17+ m = Interscript . parse ( map )
18+ cr = Interscript ::Compiler ::Ruby
19+ mr = cr . ( map , debug : true )
20+
21+ m . tests . data . each_with_index do |( from , expected ) , idx |
22+ r = mr . ( from )
23+
24+ unless ARGV [ 1 ] && ARGV [ 1 ] . to_i == idx
25+ if r == expected
26+ cr . reset_debug_data
27+ next
28+ end
29+ end
30+
31+ dr = cr . read_debug_data
32+
33+ if $b64
34+ $b64 << [ idx , dr ]
35+ else
36+ pp [ idx , dr ]
37+ end
38+
39+ cr . reset_debug_data
40+ end
41+
42+ if $b64
43+ puts Base64 . encode64 ( $b64. inspect )
44+ end
You can’t perform that action at this time.
0 commit comments