sass-site/source/documentation/Sass/Script/Lexer.html

1608 lines
73 KiB
HTML
Raw Normal View History

2018-10-22 23:13:05 +02:00
<!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>
Class: Sass::Script::Lexer
&mdash; 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/Script/Lexer.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 (L)</a> &raquo;
<span class='title'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Script.html" title="Sass::Script (module)">Script</a></span></span>
&raquo;
<span class="title">Lexer</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>Class: Sass::Script::Lexer
</h1>
<dl class="box">
<dt class="r1">Inherits:</dt>
<dd class="r1">
<span class="inheritName">Object</span>
<ul class="fullTree">
<li>Object</li>
<li class="next">Sass::Script::Lexer</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
<dt class="r2">Includes:</dt>
<dd class="r2"><span class='object_link'><a href="../SCSS/RX.html" title="Sass::SCSS::RX (module)">Sass::SCSS::RX</a></span></dd>
<dt class="r1 last">Defined in:</dt>
<dd class="r1 last">.ruby-sass/lib/sass/script/lexer.rb</dd>
</dl>
<div class="clear"></div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>The lexical analyzer for SassScript. It takes a raw string and converts it
to individual tokens that are easier to parse.</p>
</div>
</div>
<div class="tags">
</div><div id="subclasses">
<h2>Direct Known Subclasses</h2>
<p class="children"><span class='object_link'><a href="CssLexer.html" title="Sass::Script::CssLexer (class)">CssLexer</a></span></p>
</div>
<div id="subclasses">
<h2>Direct Known Subclasses</h2>
<p class="children"><span class='object_link'><a href="CssLexer.html" title="Sass::Script::CssLexer (class)">CssLexer</a></span></p>
</div>
<h2>Defined Under Namespace</h2>
<p class="children">
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Lexer/Token.html" title="Sass::Script::Lexer::Token (class)">Token</a></span>
</p>
<h2>Constant Summary</h2>
<dl class="constants">
<dt id="OPERATORS-constant" class="">OPERATORS =
<div class="docstring">
<div class="discussion">
<p>A hash from operator strings to the corresponding token types.</p>
</div>
</div>
<div class="tags">
</div>
</dt>
<dd><pre class="code"><span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>+</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='symbol'>:plus</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>-</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='symbol'>:minus</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>*</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='symbol'>:times</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='symbol'>:div</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>%</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='symbol'>:mod</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>=</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='symbol'>:single_eq</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>:</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='symbol'>:colon</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>(</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='symbol'>:lparen</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>)</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='symbol'>:rparen</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>[</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='symbol'>:lsquare</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>]</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='symbol'>:rsquare</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>,</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='symbol'>:comma</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>and</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='symbol'>:and</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>or</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='symbol'>:or</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>not</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='symbol'>:not</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>==</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='symbol'>:eq</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>!=</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='symbol'>:neq</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>&gt;=</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='symbol'>:gte</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>&lt;=</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='symbol'>:lte</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>&gt;</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='symbol'>:gt</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>&lt;</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='symbol'>:lt</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>#{</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='symbol'>:begin_interpolation</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>}</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='symbol'>:end_interpolation</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>;</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='symbol'>:semicolon</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>{</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='symbol'>:lcurly</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>...</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='symbol'>:splat</span><span class='comma'>,</span>
<span class='rbrace'>}</span></pre></dd>
<dt id="OPERATORS_REVERSE-constant" class="">OPERATORS_REVERSE =
</dt>
<dd><pre class="code"><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="../Util.html" title="Sass::Util (module)">Util</a></span></span><span class='period'>.</span><span class='id identifier rubyid_map_hash'><span class='object_link'><a href="../Util.html#map_hash-instance_method" title="Sass::Util#map_hash (method)">map_hash</a></span></span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#OPERATORS-constant" title="Sass::Script::Lexer::OPERATORS (constant)">OPERATORS</a></span></span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='lbracket'>[</span><span class='id identifier rubyid_v'>v</span><span class='comma'>,</span> <span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span><span class='rbrace'>}</span></pre></dd>
<dt id="TOKEN_NAMES-constant" class="">TOKEN_NAMES =
</dt>
<dd><pre class="code"><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="../Util.html" title="Sass::Util (module)">Util</a></span></span><span class='period'>.</span><span class='id identifier rubyid_map_hash'><span class='object_link'><a href="../Util.html#map_hash-instance_method" title="Sass::Util#map_hash (method)">map_hash</a></span></span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#OPERATORS_REVERSE-constant" title="Sass::Script::Lexer::OPERATORS_REVERSE (constant)">OPERATORS_REVERSE</a></span></span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span>
<span class='symbol'>:const</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>variable (e.g. $foo)</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
<span class='symbol'>:ident</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>identifier (e.g. middle)</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span></pre></dd>
<dt id="OP_NAMES-constant" class="">OP_NAMES =
<div class="docstring">
<div class="discussion">
<p>A list of operator strings ordered with longer names first so that `&gt;`
and `&lt;` don&#39;t clobber `&gt;=` and `&lt;=`.</p>
</div>
</div>
<div class="tags">
</div>
</dt>
<dd><pre class="code"><span class='const'><span class='object_link'><a href="#OPERATORS-constant" title="Sass::Script::Lexer::OPERATORS (constant)">OPERATORS</a></span></span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_sort_by'>sort_by</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_o'>o</span><span class='op'>|</span> <span class='op'>-</span><span class='id identifier rubyid_o'>o</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='rbrace'>}</span></pre></dd>
<dt id="IDENT_OP_NAMES-constant" class="">IDENT_OP_NAMES =
<div class="docstring">
<div class="discussion">
<p>A sub-list of <span class='object_link'><a href="#OP_NAMES-constant" title="Sass::Script::Lexer::OP_NAMES (constant)">OP_NAMES</a></span> that only includes operators with identifier
names.</p>
</div>
</div>
<div class="tags">
</div>
</dt>
<dd><pre class="code"><span class='const'><span class='object_link'><a href="#OP_NAMES-constant" title="Sass::Script::Lexer::OP_NAMES (constant)">OP_NAMES</a></span></span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid__v'>_v</span><span class='op'>|</span> <span class='id identifier rubyid_k'>k</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^\w+</span><span class='regexp_end'>/</span></span><span class='rbrace'>}</span></pre></dd>
<dt id="PARSEABLE_NUMBER-constant" class="">PARSEABLE_NUMBER =
</dt>
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>(?:(\d*\.\d+)|(\d+))(?:[eE]([+-]?\d+))?(</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="../SCSS/RX.html#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="REGULAR_EXPRESSIONS-constant" class="">REGULAR_EXPRESSIONS =
<div class="docstring">
<div class="discussion">
<p>A hash of regular expressions that are used for tokenizing.</p>
</div>
</div>
<div class="tags">
</div>
</dt>
<dd><pre class="code"><span class='lbrace'>{</span>
<span class='symbol'>:whitespace</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\s+</span><span class='regexp_end'>/</span></span><span class='comma'>,</span>
<span class='symbol'>:comment</span> <span class='op'>=&gt;</span> <span class='const'><span class='object_link'><a href="../SCSS/RX.html#COMMENT-constant" title="Sass::SCSS::RX::COMMENT (constant)">COMMENT</a></span></span><span class='comma'>,</span>
<span class='symbol'>:single_line_comment</span> <span class='op'>=&gt;</span> <span class='const'><span class='object_link'><a href="../SCSS/RX.html#SINGLE_LINE_COMMENT-constant" title="Sass::SCSS::RX::SINGLE_LINE_COMMENT (constant)">SINGLE_LINE_COMMENT</a></span></span><span class='comma'>,</span>
<span class='symbol'>:variable</span> <span class='op'>=&gt;</span> <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="../SCSS/RX.html#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><span class='comma'>,</span>
<span class='symbol'>:ident</span> <span class='op'>=&gt;</span> <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="../SCSS/RX.html#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><span class='comma'>,</span>
<span class='symbol'>:number</span> <span class='op'>=&gt;</span> <span class='const'><span class='object_link'><a href="#PARSEABLE_NUMBER-constant" title="Sass::Script::Lexer::PARSEABLE_NUMBER (constant)">PARSEABLE_NUMBER</a></span></span><span class='comma'>,</span>
<span class='symbol'>:unary_minus_number</span> <span class='op'>=&gt;</span> <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="#PARSEABLE_NUMBER-constant" title="Sass::Script::Lexer::PARSEABLE_NUMBER (constant)">PARSEABLE_NUMBER</a></span></span><span class='embexpr_end'>}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span>
<span class='symbol'>:color</span> <span class='op'>=&gt;</span> <span class='const'><span class='object_link'><a href="../SCSS/RX.html#HEXCOLOR-constant" title="Sass::SCSS::RX::HEXCOLOR (constant)">HEXCOLOR</a></span></span><span class='comma'>,</span>
<span class='symbol'>:id</span> <span class='op'>=&gt;</span> <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="../SCSS/RX.html#IDENT-constant" title="Sass::SCSS::RX::IDENT (constant)">IDENT</a></span></span><span class='embexpr_end'>}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span>
<span class='symbol'>:selector</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>&amp;</span><span class='regexp_end'>/</span></span><span class='comma'>,</span>
<span class='symbol'>:ident_op</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='const'>Regexp</span><span class='period'>.</span><span class='id identifier rubyid_union'>union</span><span class='lparen'>(</span><span class='op'>*</span><span class='const'><span class='object_link'><a href="#IDENT_OP_NAMES-constant" title="Sass::Script::Lexer::IDENT_OP_NAMES (constant)">IDENT_OP_NAMES</a></span></span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_s'>s</span><span class='op'>|</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_escape'>escape</span><span class='lparen'>(</span><span class='id identifier rubyid_s'>s</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>(?!</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="../SCSS/RX.html#NMCHAR-constant" title="Sass::SCSS::RX::NMCHAR (constant)">NMCHAR</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>|\Z)</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
<span class='kw'>end</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>)</span><span class='regexp_end'>/</span></span><span class='comma'>,</span>
<span class='symbol'>:op</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='const'>Regexp</span><span class='period'>.</span><span class='id identifier rubyid_union'>union</span><span class='lparen'>(</span><span class='op'>*</span><span class='const'><span class='object_link'><a href="#OP_NAMES-constant" title="Sass::Script::Lexer::OP_NAMES (constant)">OP_NAMES</a></span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>)</span><span class='regexp_end'>/</span></span><span class='comma'>,</span>
<span class='rbrace'>}</span></pre></dd>
<dt id="STRING_REGULAR_EXPRESSIONS-constant" class="">STRING_REGULAR_EXPRESSIONS =
<div class="docstring">
<div class="discussion">
<p>A hash of regular expressions that are used for tokenizing strings.</p>
<p>The key is a `[Symbol, Boolean]` pair. The symbol represents which style of
quotation to use, while the boolean represents whether or not the string is
following an interpolated segment.</p>
</div>
</div>
<div class="tags">
</div>
</dt>
<dd><pre class="code"><span class='lbrace'>{</span>
<span class='symbol'>:double</span> <span class='op'>=&gt;</span> <span class='lbrace'>{</span>
<span class='kw'>false</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_string_re'>string_re</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>&quot;</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>&quot;</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='comma'>,</span>
<span class='kw'>true</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_string_re'>string_re</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>&quot;</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='symbol'>:single</span> <span class='op'>=&gt;</span> <span class='lbrace'>{</span>
<span class='kw'>false</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_string_re'>string_re</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&#39;</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&#39;</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='comma'>,</span>
<span class='kw'>true</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_string_re'>string_re</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&#39;</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='symbol'>:uri</span> <span class='op'>=&gt;</span> <span class='lbrace'>{</span>
<span class='kw'>false</span> <span class='op'>=&gt;</span> <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="../SCSS/RX.html#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="../SCSS/RX.html#URLCHAR-constant" title="Sass::SCSS::RX::URLCHAR (constant)">URLCHAR</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="../SCSS/RX.html#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><span class='comma'>,</span>
<span class='kw'>true</span> <span class='op'>=&gt;</span> <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="../SCSS/RX.html#URLCHAR-constant" title="Sass::SCSS::RX::URLCHAR (constant)">URLCHAR</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="../SCSS/RX.html#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>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='comment'># Defined in https://developer.mozilla.org/en/CSS/@-moz-document as a
</span> <span class='comment'># non-standard version of http://www.w3.org/TR/css3-conditional/
</span> <span class='symbol'>:url_prefix</span> <span class='op'>=&gt;</span> <span class='lbrace'>{</span>
<span class='kw'>false</span> <span class='op'>=&gt;</span> <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="../SCSS/RX.html#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="../SCSS/RX.html#URLCHAR-constant" title="Sass::SCSS::RX::URLCHAR (constant)">URLCHAR</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="../SCSS/RX.html#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><span class='comma'>,</span>
<span class='kw'>true</span> <span class='op'>=&gt;</span> <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="../SCSS/RX.html#URLCHAR-constant" title="Sass::SCSS::RX::URLCHAR (constant)">URLCHAR</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="../SCSS/RX.html#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>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='symbol'>:domain</span> <span class='op'>=&gt;</span> <span class='lbrace'>{</span>
<span class='kw'>false</span> <span class='op'>=&gt;</span> <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="../SCSS/RX.html#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="../SCSS/RX.html#URLCHAR-constant" title="Sass::SCSS::RX::URLCHAR (constant)">URLCHAR</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="../SCSS/RX.html#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><span class='comma'>,</span>
<span class='kw'>true</span> <span class='op'>=&gt;</span> <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="../SCSS/RX.html#URLCHAR-constant" title="Sass::SCSS::RX::URLCHAR (constant)">URLCHAR</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="../SCSS/RX.html#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>
<span class='rbrace'>}</span>
<span class='rbrace'>}</span></pre></dd>
</dl>
<h3 class="inherited">Constants included
from <span class='object_link'><a href="../SCSS/RX.html" title="Sass::SCSS::RX (module)">Sass::SCSS::RX</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../SCSS/RX.html#ANY-constant" title="Sass::SCSS::RX::ANY (constant)">Sass::SCSS::RX::ANY</a></span>, <span class='object_link'><a href="../SCSS/RX.html#CDC-constant" title="Sass::SCSS::RX::CDC (constant)">Sass::SCSS::RX::CDC</a></span>, <span class='object_link'><a href="../SCSS/RX.html#CDO-constant" title="Sass::SCSS::RX::CDO (constant)">Sass::SCSS::RX::CDO</a></span>, <span class='object_link'><a href="../SCSS/RX.html#COMMENT-constant" title="Sass::SCSS::RX::COMMENT (constant)">Sass::SCSS::RX::COMMENT</a></span>, <span class='object_link'><a href="../SCSS/RX.html#DASHMATCH-constant" title="Sass::SCSS::RX::DASHMATCH (constant)">Sass::SCSS::RX::DASHMATCH</a></span>, <span class='object_link'><a href="../SCSS/RX.html#DOMAIN-constant" title="Sass::SCSS::RX::DOMAIN (constant)">Sass::SCSS::RX::DOMAIN</a></span>, <span class='object_link'><a href="../SCSS/RX.html#ESCAPE-constant" title="Sass::SCSS::RX::ESCAPE (constant)">Sass::SCSS::RX::ESCAPE</a></span>, <span class='object_link'><a href="../SCSS/RX.html#FUNCTION-constant" title="Sass::SCSS::RX::FUNCTION (constant)">Sass::SCSS::RX::FUNCTION</a></span>, <span class='object_link'><a href="../SCSS/RX.html#GREATER-constant" title="Sass::SCSS::RX::GREATER (constant)">Sass::SCSS::RX::GREATER</a></span>, <span class='object_link'><a href="../SCSS/RX.html#H-constant" title="Sass::SCSS::RX::H (constant)">Sass::SCSS::RX::H</a></span>, <span class='object_link'><a href="../SCSS/RX.html#HASH-constant" title="Sass::SCSS::RX::HASH (constant)">Sass::SCSS::RX::HASH</a></span>, <span class='object_link'><a href="../SCSS/RX.html#HEXCOLOR-constant" title="Sass::SCSS::RX::HEXCOLOR (constant)">Sass::SCSS::RX::HEXCOLOR</a></span>, <span class='object_link'><a href="../SCSS/RX.html#IDENT-constant" title="Sass::SCSS::RX::IDENT (constant)">Sass::SCSS::RX::IDENT</a></span>, <span class='object_link'><a href="../SCSS/RX.html#IDENT_HYPHEN_INTERP-constant" title="Sass::SCSS::RX::IDENT_HYPHEN_INTERP (constant)">Sass::SCSS::RX::IDENT_HYPHEN_INTERP</a></span>, <span class='object_link'><a href="../SCSS/RX.html#IDENT_START-constant" title="Sass::SCSS::RX::IDENT_START (constant)">Sass::SCSS::RX::IDENT_START</a></span>, <span class='object_link'><a href="../SCSS/RX.html#IMPORTANT-constant" title="Sass::SCSS::RX::IMPORTANT (constant)">Sass::SCSS::RX::IMPORTANT</a></span>, <span class='object_link'><a href="../SCSS/RX.html#INCLUDES-constant" title="Sass::SCSS::RX::INCLUDES (constant)">Sass::SCSS::RX::INCLUDES</a></span>, <span class='object_link'><a href="../SCSS/RX.html#INTERP_START-constant" title="Sass::SCSS::RX::INTERP_START (constant)">Sass::SCSS::RX::INTERP_START</a></span>, <span class='object_link'><a href="../SCSS/RX.html#NAME-constant" title="Sass::SCSS::RX::NAME (constant)">Sass::SCSS::RX::NAME</a></span>, <span class='object_link'><a href="../SCSS/RX.html#NL-constant" title="Sass::SCSS::RX::NL (constant)">Sass::SCSS::RX::NL</a></span>, <span class='object_link'><a href="../SCSS/RX.html#NMCHAR-constant" title="Sass::SCSS::RX::NMCHAR (constant)">Sass::SCSS::RX::NMCHAR</a></span>, <span class='object_link'><a href="../SCSS/RX.html#NMSTART-constant" title="Sass::SCSS::RX::NMSTART (constant)">Sass::SCSS::RX::NMSTART</a></span>, <span class='object_link'><a href="../SCSS/RX.html#NONASCII-constant" title="Sass::SCSS::RX::NONASCII (constant)">Sass::SCSS::RX::NONASCII</a></span>, <span class='object_link'><a href="../SCSS/RX.html#NOT-constant" title="Sass::SCSS::RX::NOT (constant)">Sass::SCSS::RX::NOT</a></span>, <span class='object_link'><a href="../SCSS/RX.html#NUMBER-constant" title="Sass::SCSS::RX::NUMBER (constant)">Sass::SCSS::RX::NUMBER</a></span>, <span class='object_link'><a href="../SCSS/RX.html#OPTIONAL-constant" title="Sass::SCSS::RX::OPTIONAL (constant)">Sass::SCSS::RX::OPTIONAL</a></span>, <span class='object_link'><a href="../SCSS/RX.html#PERCENTAGE-constant" title="Sass::SCSS::RX::PERCENTAGE (constant)">Sass::SCSS::RX::PERCENTAGE</a></span>, <span class='object_link'><a href="../SCSS/RX.html#PLUS-constant" title="Sass::SCSS::RX::PLUS
<h2>
Instance Method Summary
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
</h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#after_interpolation%3F-instance_method" title="#after_interpolation? (instance method)">#<strong>after_interpolation?</strong> &#x21d2; Boolean </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Whether or not the last token lexed was `:end_interpolation`.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#char-instance_method" title="#char (instance method)">#<strong>char</strong>(pos = @scanner.pos) &#x21d2; String </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the given character.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#done%3F-instance_method" title="#done? (instance method)">#<strong>done?</strong> &#x21d2; Boolean </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Whether or not there&#39;s more source text to lex.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#expected!-instance_method" title="#expected! (instance method)">#<strong>expected!</strong>(name) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Raise an error to the effect that `name` was expected in the input stream
and wasn&#39;t found.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(str, line, offset, options) &#x21d2; Lexer </a>
</span>
<span class="note title constructor">constructor</span>
<span class="summary_desc"><div class='inline'>
<p>A new instance of Lexer.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#line-instance_method" title="#line (instance method)">#<strong>line</strong> &#x21d2; Integer </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>The line number of the lexer&#39;s current position.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#next-instance_method" title="#next (instance method)">#<strong>next</strong> &#x21d2; Token </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Moves the lexer forward one token.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#offset-instance_method" title="#offset (instance method)">#<strong>offset</strong> &#x21d2; Integer </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>The number of bytes into the current line of the lexer&#39;s current
position (1-based).</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#peek-instance_method" title="#peek (instance method)">#<strong>peek</strong> &#x21d2; Token </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the next token without moving the lexer forward.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#str-instance_method" title="#str (instance method)">#<strong>str</strong> { ... } &#x21d2; String </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Records all non-comment text the lexer consumes within the block and
returns it as a string.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#unpeek!-instance_method" title="#unpeek! (instance method)">#<strong>unpeek!</strong> &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Rewinds the underlying StringScanner to before the token returned by
<span class='object_link'><a href="#peek-instance_method" title="Sass::Script::Lexer#peek (method)">#peek</a></span>.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#whitespace%3F-instance_method" title="#whitespace? (instance method)">#<strong>whitespace?</strong>(tok = @tok) &#x21d2; Boolean </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns whether or not there&#39;s whitespace before the next token.</p>
</div></span>
</li>
</ul>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../SCSS/RX.html" title="Sass::SCSS::RX (module)">Sass::SCSS::RX</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../SCSS/RX.html#escape_char-class_method" title="Sass::SCSS::RX.escape_char (method)">escape_char</a></span>, <span class='object_link'><a href="../SCSS/RX.html#escape_ident-class_method" title="Sass::SCSS::RX.escape_ident (method)">escape_ident</a></span>, <span class='object_link'><a href="../SCSS/RX.html#quote-class_method" title="Sass::SCSS::RX.quote (method)">quote</a></span></p>
<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>
<div class="method_details first">
<h3 class="signature first" id="initialize-instance_method">
#<strong>initialize</strong>(str, line, offset, options) &#x21d2; <tt><span class='object_link'><a href="" title="Sass::Script::Lexer (class)">Lexer</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a new instance of Lexer</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>, <tt>StringScanner</tt>)</span>
&mdash;
<div class='inline'>
<p>The source text to lex</p>
</div>
</li>
<li>
<span class='name'>line</span>
<span class='type'>(<tt>Integer</tt>)</span>
&mdash;
<div class='inline'>
<p>The 1-based line on which the SassScript appears. Used for error reporting
and sourcemap building</p>
</div>
</li>
<li>
<span class='name'>offset</span>
<span class='type'>(<tt>Integer</tt>)</span>
&mdash;
<div class='inline'>
<p>The 1-based character (not byte) offset in the line in the source. Used for
error reporting and sourcemap building</p>
</div>
</li>
<li>
<span class='name'>options</span>
<span class='type'>(<tt>{Symbol =&gt; Object}</tt>)</span>
&mdash;
<div class='inline'>
<p>An options hash; see <a href="../../file.SASS_REFERENCE.html#Options" title="the Sass options documentation">the Sass options documentation</a></p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
153
154
155
156
157
158
159
160
161
162</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/script/lexer.rb', line 153</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='comma'>,</span> <span class='id identifier rubyid_line'>line</span><span class='comma'>,</span> <span class='id identifier rubyid_offset'>offset</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
<span class='ivar'>@scanner</span> <span class='op'>=</span> <span class='id identifier rubyid_str'>str</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>StringScanner</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_str'>str</span> <span class='op'>:</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="../Util.html" title="Sass::Util (module)">Util</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Util/MultibyteStringScanner.html" title="Sass::Util::MultibyteStringScanner (class)">MultibyteStringScanner</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../Util/MultibyteStringScanner.html#new-class_method" title="Sass::Util::MultibyteStringScanner.new (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='rparen'>)</span>
<span class='ivar'>@line</span> <span class='op'>=</span> <span class='id identifier rubyid_line'>line</span>
<span class='ivar'>@offset</span> <span class='op'>=</span> <span class='id identifier rubyid_offset'>offset</span>
<span class='ivar'>@options</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span>
<span class='ivar'>@interpolation_stack</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
<span class='ivar'>@prev</span> <span class='op'>=</span> <span class='kw'>nil</span>
<span class='ivar'>@tok</span> <span class='op'>=</span> <span class='kw'>nil</span>
<span class='ivar'>@next_tok</span> <span class='op'>=</span> <span class='kw'>nil</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>
<div class="method_details first">
<h3 class="signature first" id="initialize-instance_method">
#<strong>initialize</strong>(str, line, offset, options) &#x21d2; <tt><span class='object_link'><a href="" title="Sass::Script::Lexer (class)">Lexer</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a new instance of Lexer</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>, <tt>StringScanner</tt>)</span>
&mdash;
<div class='inline'>
<p>The source text to lex</p>
</div>
</li>
<li>
<span class='name'>line</span>
<span class='type'>(<tt>Integer</tt>)</span>
&mdash;
<div class='inline'>
<p>The 1-based line on which the SassScript appears. Used for error reporting
and sourcemap building</p>
</div>
</li>
<li>
<span class='name'>offset</span>
<span class='type'>(<tt>Integer</tt>)</span>
&mdash;
<div class='inline'>
<p>The 1-based character (not byte) offset in the line in the source. Used for
error reporting and sourcemap building</p>
</div>
</li>
<li>
<span class='name'>options</span>
<span class='type'>(<tt>{Symbol =&gt; Object}</tt>)</span>
&mdash;
<div class='inline'>
<p>An options hash; see <a href="../../file.SASS_REFERENCE.html#Options" title="the Sass options documentation">the Sass options documentation</a></p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
153
154
155
156
157
158
159
160
161
162</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/script/lexer.rb', line 153</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='comma'>,</span> <span class='id identifier rubyid_line'>line</span><span class='comma'>,</span> <span class='id identifier rubyid_offset'>offset</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
<span class='ivar'>@scanner</span> <span class='op'>=</span> <span class='id identifier rubyid_str'>str</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>StringScanner</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_str'>str</span> <span class='op'>:</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="../Util.html" title="Sass::Util (module)">Util</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Util/MultibyteStringScanner.html" title="Sass::Util::MultibyteStringScanner (class)">MultibyteStringScanner</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../Util/MultibyteStringScanner.html#new-class_method" title="Sass::Util::MultibyteStringScanner.new (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='rparen'>)</span>
<span class='ivar'>@line</span> <span class='op'>=</span> <span class='id identifier rubyid_line'>line</span>
<span class='ivar'>@offset</span> <span class='op'>=</span> <span class='id identifier rubyid_offset'>offset</span>
<span class='ivar'>@options</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span>
<span class='ivar'>@interpolation_stack</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
<span class='ivar'>@prev</span> <span class='op'>=</span> <span class='kw'>nil</span>
<span class='ivar'>@tok</span> <span class='op'>=</span> <span class='kw'>nil</span>
<span class='ivar'>@next_tok</span> <span class='op'>=</span> <span class='kw'>nil</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="after_interpolation?-instance_method">
#<strong>after_interpolation?</strong> &#x21d2; <tt>Boolean</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns Whether or not the last token lexed was `:end_interpolation`.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Boolean</tt>)</span>
&mdash;
<div class='inline'>
<p>Whether or not the last token lexed was `:end_interpolation`.</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
217
218
219</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/script/lexer.rb', line 217</span>
<span class='kw'>def</span> <span class='id identifier rubyid_after_interpolation?'>after_interpolation?</span>
<span class='ivar'>@prev</span> <span class='op'>&amp;&amp;</span> <span class='ivar'>@prev</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span> <span class='op'>==</span> <span class='symbol'>:end_interpolation</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="char-instance_method">
#<strong>char</strong>(pos = @scanner.pos) &#x21d2; <tt>String</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the given character.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>String</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
189
190
191</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/script/lexer.rb', line 189</span>
<span class='kw'>def</span> <span class='id identifier rubyid_char'>char</span><span class='lparen'>(</span><span class='id identifier rubyid_pos'>pos</span> <span class='op'>=</span> <span class='ivar'>@scanner</span><span class='period'>.</span><span class='id identifier rubyid_pos'>pos</span><span class='rparen'>)</span>
<span class='ivar'>@scanner</span><span class='period'>.</span><span class='id identifier rubyid_string'>string</span><span class='lbracket'>[</span><span class='id identifier rubyid_pos'>pos</span><span class='comma'>,</span> <span class='int'>1</span><span class='rbracket'>]</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="done?-instance_method">
#<strong>done?</strong> &#x21d2; <tt>Boolean</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns Whether or not there&#39;s more source text to lex.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Boolean</tt>)</span>
&mdash;
<div class='inline'>
<p>Whether or not there&#39;s more source text to lex.</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
210
211
212
213
214</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/script/lexer.rb', line 210</span>
<span class='kw'>def</span> <span class='id identifier rubyid_done?'>done?</span>
<span class='kw'>return</span> <span class='kw'>if</span> <span class='ivar'>@next_tok</span>
<span class='id identifier rubyid_whitespace'>whitespace</span> <span class='kw'>unless</span> <span class='id identifier rubyid_after_interpolation?'>after_interpolation?</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='ivar'>@interpolation_stack</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='ivar'>@scanner</span><span class='period'>.</span><span class='id identifier rubyid_eos?'>eos?</span> <span class='op'>&amp;&amp;</span> <span class='ivar'>@tok</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="expected!-instance_method">
#<strong>expected!</strong>(name) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Raise an error to the effect that `name` was expected in the input stream
and wasn&#39;t found.</p>
<p>This calls <span class='object_link'><a href="#unpeek!-instance_method" title="Sass::Script::Lexer#unpeek! (method)">#unpeek!</a></span> to rewind the scanner to immediately after the last
returned token.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>name</span>
<span class='type'>(<tt>String</tt>)</span>
&mdash;
<div class='inline'>
<p>The name of the entity that was expected but not found</p>
</div>
</li>
</ul>
<p class="tag_title">Raises:</p>
<ul class="raise">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../SyntaxError.html" title="Sass::SyntaxError (class)">Sass::SyntaxError</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
229
230
231
232</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/script/lexer.rb', line 229</span>
<span class='kw'>def</span> <span class='id identifier rubyid_expected!'>expected!</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_unpeek!'>unpeek!</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'><span class='object_link'><a href="../SCSS/Parser.html" title="Sass::SCSS::Parser (class)">Parser</a></span></span><span class='period'>.</span><span class='id identifier rubyid_expected'>expected</span><span class='lparen'>(</span><span class='ivar'>@scanner</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='ivar'>@line</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="line-instance_method">
#<strong>line</strong> &#x21d2; <tt>Integer</tt>
</h3><div class="docstring">
<div class="discussion">
<p>The line number of the lexer&#39;s current position.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Integer</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
29
30
31
32</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/script/lexer.rb', line 29</span>
<span class='kw'>def</span> <span class='id identifier rubyid_line'>line</span>
<span class='kw'>return</span> <span class='ivar'>@line</span> <span class='kw'>unless</span> <span class='ivar'>@tok</span>
<span class='ivar'>@tok</span><span class='period'>.</span><span class='id identifier rubyid_source_range'>source_range</span><span class='period'>.</span><span class='id identifier rubyid_start_pos'>start_pos</span><span class='period'>.</span><span class='id identifier rubyid_line'>line</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="next-instance_method">
#<strong>next</strong> &#x21d2; <tt><span class='object_link'><a href="Lexer/Token.html" title="Sass::Script::Lexer::Token (class)">Token</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Moves the lexer forward one token.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="Lexer/Token.html" title="Sass::Script::Lexer::Token (class)">Token</a></span></tt>)</span>
&mdash;
<div class='inline'>
<p>The token that was moved past</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
167
168
169
170
171
172</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/script/lexer.rb', line 167</span>
<span class='kw'>def</span> <span class='kw'>next</span>
<span class='ivar'>@tok</span> <span class='op'>||=</span> <span class='id identifier rubyid_read_token'>read_token</span>
<span class='ivar'>@tok</span><span class='comma'>,</span> <span class='id identifier rubyid_tok'>tok</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='ivar'>@tok</span>
<span class='ivar'>@prev</span> <span class='op'>=</span> <span class='id identifier rubyid_tok'>tok</span>
<span class='id identifier rubyid_tok'>tok</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="offset-instance_method">
#<strong>offset</strong> &#x21d2; <tt>Integer</tt>
</h3><div class="docstring">
<div class="discussion">
<p>The number of bytes into the current line of the lexer&#39;s current
position (1-based).</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Integer</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
38
39
40
41</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/script/lexer.rb', line 38</span>
<span class='kw'>def</span> <span class='id identifier rubyid_offset'>offset</span>
<span class='kw'>return</span> <span class='ivar'>@offset</span> <span class='kw'>unless</span> <span class='ivar'>@tok</span>
<span class='ivar'>@tok</span><span class='period'>.</span><span class='id identifier rubyid_source_range'>source_range</span><span class='period'>.</span><span class='id identifier rubyid_start_pos'>start_pos</span><span class='period'>.</span><span class='id identifier rubyid_offset'>offset</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="peek-instance_method">
#<strong>peek</strong> &#x21d2; <tt><span class='object_link'><a href="Lexer/Token.html" title="Sass::Script::Lexer::Token (class)">Token</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the next token without moving the lexer forward.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="Lexer/Token.html" title="Sass::Script::Lexer::Token (class)">Token</a></span></tt>)</span>
&mdash;
<div class='inline'>
<p>The next token</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
196
197
198</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/script/lexer.rb', line 196</span>
<span class='kw'>def</span> <span class='id identifier rubyid_peek'>peek</span>
<span class='ivar'>@tok</span> <span class='op'>||=</span> <span class='id identifier rubyid_read_token'>read_token</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="str-instance_method">
#<strong>str</strong> { ... } &#x21d2; <tt>String</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Records all non-comment text the lexer consumes within the block and
returns it as a string.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Yields:</p>
<ul class="yield">
<li>
<span class='type'></span>
<div class='inline'>
<p>A block in which text is recorded</p>
</div>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>String</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
239
240
241
242
243
244</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/script/lexer.rb', line 239</span>
<span class='kw'>def</span> <span class='id identifier rubyid_str'>str</span>
<span class='id identifier rubyid_old_pos'>old_pos</span> <span class='op'>=</span> <span class='ivar'>@tok</span> <span class='op'>?</span> <span class='ivar'>@tok</span><span class='period'>.</span><span class='id identifier rubyid_pos'>pos</span> <span class='op'>:</span> <span class='ivar'>@scanner</span><span class='period'>.</span><span class='id identifier rubyid_pos'>pos</span>
<span class='kw'>yield</span>
<span class='id identifier rubyid_new_pos'>new_pos</span> <span class='op'>=</span> <span class='ivar'>@tok</span> <span class='op'>?</span> <span class='ivar'>@tok</span><span class='period'>.</span><span class='id identifier rubyid_pos'>pos</span> <span class='op'>:</span> <span class='ivar'>@scanner</span><span class='period'>.</span><span class='id identifier rubyid_pos'>pos</span>
<span class='ivar'>@scanner</span><span class='period'>.</span><span class='id identifier rubyid_string'>string</span><span class='lbracket'>[</span><span class='id identifier rubyid_old_pos'>old_pos</span><span class='op'>...</span><span class='id identifier rubyid_new_pos'>new_pos</span><span class='rbracket'>]</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="unpeek!-instance_method">
#<strong>unpeek!</strong> &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Rewinds the underlying StringScanner to before the token returned by
<span class='object_link'><a href="#peek-instance_method" title="Sass::Script::Lexer#peek (method)">#peek</a></span>.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
202
203
204
205
206
207</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/script/lexer.rb', line 202</span>
<span class='kw'>def</span> <span class='id identifier rubyid_unpeek!'>unpeek!</span>
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='ivar'>@tok</span>
<span class='ivar'>@scanner</span><span class='period'>.</span><span class='id identifier rubyid_pos'>pos</span> <span class='op'>=</span> <span class='ivar'>@tok</span><span class='period'>.</span><span class='id identifier rubyid_pos'>pos</span>
<span class='ivar'>@line</span> <span class='op'>=</span> <span class='ivar'>@tok</span><span class='period'>.</span><span class='id identifier rubyid_source_range'>source_range</span><span class='period'>.</span><span class='id identifier rubyid_start_pos'>start_pos</span><span class='period'>.</span><span class='id identifier rubyid_line'>line</span>
<span class='ivar'>@offset</span> <span class='op'>=</span> <span class='ivar'>@tok</span><span class='period'>.</span><span class='id identifier rubyid_source_range'>source_range</span><span class='period'>.</span><span class='id identifier rubyid_start_pos'>start_pos</span><span class='period'>.</span><span class='id identifier rubyid_offset'>offset</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="whitespace?-instance_method">
#<strong>whitespace?</strong>(tok = @tok) &#x21d2; <tt>Boolean</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns whether or not there&#39;s whitespace before the next token.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Boolean</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
177
178
179
180
181
182
183
184</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/script/lexer.rb', line 177</span>
<span class='kw'>def</span> <span class='id identifier rubyid_whitespace?'>whitespace?</span><span class='lparen'>(</span><span class='id identifier rubyid_tok'>tok</span> <span class='op'>=</span> <span class='ivar'>@tok</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='id identifier rubyid_tok'>tok</span>
<span class='ivar'>@scanner</span><span class='period'>.</span><span class='id identifier rubyid_string'>string</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>...</span><span class='id identifier rubyid_tok'>tok</span><span class='period'>.</span><span class='id identifier rubyid_pos'>pos</span><span class='rbracket'>]</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\s\Z</span><span class='regexp_end'>/</span></span>
<span class='kw'>else</span>
<span class='ivar'>@scanner</span><span class='period'>.</span><span class='id identifier rubyid_string'>string</span><span class='lbracket'>[</span><span class='ivar'>@scanner</span><span class='period'>.</span><span class='id identifier rubyid_pos'>pos</span><span class='comma'>,</span> <span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^\s</span><span class='regexp_end'>/</span></span> <span class='op'>||</span>
<span class='ivar'>@scanner</span><span class='period'>.</span><span class='id identifier rubyid_string'>string</span><span class='lbracket'>[</span><span class='ivar'>@scanner</span><span class='period'>.</span><span class='id identifier rubyid_pos'>pos</span> <span class='op'>-</span> <span class='int'>1</span><span class='comma'>,</span> <span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\s\Z</span><span class='regexp_end'>/</span></span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Mon Oct 22 13:20:52 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>