Skip to content

Commit

Permalink
Interp dynamic __toString__
Browse files Browse the repository at this point in the history
  • Loading branch information
filt3rek committed Sep 14, 2022
1 parent d5a84f7 commit ebaa618
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ftk/format/template/Interp.hx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class Interp {
} );
}

hinterp.variables.set( "__toString__", Std.string );
hinterp.variables.set( "__toString__", __toString__ );
hinterp.variables.set( "__hscriptSource__", function ( __hscriptSource__ ){
if( runtimePos ){
sourcesStack.push( currentSource );
Expand All @@ -98,6 +98,10 @@ class Interp {
}
}

public dynamic function __toString__( o : Null<Dynamic> ) : String {
return Std.string( o );
}

/*
* Main function that interprets a template
*
Expand Down

0 comments on commit ebaa618

Please sign in to comment.