package snippet:plugin@0.1.1; interface compiler { use types.{error-type, mode, lang, slient, target}; /// The lang of compiler plugin, for example `gcc`, `cl`, `clang` name: func() -> string; /// The path of current compiler, for example `gcc`, `/?/bin/clang` bin: func() -> result; /// Which language is the compiler support support: func() -> lang; resource compiler { constructor(); /// Return all generated parameters passed to the compiler args: func() -> result, error-type>; /// Return compiler mode mode: func() -> result; /// Enable compiler debug information enable-debug: func() -> result<_, error-type>; /// Enable all warnings and treat all warnings as error enable-warn-error: func() -> result<_, error-type>; /// Set the compile mode set-mode: func(mode: mode) -> result<_, error-type>; /// Set the level of compilation optimization set-opt-level: func(level: u8) -> result<_, error-type>; /// Set the language standard set-standard: func(std: string) -> result<_, error-type>; /// Add a macro definition in the generated code add-macro: func(macro: string, value: option) -> result<_, error-type>; /// Add a include search path to compiler add-include-path: func(path: string) -> result<_, error-type>; /// Add a library search path to compiler add-library-path: func(path: string) -> result<_, error-type>; /// Add a library will be linked when executable is generated add-link-library: func(library: string) -> result<_, error-type>; /// Add a option to arguments, for example `-S`, `--opt=1` add-arg: func(arg: string, long: bool) -> result<_, error-type>; /// Add a raw parameter to generated parameters add-raw-arg: func(arg: string) -> result<_, error-type>; /// Append a raw parameter to generated parameters add-raw-args: func(arg: list) -> result<_, error-type>; /// Compile the code compile-code: func(source: list, out: string, slient: slient) -> result; /// Compile the file compile-file: func(path: string, out: string, slient: slient) -> result; /// Link the objects into executable link-object: func(objs: list, out: string, slient: slient) -> result; } }