pike.git / module.pmod.in

version» Context lines:

pike.git/module.pmod.in:8:   //! @seealso   //! SASS @url{http://sass-lang.com/@}      #pike __REAL_VERSION__   #require constant(Tools@module@)      //! @ignore   inherit Tools@module@;   //! @endignore    + protected typedef string(8bit) s8; +    //! Sass/SCSS compiler.   //!   //! @example   //! @code   //! Tools.Sass.Compiler compiler = Tools.Sass.Compiler();   //!   //! // Allow for HTTP imports, disallowed by default.   //! compiler->http_import = Tools.Sass.HTTP_IMPORT_ANY;   //!   //! // Minify the output and create a source map file.
pike.git/module.pmod.in:61:      // GETTER(bool, prop) ->   // public bool `prop() { return compiler->prop; }   #define GETTER(T,P) \    public T ` ## P ## () { return compiler-> ## P; }      #define GETTER_SETTER(T,P) \    GETTER(T,P) \    SETTER(T,P)    -  GETTER_SETTER(int(0..2), http_import) -  GETTER_SETTER(multiset(string(8bit)), http_import_allow_ct) -  GETTER_SETTER(bool, check_file_access) -  GETTER_SETTER(string(8bit), include_path) -  GETTER_SETTER(int(0..3), output_style) -  GETTER_SETTER(string(8bit), source_map_file) -  GETTER_SETTER(string(8bit), source_map_root) -  GETTER_SETTER(int(0..), precision) -  GETTER_SETTER(int(0..1), source_comments) -  GETTER_SETTER(int(0..1), source_map_embed) -  GETTER_SETTER(int(0..1), omit_source_map_url) +  GETTER_SETTER(int(0..2), http_import) +  GETTER_SETTER(multiset(s8), http_import_allow_ct) +  GETTER_SETTER(bool, check_file_access) +  GETTER_SETTER(s8, include_path) +  GETTER_SETTER(int(0..3), output_style) +  GETTER_SETTER(s8, source_map_file) +  GETTER_SETTER(s8, source_map_root) +  GETTER_SETTER(int(0..), precision) +  GETTER_SETTER(int(0..1), source_comments) +  GETTER_SETTER(int(0..1), source_map_embed) +  GETTER_SETTER(int(0..1), omit_source_map_url)    -  mapping(string(8bit):string(8bit)) compile_file(string(8bit) input_file) +  mapping(s8:s8) compile_file(s8 input_file)    {    return compiler->compile_file(input_file);    }    -  variant void compile_file(string(8bit) input_file, string(8bit) output_file) +  variant void compile_file(s8 input_file, s8 output_file)    {    compiler->compile_file(input_file, output_file);    }    -  mapping(string(8bit):string(8bit)) compile_string(string(8bit) source) +  mapping(s8:s8) compile_string(s8 source)    {    return compiler->compile_string(source);    }    -  void set_options(mapping(string(8bit):string(8bit)|int) opts) +  void set_options(mapping(s8:s8|int) opts)    {    compiler->set_options(opts);    }       protected void _destruct()    {    if (compiler) {    destruct(compiler);    }    }
pike.git/module.pmod.in:126:    //! @seealso    //! @[HTTP_IMPORT_NONE], @[HTTP_IMPORT_GREEDY] and    //! @[HTTP_IMPORT_ANY].    public int(0..2) http_import = HTTP_IMPORT_NONE;       //! @appears Tools.Sass.Compiler.http_import_allow_ct    //!    //! List of allowed content types if @[http_import] is set to    //! @[HTTP_IMPORT_GREEDY]. The default is to allow @tt{text/scss@} and    //! @tt{text/sass@}. -  public multiset(string(8bit)) http_import_allow_ct = +  public multiset(s8) http_import_allow_ct =    (< "text/scss", "text/sass" >);       //! @appears Tools.Sass.Compiler.check_file_access    //!    //! Should file access be tested right away when paths are set or should that    //! be left to Sass to handle? The default value is @tt{true@}.    public bool check_file_access = true;          //! @ignore    protected void create()    {    // __set_importer_callback(__resolve_import);    this::__importer_cb = __resolve_import;    }    //! @endignore          //! @ignore    //! Resolve external imports in sass/scss files. -  protected string(8bit) __resolve_import(string(8bit) path) +  protected s8 __resolve_import(s8 path, s8 abs_path, s8 prev_path)    {    Standards.URI uri;       // If it's not an URI we assume it's a local import and we let Sass handle    // it. This could of course be a, by mistake, malformed URI, but then Sass    // will eventually throw.    if (catch (uri = Standards.URI(path))) {    return UNDEFINED;    }   
pike.git/module.pmod.in:180:    String.trim_all_whites);       if (http_import == HTTP_IMPORT_GREEDY) {    if (!http_import_allow_ct[ct_parts[0]]) {    error("Returned content type from import (%s) was %q. "    "Expected %s!\n", uri, ct_parts[0],    String.implode_nicely((array)http_import_allow_ct, "or"));    }    }    -  string(8bit) data = q->data(); +  s8 data = q->data();       if (sizeof(ct_parts) > 1) {    sscanf(ct_parts[1], "%*s=%s", string charset);    // In case of charset="utf-8" or charset='utf-8', remove the "fnutts"    if (charset && charset[0] < 65) {    charset = charset[1..<1];    }    }       return data;    }    //! @endignore          // Documented in the CMOD -  void `include_path=(string(8bit) path) +  void `include_path=(s8 path)    {    if (check_file_access && stringp(path) && !Stdio.exist(path)) {    error("Include path %q does not exist!\n", path);    }       ::include_path = path;    }          // Documented in the CMOD -  string(8bit) `include_path() +  s8 `include_path()    {    return ::include_path;    }       //! @appears Tools.Sass.Compiler.compile_file    //!    //! Compile the file @[input_file] and return the result    //!    //! @param input_file    //! The SCSS file to compile    //!    //! @returns    //! A mapping with the generated CSS and source mapping file if such is    //! set to be generated    //!    //! @mapping -  //! @member string(8bit) "css" +  //! @member s8 "css"    //! The generated CSS -  //! @member string(8bit) "map" +  //! @member s8 "map"    //! The generated source mapping data    //! @endmapping -  mapping(string(8bit):string(8bit)) compile_file(string(8bit) input_file) +  mapping(s8:s8) compile_file(s8 input_file)    {    if (check_file_access && !Stdio.exist(input_file)) {    error("Input file %q does not exist or isn't accessible!\n",    input_file);    }       return ::compile_file(input_file);    }       //! @appears Tools.Sass.Compiler.compile_file    //!    //! Compile the file @[input_file] and write the result to @[output_file].    //! If a source mapping file is set to be generated either via    //! @[set_options()] or @[source_map_file] it will be written as per    //! the value set in the option.    //!    //! @param input_file    //! The SCSS file to compile    //! @param output_file    //! The name of the CSS file to save the result in. -  variant void compile_file(string(8bit) input_file, string(8bit) output_file) +  variant void compile_file(s8 input_file, s8 output_file)    {    if (check_file_access && !Stdio.exist(input_file)) {    error("Input file %q does not exist or isn't accessible!\n",    input_file);    }    -  mapping(string(8bit):string(8bit)) val = ::compile_file(input_file); +  mapping(s8:s8) val = ::compile_file(input_file);    Stdio.write_file(output_file, val->css);       if (val->map && source_map_file) {    Stdio.write_file(source_map_file, val->map);    }    }       //! @appears Tools.Sass.Compiler.set_options    //!    //! Set options to the SASS compiler.    //!    //! @param opts    //! @mapping    //! @member int "output_style"    //! Any of the @[STYLE_NESTED], @[STYLE_EXPANDED], @[STYLE_COMPACT]    //! or @[STYLE_COMPRESSED] constants. See also @[output_style].    //! -  //! @member string(8bit) "include_path" +  //! @member s8 "include_path"    //! Path to root of incude files. See also @[include_path].    //! -  //! @member string(8bit) "source_map_file" +  //! @member s8 "source_map_file"    //! File to write source map file to.    //! See also @[source_map_file].    //!    //! @member bool "source_comments"    //! Turn on/off comments in the output containing info about the source    //! file - line numbers and such. Default of @tt{false@}. See also    //! @[source_comments].    //!    //! @member bool "source_map_embed"    //! Turn on/off if a source map should be embedded in the output or not.    //! Default is @tt{false@}. See also @[source_map_embed].    //! -  //! @member string(8bit) "source_map_root" +  //! @member s8 "source_map_root"    //! Set the root path of the source files, relative to where the    //! source.map file is written.    //! See also @[source_map_root]    //!    //! @member bool "omit_source_map_url"    //! Omit the #sourceMappingURL or not.    //! See also @[omit_source_map_url]    //!    //! @member int "precision"    //! Floating point precision. See also @[precision].    //! @endmapping -  void set_options(mapping(string(8bit):string(8bit)|int) opts) +  void set_options(mapping(s8:s8|int) opts)    {    foreach (opts; string opt; string|int val) {    switch (opt)    {    case "output_style":    if (!(< STYLE_NESTED, STYLE_COMPRESSED, STYLE_COMPACT,    STYLE_EXPANDED >)[val])    {    error("Unrecognized output style value!\n");    }