@@ -38,28 +38,28 @@ export type CompiledFunctions = {
3838export interface CompileTarget {
3939/** Get operator representation for the target language */
4040operators ?:( op :MathJsonSymbol ) => [ op :string , prec :number ] | undefined ;
41-
41+
4242/** Get function implementation for the target language */
4343functions ?:( id :MathJsonSymbol ) => CompiledFunction | undefined ;
44-
44+
4545/** Get variable representation for the target language */
4646var :( id :MathJsonSymbol ) => string | undefined ;
47-
47+
4848/** Format string literals for the target language */
4949string :( str :string ) => string ;
50-
50+
5151/** Format numeric literals for the target language */
5252number :( n :number ) => string ;
53-
53+
5454/** Format whitespace for the target language */
5555ws :( s ?:string ) => string ;
56-
56+
5757/** Code to be inserted at the beginning of the compiled output */
5858preamble :string ;
59-
59+
6060/** Current indentation level */
6161indent :number ;
62-
62+
6363/** Target language identifier (for debugging/logging) */
6464language ?:string ;
6565}
@@ -70,13 +70,13 @@ export interface CompileTarget {
7070export interface LanguageTarget {
7171/** Get the default operators for this language */
7272getOperators ( ) :CompiledOperators ;
73-
73+
7474/** Get the default functions for this language */
7575getFunctions ( ) :CompiledFunctions ;
76-
76+
7777/** Create a CompileTarget for this language */
7878createTarget ( options ?:Partial < CompileTarget > ) :CompileTarget ;
79-
79+
8080/** Compile an expression to executable code in this language */
8181compileToExecutable (
8282expr :BoxedExpression ,
@@ -90,13 +90,13 @@ export interface LanguageTarget {
9090export interface CompilationOptions {
9191/** Custom function implementations */
9292functions ?:Record < MathJsonSymbol , TargetSource | Function > ;
93-
93+
9494/** Variable bindings */
9595vars ?:Record < MathJsonSymbol , TargetSource > ;
96-
96+
9797/** Additional imports/libraries to include */
9898imports ?:unknown [ ] ;
99-
99+
100100/** Additional preamble code */
101101preamble ?:string ;
102102}
@@ -107,10 +107,10 @@ export interface CompilationOptions {
107107export interface CompiledExecutable {
108108/** Execute the compiled code */
109109( ...args :any [ ] ) :any ;
110-
110+
111111/** Get the source code */
112112toString ( ) :string ;
113-
113+
114114/** Flag indicating this is a compiled expression */
115115isCompiled :true ;
116- }
116+ }