Blame src/constants.cpp

Packit bfcc33
#include "sass.hpp"
Packit bfcc33
#include "constants.hpp"
Packit bfcc33
Packit bfcc33
namespace Sass {
Packit bfcc33
  namespace Constants {
Packit bfcc33
Packit bfcc33
    extern const unsigned long MaxCallStack = 1024;
Packit bfcc33
Packit bfcc33
    // https://github.com/sass/libsass/issues/592
Packit bfcc33
    // https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity
Packit bfcc33
    // https://github.com/sass/sass/issues/1495#issuecomment-61189114
Packit bfcc33
    extern const unsigned long Specificity_Star = 0;
Packit bfcc33
    extern const unsigned long Specificity_Universal = 0;
Packit bfcc33
    extern const unsigned long Specificity_Element = 1;
Packit bfcc33
    extern const unsigned long Specificity_Base = 1000;
Packit bfcc33
    extern const unsigned long Specificity_Class = 1000;
Packit bfcc33
    extern const unsigned long Specificity_Attr = 1000;
Packit bfcc33
    extern const unsigned long Specificity_Pseudo = 1000;
Packit bfcc33
    extern const unsigned long Specificity_ID = 1000000;
Packit bfcc33
Packit bfcc33
    // sass keywords
Packit bfcc33
    extern const char at_root_kwd[]       = "@at-root";
Packit bfcc33
    extern const char import_kwd[]        = "@import";
Packit bfcc33
    extern const char mixin_kwd[]         = "@mixin";
Packit bfcc33
    extern const char function_kwd[]      = "@function";
Packit bfcc33
    extern const char return_kwd[]        = "@return";
Packit bfcc33
    extern const char include_kwd[]       = "@include";
Packit bfcc33
    extern const char content_kwd[]       = "@content";
Packit bfcc33
    extern const char extend_kwd[]        = "@extend";
Packit bfcc33
    extern const char if_kwd[]            = "@if";
Packit bfcc33
    extern const char else_kwd[]          = "@else";
Packit bfcc33
    extern const char if_after_else_kwd[] = "if";
Packit bfcc33
    extern const char for_kwd[]           = "@for";
Packit bfcc33
    extern const char from_kwd[]          = "from";
Packit bfcc33
    extern const char to_kwd[]            = "to";
Packit bfcc33
    extern const char through_kwd[]       = "through";
Packit bfcc33
    extern const char each_kwd[]          = "@each";
Packit bfcc33
    extern const char in_kwd[]            = "in";
Packit bfcc33
    extern const char while_kwd[]         = "@while";
Packit bfcc33
    extern const char warn_kwd[]          = "@warn";
Packit bfcc33
    extern const char error_kwd[]         = "@error";
Packit bfcc33
    extern const char debug_kwd[]         = "@debug";
Packit bfcc33
    extern const char default_kwd[]       = "default";
Packit bfcc33
    extern const char global_kwd[]        = "global";
Packit bfcc33
    extern const char null_kwd[]          = "null";
Packit bfcc33
    extern const char optional_kwd[]      = "optional";
Packit bfcc33
    extern const char with_kwd[]          = "with";
Packit bfcc33
    extern const char without_kwd[]       = "without";
Packit bfcc33
    extern const char all_kwd[]           = "all";
Packit bfcc33
    extern const char rule_kwd[]          = "rule";
Packit bfcc33
Packit bfcc33
    // css standard units
Packit bfcc33
    extern const char em_kwd[]   = "em";
Packit bfcc33
    extern const char ex_kwd[]   = "ex";
Packit bfcc33
    extern const char px_kwd[]   = "px";
Packit bfcc33
    extern const char cm_kwd[]   = "cm";
Packit bfcc33
    extern const char mm_kwd[]   = "mm";
Packit bfcc33
    extern const char pt_kwd[]   = "pt";
Packit bfcc33
    extern const char pc_kwd[]   = "pc";
Packit bfcc33
    extern const char deg_kwd[]  = "deg";
Packit bfcc33
    extern const char rad_kwd[]  = "rad";
Packit bfcc33
    extern const char grad_kwd[] = "grad";
Packit bfcc33
    extern const char turn_kwd[] = "turn";
Packit bfcc33
    extern const char ms_kwd[]   = "ms";
Packit bfcc33
    extern const char s_kwd[]    = "s";
Packit bfcc33
    extern const char Hz_kwd[]   = "Hz";
Packit bfcc33
    extern const char kHz_kwd[]  = "kHz";
Packit bfcc33
Packit bfcc33
    // vendor prefixes
Packit bfcc33
    extern const char vendor_opera_kwd[]    = "-o-";
Packit bfcc33
    extern const char vendor_webkit_kwd[]   = "-webkit-";
Packit bfcc33
    extern const char vendor_mozilla_kwd[]  = "-moz-";
Packit bfcc33
    extern const char vendor_ms_kwd[]       = "-ms-";
Packit bfcc33
    extern const char vendor_khtml_kwd[]    = "-khtml-";
Packit bfcc33
Packit bfcc33
    // css functions and keywords
Packit bfcc33
    extern const char charset_kwd[]      = "@charset";
Packit bfcc33
    extern const char media_kwd[]        = "@media";
Packit bfcc33
    extern const char supports_kwd[]     = "@supports";
Packit bfcc33
    extern const char keyframes_kwd[]    = "keyframes";
Packit bfcc33
    extern const char only_kwd[]         = "only";
Packit bfcc33
    extern const char rgb_kwd[]          = "rgb(";
Packit bfcc33
    extern const char url_kwd[]          = "url";
Packit bfcc33
    // extern const char url_prefix_kwd[]   = "url-prefix(";
Packit bfcc33
    extern const char important_kwd[]    = "important";
Packit bfcc33
    extern const char pseudo_not_kwd[]   = ":not(";
Packit bfcc33
    extern const char even_kwd[]         = "even";
Packit bfcc33
    extern const char odd_kwd[]          = "odd";
Packit bfcc33
    extern const char progid_kwd[]       = "progid";
Packit bfcc33
    extern const char expression_kwd[]   = "expression";
Packit bfcc33
    extern const char calc_fn_kwd[]      = "calc";
Packit bfcc33
Packit bfcc33
    extern const char almost_any_value_class[] = "\"'#!;{}";
Packit bfcc33
Packit bfcc33
    // css selector keywords
Packit bfcc33
    extern const char sel_deep_kwd[] = "/deep/";
Packit bfcc33
Packit bfcc33
    // css attribute-matching operators
Packit bfcc33
    extern const char tilde_equal[]  = "~=";
Packit bfcc33
    extern const char pipe_equal[]   = "|=";
Packit bfcc33
    extern const char caret_equal[]  = "^=";
Packit bfcc33
    extern const char dollar_equal[] = "$=";
Packit bfcc33
    extern const char star_equal[]   = "*=";
Packit bfcc33
Packit bfcc33
    // relational & logical operators and constants
Packit bfcc33
    extern const char and_kwd[]   = "and";
Packit bfcc33
    extern const char or_kwd[]    = "or";
Packit bfcc33
    extern const char not_kwd[]   = "not";
Packit bfcc33
    extern const char gt[]        = ">";
Packit bfcc33
    extern const char gte[]       = ">=";
Packit bfcc33
    extern const char lt[]        = "<";
Packit bfcc33
    extern const char lte[]       = "<=";
Packit bfcc33
    extern const char eq[]        = "==";
Packit bfcc33
    extern const char neq[]       = "!=";
Packit bfcc33
    extern const char true_kwd[]  = "true";
Packit bfcc33
    extern const char false_kwd[] = "false";
Packit bfcc33
Packit bfcc33
    // miscellaneous punctuation and delimiters
Packit bfcc33
    extern const char percent_str[]     = "%";
Packit bfcc33
    extern const char empty_str[]       = "";
Packit bfcc33
    extern const char slash_slash[]     = "//";
Packit bfcc33
    extern const char slash_star[]      = "/*";
Packit bfcc33
    extern const char star_slash[]      = "*/";
Packit bfcc33
    extern const char hash_lbrace[]     = "#{";
Packit bfcc33
    extern const char rbrace[]          = "}";
Packit bfcc33
    extern const char rparen[]          = ")";
Packit bfcc33
    extern const char sign_chars[]      = "-+";
Packit bfcc33
    extern const char op_chars[]        = "-+";
Packit bfcc33
    extern const char hyphen[]          = "-";
Packit bfcc33
    extern const char ellipsis[]        = "...";
Packit bfcc33
    // extern const char url_space_chars[] = " \t\r\n\f";
Packit bfcc33
    // type names
Packit bfcc33
    extern const char numeric_name[]    = "numeric value";
Packit bfcc33
    extern const char number_name[]     = "number";
Packit bfcc33
    extern const char percentage_name[] = "percentage";
Packit bfcc33
    extern const char dimension_name[]  = "numeric dimension";
Packit bfcc33
    extern const char string_name[]     = "string";
Packit bfcc33
    extern const char bool_name[]       = "bool";
Packit bfcc33
    extern const char color_name[]      = "color";
Packit bfcc33
    extern const char list_name[]       = "list";
Packit bfcc33
    extern const char map_name[]        = "map";
Packit bfcc33
    extern const char arglist_name[]    = "arglist";
Packit bfcc33
Packit bfcc33
    // constants for uri parsing (RFC 3986 Appendix A.)
Packit bfcc33
    extern const char uri_chars[]  = ":;/?!%&#@|[]{}'`^\"*+-.,_=~";
Packit bfcc33
    extern const char real_uri_chars[]  = "#%&";
Packit bfcc33
Packit bfcc33
    // some specific constant character classes
Packit bfcc33
    // they must be static to be useable by lexer
Packit bfcc33
    extern const char static_ops[]      = "*/%";
Packit bfcc33
    // some character classes for the parser
Packit bfcc33
    extern const char selector_list_delims[] = "){};!";
Packit bfcc33
    extern const char complex_selector_delims[] = ",){};!";
Packit bfcc33
    extern const char selector_combinator_ops[] = "+~>";
Packit bfcc33
    // optional modifiers for alternative compare context
Packit bfcc33
    extern const char attribute_compare_modifiers[] = "~|^$*";
Packit bfcc33
    extern const char selector_lookahead_ops[] = "*&%,()[]";
Packit bfcc33
Packit bfcc33
    // byte order marks
Packit bfcc33
    // (taken from http://en.wikipedia.org/wiki/Byte_order_mark)
Packit bfcc33
    extern const unsigned char utf_8_bom[]      = { 0xEF, 0xBB, 0xBF };
Packit bfcc33
    extern const unsigned char utf_16_bom_be[]  = { 0xFE, 0xFF };
Packit bfcc33
    extern const unsigned char utf_16_bom_le[]  = { 0xFF, 0xFE };
Packit bfcc33
    extern const unsigned char utf_32_bom_be[]  = { 0x00, 0x00, 0xFE, 0xFF };
Packit bfcc33
    extern const unsigned char utf_32_bom_le[]  = { 0xFF, 0xFE, 0x00, 0x00 };
Packit bfcc33
    extern const unsigned char utf_7_bom_1[]    = { 0x2B, 0x2F, 0x76, 0x38 };
Packit bfcc33
    extern const unsigned char utf_7_bom_2[]    = { 0x2B, 0x2F, 0x76, 0x39 };
Packit bfcc33
    extern const unsigned char utf_7_bom_3[]    = { 0x2B, 0x2F, 0x76, 0x2B };
Packit bfcc33
    extern const unsigned char utf_7_bom_4[]    = { 0x2B, 0x2F, 0x76, 0x2F };
Packit bfcc33
    extern const unsigned char utf_7_bom_5[]    = { 0x2B, 0x2F, 0x76, 0x38, 0x2D };
Packit bfcc33
    extern const unsigned char utf_1_bom[]      = { 0xF7, 0x64, 0x4C };
Packit bfcc33
    extern const unsigned char utf_ebcdic_bom[] = { 0xDD, 0x73, 0x66, 0x73 };
Packit bfcc33
    extern const unsigned char scsu_bom[]       = { 0x0E, 0xFE, 0xFF };
Packit bfcc33
    extern const unsigned char bocu_1_bom[]     = { 0xFB, 0xEE, 0x28 };
Packit bfcc33
    extern const unsigned char gb_18030_bom[]   = { 0x84, 0x31, 0x95, 0x33 };
Packit bfcc33
Packit bfcc33
  }
Packit bfcc33
}