diff options
author | Adrian Thurston <thurston@colm.net> | 2019-12-28 12:46:04 +0200 |
---|---|---|
committer | Adrian Thurston <thurston@colm.net> | 2019-12-28 12:50:43 +0200 |
commit | f2bbad18a77fc52ba64d6bf4a14338fec8061d1f (patch) | |
tree | e278b7bb6e01c84c2a271bc28419b9a69a8ea8fa /test | |
parent | ef54b3ad76f7b10142e26ad6c2eb5e19f6534588 (diff) | |
download | colm-f2bbad18a77fc52ba64d6bf4a14338fec8061d1f.tar.gz |
ragel julia: upgrades tests to 1.0 of julia language
The string class is no longer containing uints, now signed. Convert the input
strings to vectors of uint8s, since the julia code generator currently supports
only uint8.
Use numerical representation of 'a' since we have no way to separate single
lits from double lits and cast them in the julia test case translator
Don't try to construct AbstractString, use String.
Array constructor Array{Int, 1}(undef, 20) must take undef as first arg.
Verify we have julia 1.0 or later in configure script.
refs #91
Diffstat (limited to 'test')
-rw-r--r-- | test/ragel.d/gotocallret1.rl | 2 | ||||
-rw-r--r-- | test/ragel.d/julia1.rl | 3 | ||||
-rw-r--r-- | test/ragel.d/trans-julia.lm | 11 |
3 files changed, 9 insertions, 7 deletions
diff --git a/test/ragel.d/gotocallret1.rl b/test/ragel.d/gotocallret1.rl index 869349b6..92ebb983 100644 --- a/test/ragel.d/gotocallret1.rl +++ b/test/ragel.d/gotocallret1.rl @@ -44,7 +44,7 @@ int stack[32]; # Choose which to machine to call into based on the command. action comm_arg { - if ( comm >= 'a' ) { + if ( comm >= 97 ) { fcall alp_comm; } else { fcall dig_comm; diff --git a/test/ragel.d/julia1.rl b/test/ragel.d/julia1.rl index df11994f..4b349908 100644 --- a/test/ragel.d/julia1.rl +++ b/test/ragel.d/julia1.rl @@ -10,7 +10,8 @@ %% write data; -function test( data::AbstractString ) +function test( data_string::AbstractString ) + data = Vector{UInt8}( data_string ) p = 0 pe = length(data) eof = length(data) diff --git a/test/ragel.d/trans-julia.lm b/test/ragel.d/trans-julia.lm index d67635bf..cf153c64 100644 --- a/test/ragel.d/trans-julia.lm +++ b/test/ragel.d/trans-julia.lm @@ -175,7 +175,7 @@ int print_stmt( Stmt: indep::print_stmt ) case [`print_token `;] { send Out - "print( data\[(ts+1) : (te)\] ); + "print( String( data\[(ts+1) : (te)\] ) ); } case [`print_off `;] { @@ -193,7 +193,7 @@ void buf_stmt( BufStmt: indep::buf_stmt ) } case [`buf_append `( `) `;] { send Out - " buffer = buffer * AbstractString(Char\[fc\]); + " buffer = buffer * String(Char\[fc\]); } } @@ -284,7 +284,8 @@ void julia( Output: stream ) " "%% write data; " - "function m( data::AbstractString ) + "function m( data_string::AbstractString ) + " data = Vector{UInt8}( data_string ) " p = 0 " pe = length(data) " eof = length(data) @@ -292,8 +293,8 @@ void julia( Output: stream ) " buffer = \"\" " nfa_len = 0 " nfa_count = 0 - " nfa_bp_state = Array{Int, 1}(20) - " nfa_bp_p = Array{Int, 1}(20) + " nfa_bp_state = Array{Int, 1}(undef, 20) + " nfa_bp_p = Array{Int, 1}(undef, 20) Init: indep::stmt* = RagelTree.Init for Stmt: indep::stmt in Init { |