mirror of
https://github.com/danog/sass-site.git
synced 2025-01-09 14:38:39 +01:00
838 lines
46 KiB
HTML
838 lines
46 KiB
HTML
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
|
<title>
|
||
|
Module: Sass::SCSS::RX
|
||
|
|
||
|
— Documentation by YARD 0.9.12
|
||
|
|
||
|
</title>
|
||
|
|
||
|
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||
|
|
||
|
<link rel="stylesheet" href="../../../assets/css/docs.css" type="text/css" charset="utf-8" />
|
||
|
|
||
|
<script type="text/javascript" charset="utf-8">
|
||
|
hasFrames = window.top.frames.main ? true : false;
|
||
|
relpath = '../../';
|
||
|
framesUrl = "../../frames.html#!Sass/SCSS/RX.html";
|
||
|
</script>
|
||
|
|
||
|
|
||
|
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||
|
|
||
|
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||
|
|
||
|
|
||
|
</head>
|
||
|
<body>
|
||
|
<div id="header">
|
||
|
<div id="menu">
|
||
|
|
||
|
<a href="../../_index.html">Index (R)</a> »
|
||
|
<span class='title'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span> » <span class='title'><span class='object_link'><a href="../SCSS.html" title="Sass::SCSS (module)">SCSS</a></span></span>
|
||
|
»
|
||
|
<span class="title">RX</span>
|
||
|
|
||
|
|
||
|
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||
|
</div>
|
||
|
|
||
|
<div id="search">
|
||
|
|
||
|
<a class="full_list_link" id="class_list_link"
|
||
|
href="../../class_list.html">
|
||
|
Class List
|
||
|
</a>
|
||
|
|
||
|
<a class="full_list_link" id="method_list_link"
|
||
|
href="../../method_list.html">
|
||
|
Method List
|
||
|
</a>
|
||
|
|
||
|
<a class="full_list_link" id="file_list_link"
|
||
|
href="../../file_list.html">
|
||
|
File List
|
||
|
</a>
|
||
|
|
||
|
</div>
|
||
|
<div class="clear"></div>
|
||
|
</div>
|
||
|
|
||
|
<iframe id="search_frame"></iframe>
|
||
|
|
||
|
<div id="content"><h1>Module: Sass::SCSS::RX
|
||
|
|
||
|
|
||
|
|
||
|
</h1>
|
||
|
|
||
|
<dl class="box">
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dt class="r1">Included in:</dt>
|
||
|
<dd class="r1"><span class='object_link'><a href="Parser.html" title="Sass::SCSS::Parser (class)">Parser</a></span>, <span class='object_link'><a href="../Script/Lexer.html" title="Sass::Script::Lexer (class)">Sass::Script::Lexer</a></span></dd>
|
||
|
|
||
|
|
||
|
|
||
|
<dt class="r2 last">Defined in:</dt>
|
||
|
<dd class="r2 last">.ruby-sass/lib/sass/scss/rx.rb</dd>
|
||
|
|
||
|
</dl>
|
||
|
<div class="clear"></div>
|
||
|
|
||
|
<h2>Overview</h2><div class="docstring">
|
||
|
<div class="discussion">
|
||
|
|
||
|
<p>A module containing regular expressions used for lexing tokens in an SCSS
|
||
|
document. Most of these are taken from [the CSS3 spec](<a
|
||
|
href="http://www.w3.org/TR/css3-syntax/#lexical">www.w3.org/TR/css3-syntax/#lexical</a>),
|
||
|
although some have been modified for various reasons.</p>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="tags">
|
||
|
|
||
|
|
||
|
</div>
|
||
|
<h2>Constant Summary</h2>
|
||
|
|
||
|
<dl class="constants">
|
||
|
|
||
|
<dt id="H-constant" class="">H =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>[0-9a-fA-F]</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="NL-constant" class="">NL =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\n|\r\n|\r|\f</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="UNICODE-constant" class="">UNICODE =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\\</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#H-constant" title="Sass::SCSS::RX::H (constant)">H</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>{1,6}[ \t\r\n\f]?</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="NONASCII-constant" class="">NONASCII =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>[</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_s'>s</span><span class='embexpr_end'>}</span><span class='tstring_content'>]</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="ESCAPE-constant" class="">ESCAPE =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#UNICODE-constant" title="Sass::SCSS::RX::UNICODE (constant)">UNICODE</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>|\\[ -~</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_s'>s</span><span class='embexpr_end'>}</span><span class='tstring_content'>]</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="NMSTART-constant" class="">NMSTART =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>[_a-zA-Z]|</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#NONASCII-constant" title="Sass::SCSS::RX::NONASCII (constant)">NONASCII</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>|</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#ESCAPE-constant" title="Sass::SCSS::RX::ESCAPE (constant)">ESCAPE</a></span></span><span class='embexpr_end'>}</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="NMCHAR-constant" class="">NMCHAR =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>[a-zA-Z0-9_-]|</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#NONASCII-constant" title="Sass::SCSS::RX::NONASCII (constant)">NONASCII</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>|</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#ESCAPE-constant" title="Sass::SCSS::RX::ESCAPE (constant)">ESCAPE</a></span></span><span class='embexpr_end'>}</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="STRING1-constant" class="">STRING1 =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\"((?:[^\n\r\f\\"]|\\</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#NL-constant" title="Sass::SCSS::RX::NL (constant)">NL</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>|</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#ESCAPE-constant" title="Sass::SCSS::RX::ESCAPE (constant)">ESCAPE</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>)*)\"</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="STRING2-constant" class="">STRING2 =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\'((?:[^\n\r\f\\']|\\</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#NL-constant" title="Sass::SCSS::RX::NL (constant)">NL</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>|</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#ESCAPE-constant" title="Sass::SCSS::RX::ESCAPE (constant)">ESCAPE</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>)*)\'</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="IDENT-constant" class="">IDENT =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>-*</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#NMSTART-constant" title="Sass::SCSS::RX::NMSTART (constant)">NMSTART</a></span></span><span class='embexpr_end'>}</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#NMCHAR-constant" title="Sass::SCSS::RX::NMCHAR (constant)">NMCHAR</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>*</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="NAME-constant" class="">NAME =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#NMCHAR-constant" title="Sass::SCSS::RX::NMCHAR (constant)">NMCHAR</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>+</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="STRING-constant" class="">STRING =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#STRING1-constant" title="Sass::SCSS::RX::STRING1 (constant)">STRING1</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>|</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#STRING2-constant" title="Sass::SCSS::RX::STRING2 (constant)">STRING2</a></span></span><span class='embexpr_end'>}</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="URLCHAR-constant" class="">URLCHAR =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>[#%&*-~]|</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#NONASCII-constant" title="Sass::SCSS::RX::NONASCII (constant)">NONASCII</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>|</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#ESCAPE-constant" title="Sass::SCSS::RX::ESCAPE (constant)">ESCAPE</a></span></span><span class='embexpr_end'>}</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="URL-constant" class="">URL =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#URLCHAR-constant" title="Sass::SCSS::RX::URLCHAR (constant)">URLCHAR</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>*)</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="W-constant" class="">W =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>[ \t\r\n\f]*</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="VARIABLE-constant" class="">VARIABLE =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>(\$)(</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../SCSS.html" title="Sass::SCSS (module)">SCSS</a></span></span><span class='op'>::</span><span class='const'>RX</span><span class='op'>::</span><span class='const'><span class='object_link'><a href="#IDENT-constant" title="Sass::SCSS::RX::IDENT (constant)">IDENT</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>)</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="RANGE-constant" class="">RANGE =
|
||
|
<div class="docstring">
|
||
|
<div class="discussion">
|
||
|
|
||
|
<p>This is more liberal than the spec's definition, but that definition
|
||
|
didn't work well with the greediness rules</p>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="tags">
|
||
|
|
||
|
|
||
|
</div>
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>(?:</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#H-constant" title="Sass::SCSS::RX::H (constant)">H</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>|\?){1,6}</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="S-constant" class="">S =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>[ \t\r\n\f]+</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="COMMENT-constant" class="">COMMENT =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>%r{</span><span class='tstring_content'>/\*([^*]|\*+[^/*])*\**\*/</span><span class='regexp_end'>}</span></span></pre></dd>
|
||
|
|
||
|
<dt id="SINGLE_LINE_COMMENT-constant" class="">SINGLE_LINE_COMMENT =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>%r{</span><span class='tstring_content'>//.*(\n[ \t]*//.*)*</span><span class='regexp_end'>}</span></span></pre></dd>
|
||
|
|
||
|
<dt id="CDO-constant" class="">CDO =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='id identifier rubyid_quote'>quote</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'><!--</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span></pre></dd>
|
||
|
|
||
|
<dt id="CDC-constant" class="">CDC =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='id identifier rubyid_quote'>quote</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>--></span><span class='tstring_end'>"</span></span><span class='rparen'>)</span></pre></dd>
|
||
|
|
||
|
<dt id="INCLUDES-constant" class="">INCLUDES =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='id identifier rubyid_quote'>quote</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>~=</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span></pre></dd>
|
||
|
|
||
|
<dt id="DASHMATCH-constant" class="">DASHMATCH =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='id identifier rubyid_quote'>quote</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>|=</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span></pre></dd>
|
||
|
|
||
|
<dt id="PREFIXMATCH-constant" class="">PREFIXMATCH =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='id identifier rubyid_quote'>quote</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>^=</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span></pre></dd>
|
||
|
|
||
|
<dt id="SUFFIXMATCH-constant" class="">SUFFIXMATCH =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='id identifier rubyid_quote'>quote</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>$=</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span></pre></dd>
|
||
|
|
||
|
<dt id="SUBSTRINGMATCH-constant" class="">SUBSTRINGMATCH =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='id identifier rubyid_quote'>quote</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>*=</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span></pre></dd>
|
||
|
|
||
|
<dt id="HASH-constant" class="">HASH =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>#</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#NAME-constant" title="Sass::SCSS::RX::NAME (constant)">NAME</a></span></span><span class='embexpr_end'>}</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="IMPORTANT-constant" class="">IMPORTANT =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>!</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#W-constant" title="Sass::SCSS::RX::W (constant)">W</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>important</span><span class='regexp_end'>/i</span></span></pre></dd>
|
||
|
|
||
|
<dt id="UNIT-constant" class="">UNIT =
|
||
|
<div class="docstring">
|
||
|
<div class="discussion">
|
||
|
|
||
|
<p>A unit is like an IDENT, but disallows a hyphen followed by a digit. This
|
||
|
allows “1px-2px” to be interpreted as subtraction rather than “1” with the
|
||
|
unit “px-2px”. It also allows “%”.</p>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="tags">
|
||
|
|
||
|
|
||
|
</div>
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>-?</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#NMSTART-constant" title="Sass::SCSS::RX::NMSTART (constant)">NMSTART</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>(?:[a-zA-Z0-9_]|</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#NONASCII-constant" title="Sass::SCSS::RX::NONASCII (constant)">NONASCII</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>|</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#ESCAPE-constant" title="Sass::SCSS::RX::ESCAPE (constant)">ESCAPE</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>|-(?!\.?\d))*|%</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="UNITLESS_NUMBER-constant" class="">UNITLESS_NUMBER =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?\d+)?</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="NUMBER-constant" class="">NUMBER =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#UNITLESS_NUMBER-constant" title="Sass::SCSS::RX::UNITLESS_NUMBER (constant)">UNITLESS_NUMBER</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>(?:</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#UNIT-constant" title="Sass::SCSS::RX::UNIT (constant)">UNIT</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>)?</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="PERCENTAGE-constant" class="">PERCENTAGE =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#UNITLESS_NUMBER-constant" title="Sass::SCSS::RX::UNITLESS_NUMBER (constant)">UNITLESS_NUMBER</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>%</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="URI-constant" class="">URI =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>url\(</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#W-constant" title="Sass::SCSS::RX::W (constant)">W</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>(?:</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#STRING-constant" title="Sass::SCSS::RX::STRING (constant)">STRING</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>|</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#URL-constant" title="Sass::SCSS::RX::URL (constant)">URL</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>)</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#W-constant" title="Sass::SCSS::RX::W (constant)">W</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>\)</span><span class='regexp_end'>/i</span></span></pre></dd>
|
||
|
|
||
|
<dt id="FUNCTION-constant" class="">FUNCTION =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#IDENT-constant" title="Sass::SCSS::RX::IDENT (constant)">IDENT</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>\(</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="UNICODERANGE-constant" class="">UNICODERANGE =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>u\+(?:</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#H-constant" title="Sass::SCSS::RX::H (constant)">H</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>{1,6}-</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#H-constant" title="Sass::SCSS::RX::H (constant)">H</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>{1,6}|</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#RANGE-constant" title="Sass::SCSS::RX::RANGE (constant)">RANGE</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>)</span><span class='regexp_end'>/i</span></span></pre></dd>
|
||
|
|
||
|
<dt id="PLUS-constant" class="">PLUS =
|
||
|
<div class="docstring">
|
||
|
<div class="discussion">
|
||
|
|
||
|
<p>Defined in <a
|
||
|
href="http://www.w3.org/TR/css3-selectors/#lex">www.w3.org/TR/css3-selectors/#lex</a></p>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="tags">
|
||
|
|
||
|
|
||
|
</div>
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#W-constant" title="Sass::SCSS::RX::W (constant)">W</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>\+</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="GREATER-constant" class="">GREATER =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#W-constant" title="Sass::SCSS::RX::W (constant)">W</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>></span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="TILDE-constant" class="">TILDE =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#W-constant" title="Sass::SCSS::RX::W (constant)">W</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>~</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="NOT-constant" class="">NOT =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='id identifier rubyid_quote'>quote</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>:not(</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='const'>Regexp</span><span class='op'>::</span><span class='const'>IGNORECASE</span><span class='rparen'>)</span></pre></dd>
|
||
|
|
||
|
<dt id="URL_PREFIX-constant" class="">URL_PREFIX =
|
||
|
<div class="docstring">
|
||
|
<div class="discussion">
|
||
|
|
||
|
<p>Defined in <a
|
||
|
href="https://developer.mozilla.org/en/CSS/@-moz-document">developer.mozilla.org/en/CSS/@-moz-document</a>
|
||
|
as a non-standard version of <a
|
||
|
href="http://www.w3.org/TR/css3-conditional">www.w3.org/TR/css3-conditional</a>/</p>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="tags">
|
||
|
|
||
|
|
||
|
</div>
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>url-prefix\(</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#W-constant" title="Sass::SCSS::RX::W (constant)">W</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>(?:</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#STRING-constant" title="Sass::SCSS::RX::STRING (constant)">STRING</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>|</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#URL-constant" title="Sass::SCSS::RX::URL (constant)">URL</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>)</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#W-constant" title="Sass::SCSS::RX::W (constant)">W</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>\)</span><span class='regexp_end'>/i</span></span></pre></dd>
|
||
|
|
||
|
<dt id="DOMAIN-constant" class="">DOMAIN =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>domain\(</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#W-constant" title="Sass::SCSS::RX::W (constant)">W</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>(?:</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#STRING-constant" title="Sass::SCSS::RX::STRING (constant)">STRING</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>|</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#URL-constant" title="Sass::SCSS::RX::URL (constant)">URL</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>)</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#W-constant" title="Sass::SCSS::RX::W (constant)">W</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>\)</span><span class='regexp_end'>/i</span></span></pre></dd>
|
||
|
|
||
|
<dt id="HEXCOLOR-constant" class="">HEXCOLOR =
|
||
|
<div class="docstring">
|
||
|
<div class="discussion">
|
||
|
|
||
|
<p>Custom</p>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="tags">
|
||
|
|
||
|
|
||
|
</div>
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\#[0-9a-fA-F]+</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="INTERP_START-constant" class="">INTERP_START =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>#\{</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="ANY-constant" class="">ANY =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>:(-[-\w]+-)?any\(</span><span class='regexp_end'>/i</span></span></pre></dd>
|
||
|
|
||
|
<dt id="OPTIONAL-constant" class="">OPTIONAL =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>!</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#W-constant" title="Sass::SCSS::RX::W (constant)">W</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>optional</span><span class='regexp_end'>/i</span></span></pre></dd>
|
||
|
|
||
|
<dt id="IDENT_START-constant" class="">IDENT_START =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>-|</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#NMSTART-constant" title="Sass::SCSS::RX::NMSTART (constant)">NMSTART</a></span></span><span class='embexpr_end'>}</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="IDENT_HYPHEN_INTERP-constant" class="">IDENT_HYPHEN_INTERP =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>-+(?=#\{)</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="STRING1_NOINTERP-constant" class="">STRING1_NOINTERP =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\"((?:[^\n\r\f\\"#]|#(?!\{)|</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#ESCAPE-constant" title="Sass::SCSS::RX::ESCAPE (constant)">ESCAPE</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>)*)\"</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="STRING2_NOINTERP-constant" class="">STRING2_NOINTERP =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\'((?:[^\n\r\f\\'#]|#(?!\{)|</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#ESCAPE-constant" title="Sass::SCSS::RX::ESCAPE (constant)">ESCAPE</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>)*)\'</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="STRING_NOINTERP-constant" class="">STRING_NOINTERP =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#STRING1_NOINTERP-constant" title="Sass::SCSS::RX::STRING1_NOINTERP (constant)">STRING1_NOINTERP</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>|</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#STRING2_NOINTERP-constant" title="Sass::SCSS::RX::STRING2_NOINTERP (constant)">STRING2_NOINTERP</a></span></span><span class='embexpr_end'>}</span><span class='regexp_end'>/</span></span></pre></dd>
|
||
|
|
||
|
<dt id="STATIC_COMPONENT-constant" class="">STATIC_COMPONENT =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#IDENT-constant" title="Sass::SCSS::RX::IDENT (constant)">IDENT</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>|</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#STRING_NOINTERP-constant" title="Sass::SCSS::RX::STRING_NOINTERP (constant)">STRING_NOINTERP</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>|</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#HEXCOLOR-constant" title="Sass::SCSS::RX::HEXCOLOR (constant)">HEXCOLOR</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>|[+-]?</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#NUMBER-constant" title="Sass::SCSS::RX::NUMBER (constant)">NUMBER</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>|\!important</span><span class='regexp_end'>/i</span></span></pre></dd>
|
||
|
|
||
|
<dt id="STATIC_VALUE-constant" class="">STATIC_VALUE =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>%r(</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#STATIC_COMPONENT-constant" title="Sass::SCSS::RX::STATIC_COMPONENT (constant)">STATIC_COMPONENT</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>(\s*[\s,\/]\s*</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#STATIC_COMPONENT-constant" title="Sass::SCSS::RX::STATIC_COMPONENT (constant)">STATIC_COMPONENT</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>)*(?=[;}])</span><span class='regexp_end'>)i</span></span></pre></dd>
|
||
|
|
||
|
<dt id="STATIC_SELECTOR-constant" class="">STATIC_SELECTOR =
|
||
|
|
||
|
</dt>
|
||
|
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#NMCHAR-constant" title="Sass::SCSS::RX::NMCHAR (constant)">NMCHAR</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>|[ \t]|[,>+*]|[:#.]</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#NMSTART-constant" title="Sass::SCSS::RX::NMSTART (constant)">NMSTART</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>){1,50}([{])</span><span class='regexp_end'>/i</span></span></pre></dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<h2>
|
||
|
Class Method Summary
|
||
|
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||
|
</h2>
|
||
|
|
||
|
<ul class="summary">
|
||
|
|
||
|
<li class="public ">
|
||
|
<span class="summary_signature">
|
||
|
|
||
|
<a href="#escape_char-class_method" title="escape_char (class method)">.<strong>escape_char</strong>(c) ⇒ String </a>
|
||
|
|
||
|
|
||
|
|
||
|
</span>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<span class="summary_desc"><div class='inline'>
|
||
|
<p>Escapes a single character for a CSS identifier.</p>
|
||
|
</div></span>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
<li class="public ">
|
||
|
<span class="summary_signature">
|
||
|
|
||
|
<a href="#escape_ident-class_method" title="escape_ident (class method)">.<strong>escape_ident</strong>(str) ⇒ String </a>
|
||
|
|
||
|
|
||
|
|
||
|
</span>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<span class="summary_desc"><div class='inline'>
|
||
|
<p>Takes a string and returns a CSS identifier that will have the value of the
|
||
|
given string.</p>
|
||
|
</div></span>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
<li class="public ">
|
||
|
<span class="summary_signature">
|
||
|
|
||
|
<a href="#quote-class_method" title="quote (class method)">.<strong>quote</strong>(str, flags = 0) ⇒ Regexp </a>
|
||
|
|
||
|
|
||
|
|
||
|
</span>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<span class="summary_desc"><div class='inline'>
|
||
|
<p>Creates a Regexp from a plain text string, escaping all significant
|
||
|
characters.</p>
|
||
|
</div></span>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
|
||
|
</ul>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<div id="class_method_details" class="method_details_list">
|
||
|
<h2>Class Method Details</h2>
|
||
|
|
||
|
|
||
|
<div class="method_details first">
|
||
|
<h3 class="signature first" id="escape_char-class_method">
|
||
|
|
||
|
.<strong>escape_char</strong>(c) ⇒ <tt>String</tt>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</h3><div class="docstring">
|
||
|
<div class="discussion">
|
||
|
|
||
|
<p>Escapes a single character for a CSS identifier.</p>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="tags">
|
||
|
<p class="tag_title">Parameters:</p>
|
||
|
<ul class="param">
|
||
|
|
||
|
<li>
|
||
|
|
||
|
<span class='name'>c</span>
|
||
|
|
||
|
|
||
|
<span class='type'>(<tt>String</tt>)</span>
|
||
|
|
||
|
|
||
|
|
||
|
—
|
||
|
<div class='inline'>
|
||
|
<p>The character to escape. Should have length 1</p>
|
||
|
</div>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
</ul>
|
||
|
|
||
|
<p class="tag_title">Returns:</p>
|
||
|
<ul class="return">
|
||
|
|
||
|
<li>
|
||
|
|
||
|
|
||
|
<span class='type'>(<tt>String</tt>)</span>
|
||
|
|
||
|
|
||
|
|
||
|
—
|
||
|
<div class='inline'>
|
||
|
<p>The escaped character</p>
|
||
|
</div>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
</ul>
|
||
|
|
||
|
</div><table class="source_code">
|
||
|
<tr>
|
||
|
<td>
|
||
|
<pre class="lines">
|
||
|
|
||
|
|
||
|
34
|
||
|
35
|
||
|
36
|
||
|
37</pre>
|
||
|
</td>
|
||
|
<td>
|
||
|
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/scss/rx.rb', line 34</span>
|
||
|
|
||
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_escape_char'>escape_char</span><span class='lparen'>(</span><span class='id identifier rubyid_c'>c</span><span class='rparen'>)</span>
|
||
|
<span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\\%06x</span><span class='tstring_end'>"</span></span> <span class='op'>%</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_ord'>ord</span> <span class='kw'>unless</span> <span class='id identifier rubyid_c'>c</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>%r{</span><span class='tstring_content'>[ -/:-~]</span><span class='regexp_end'>}</span></span>
|
||
|
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\\</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_c'>c</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
||
|
<span class='kw'>end</span></pre>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
|
||
|
<div class="method_details ">
|
||
|
<h3 class="signature " id="escape_ident-class_method">
|
||
|
|
||
|
.<strong>escape_ident</strong>(str) ⇒ <tt>String</tt>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</h3><div class="docstring">
|
||
|
<div class="discussion">
|
||
|
|
||
|
<p>Takes a string and returns a CSS identifier that will have the value of the
|
||
|
given string.</p>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="tags">
|
||
|
<p class="tag_title">Parameters:</p>
|
||
|
<ul class="param">
|
||
|
|
||
|
<li>
|
||
|
|
||
|
<span class='name'>str</span>
|
||
|
|
||
|
|
||
|
<span class='type'>(<tt>String</tt>)</span>
|
||
|
|
||
|
|
||
|
|
||
|
—
|
||
|
<div class='inline'>
|
||
|
<p>The string to escape</p>
|
||
|
</div>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
</ul>
|
||
|
|
||
|
<p class="tag_title">Returns:</p>
|
||
|
<ul class="return">
|
||
|
|
||
|
<li>
|
||
|
|
||
|
|
||
|
<span class='type'>(<tt>String</tt>)</span>
|
||
|
|
||
|
|
||
|
|
||
|
—
|
||
|
<div class='inline'>
|
||
|
<p>The escaped string</p>
|
||
|
</div>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
</ul>
|
||
|
|
||
|
</div><table class="source_code">
|
||
|
<tr>
|
||
|
<td>
|
||
|
<pre class="lines">
|
||
|
|
||
|
|
||
|
14
|
||
|
15
|
||
|
16
|
||
|
17
|
||
|
18
|
||
|
19
|
||
|
20
|
||
|
21
|
||
|
22
|
||
|
23
|
||
|
24
|
||
|
25
|
||
|
26
|
||
|
27</pre>
|
||
|
</td>
|
||
|
<td>
|
||
|
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/scss/rx.rb', line 14</span>
|
||
|
|
||
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_escape_ident'>escape_ident</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='rparen'>)</span>
|
||
|
<span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_str'>str</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
||
|
<span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\\</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_str'>str</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_str'>str</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-</span><span class='tstring_end'>'</span></span> <span class='op'>||</span> <span class='id identifier rubyid_str'>str</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>_</span><span class='tstring_end'>'</span></span>
|
||
|
<span class='id identifier rubyid_out'>out</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span>
|
||
|
<span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_str'>str</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
|
||
|
<span class='id identifier rubyid_out'>out</span> <span class='op'><<</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_slice!'>slice!</span><span class='lparen'>(</span><span class='int'>0</span><span class='op'>...</span><span class='int'>1</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^[-_]</span><span class='regexp_end'>/</span></span>
|
||
|
<span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>...</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>=~</span> <span class='const'><span class='object_link'><a href="#NMSTART-constant" title="Sass::SCSS::RX::NMSTART (constant)">NMSTART</a></span></span>
|
||
|
<span class='id identifier rubyid_out'>out</span> <span class='op'><<</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_slice!'>slice!</span><span class='lparen'>(</span><span class='int'>0</span><span class='op'>...</span><span class='int'>1</span><span class='rparen'>)</span>
|
||
|
<span class='kw'>else</span>
|
||
|
<span class='id identifier rubyid_out'>out</span> <span class='op'><<</span> <span class='id identifier rubyid_escape_char'>escape_char</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_slice!'>slice!</span><span class='lparen'>(</span><span class='int'>0</span><span class='op'>...</span><span class='int'>1</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
||
|
<span class='kw'>end</span>
|
||
|
<span class='id identifier rubyid_out'>out</span> <span class='op'><<</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>[^a-zA-Z0-9_-]</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span> <span class='id identifier rubyid_escape_char'>escape_char</span> <span class='id identifier rubyid_c'>c</span><span class='rbrace'>}</span>
|
||
|
<span class='id identifier rubyid_out'>out</span>
|
||
|
<span class='kw'>end</span></pre>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
|
||
|
<div class="method_details ">
|
||
|
<h3 class="signature " id="quote-class_method">
|
||
|
|
||
|
.<strong>quote</strong>(str, flags = 0) ⇒ <tt>Regexp</tt>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</h3><div class="docstring">
|
||
|
<div class="discussion">
|
||
|
|
||
|
<p>Creates a Regexp from a plain text string, escaping all significant
|
||
|
characters.</p>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="tags">
|
||
|
<p class="tag_title">Parameters:</p>
|
||
|
<ul class="param">
|
||
|
|
||
|
<li>
|
||
|
|
||
|
<span class='name'>str</span>
|
||
|
|
||
|
|
||
|
<span class='type'>(<tt>String</tt>)</span>
|
||
|
|
||
|
|
||
|
|
||
|
—
|
||
|
<div class='inline'>
|
||
|
<p>The text of the regexp</p>
|
||
|
</div>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
<li>
|
||
|
|
||
|
<span class='name'>flags</span>
|
||
|
|
||
|
|
||
|
<span class='type'>(<tt>Integer</tt>)</span>
|
||
|
|
||
|
|
||
|
<em class="default">(defaults to: <tt>0</tt>)</em>
|
||
|
|
||
|
|
||
|
—
|
||
|
<div class='inline'>
|
||
|
<p>Flags for the created regular expression</p>
|
||
|
</div>
|
||
|
|
||
|
</li>
|
||
|
|
||
|
</ul>
|
||
|
|
||
|
<p class="tag_title">Returns:</p>
|
||
|
<ul class="return">
|
||
|
|
||
|
<li>
|
||
|
|
||
|
|
||
|
<span class='type'>(<tt>Regexp</tt>)</span>
|
||
|
|
||
|
|
||
|
|
||
|
</li>
|
||
|
|
||
|
</ul>
|
||
|
|
||
|
</div><table class="source_code">
|
||
|
<tr>
|
||
|
<td>
|
||
|
<pre class="lines">
|
||
|
|
||
|
|
||
|
46
|
||
|
47
|
||
|
48</pre>
|
||
|
</td>
|
||
|
<td>
|
||
|
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/scss/rx.rb', line 46</span>
|
||
|
|
||
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_quote'>quote</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='comma'>,</span> <span class='id identifier rubyid_flags'>flags</span> <span class='op'>=</span> <span class='int'>0</span><span class='rparen'>)</span>
|
||
|
<span class='const'>Regexp</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'>Regexp</span><span class='period'>.</span><span class='id identifier rubyid_quote'>quote</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_flags'>flags</span><span class='rparen'>)</span>
|
||
|
<span class='kw'>end</span></pre>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div id="footer">
|
||
|
Generated on Mon Oct 22 13:20:50 2018 by
|
||
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||
|
0.9.12 (ruby-2.5.3).
|
||
|
</div>
|
||
|
<script>
|
||
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||
|
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||
|
|
||
|
ga('create', 'UA-535380-14', 'sass-lang.com');
|
||
|
ga('send', 'pageview');
|
||
|
</script>
|
||
|
|
||
|
</body>
|
||
|
</html>
|