sass-site/source/documentation/Sass/SyntaxError.html
2018-10-22 14:13:05 -07:00

1474 lines
45 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>
Exception: Sass::SyntaxError
&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/SyntaxError.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 (S)</a> &raquo;
<span class='title'><span class='object_link'><a href="../Sass.html" title="Sass (module)">Sass</a></span></span>
&raquo;
<span class="title">SyntaxError</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>Exception: Sass::SyntaxError
</h1>
<dl class="box">
<dt class="r1">Inherits:</dt>
<dd class="r1">
<span class="inheritName">StandardError</span>
<ul class="fullTree">
<li>Object</li>
<li class="next">StandardError</li>
<li class="next">Sass::SyntaxError</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
<dt class="r2 last">Defined in:</dt>
<dd class="r2 last">.ruby-sass/lib/sass/error.rb</dd>
</dl>
<div class="clear"></div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>An exception class that keeps track of the line of the Sass template it was
raised on and the Sass file that was being parsed (if applicable).</p>
<p>All Sass errors are raised as <span class='object_link'><a href="" title="Sass::SyntaxError (class)">SyntaxError</a></span>s.</p>
<p>When dealing with SyntaxErrors, it&#39;s important to provide filename and
line number information. This will be used in various error reports to
users, including backtraces; see <span class='object_link'><a href="#sass_backtrace-instance_method" title="Sass::SyntaxError#sass_backtrace (method)">#sass_backtrace</a></span> for details.</p>
<p>Some of this information is usually provided as part of the constructor.
New backtrace entries can be added with <span class='object_link'><a href="#add_backtrace-instance_method" title="Sass::SyntaxError#add_backtrace (method)">#add_backtrace</a></span>, which is called
when an exception is raised between files (e.g. with `@import`).</p>
<p>Often, a chunk of code will all have similar backtrace information - the
same filename or even line. It may also be useful to have a default line
number set. In those situations, the default values can be used by omitting
the information on the original exception, and then calling
<span class='object_link'><a href="#modify_backtrace-instance_method" title="Sass::SyntaxError#modify_backtrace (method)">#modify_backtrace</a></span> in a wrapper `rescue`. When doing this, be sure that
all exceptions ultimately end up with the information filled in.</p>
</div>
</div>
<div class="tags">
</div><div id="subclasses">
<h2>Direct Known Subclasses</h2>
<p class="children"><span class='object_link'><a href="UnitConversionError.html" title="Sass::UnitConversionError (class)">UnitConversionError</a></span></p>
</div>
<div id="subclasses">
<h2>Direct Known Subclasses</h2>
<p class="children"><span class='object_link'><a href="UnitConversionError.html" title="Sass::UnitConversionError (class)">UnitConversionError</a></span></p>
</div>
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#sass_backtrace-instance_method" title="#sass_backtrace (instance method)">#<strong>sass_backtrace</strong> &#x21d2; Aray&lt;{Symbol =&gt; Object&gt;} </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>The backtrace of the error within Sass files.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#sass_template-instance_method" title="#sass_template (instance method)">#<strong>sass_template</strong> &#x21d2; String </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>The text of the template where this error was raised.</p>
</div></span>
</li>
</ul>
<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="#exception_to_css-class_method" title="exception_to_css (class method)">.<strong>exception_to_css</strong>(e, line_offset = 1) &#x21d2; String </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns an error report for an exception in CSS format.</p>
</div></span>
</li>
</ul>
<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="#add_backtrace-instance_method" title="#add_backtrace (instance method)">#<strong>add_backtrace</strong>(attrs) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Adds an entry to the exception&#39;s Sass backtrace.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#backtrace-instance_method" title="#backtrace (instance method)">#<strong>backtrace</strong> &#x21d2; Array&lt;String&gt; </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the standard exception backtrace, including the Sass backtrace.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(msg, attrs = {}) &#x21d2; SyntaxError </a>
</span>
<span class="note title constructor">constructor</span>
<span class="summary_desc"><div class='inline'>
<p>A new instance of SyntaxError.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#modify_backtrace-instance_method" title="#modify_backtrace (instance method)">#<strong>modify_backtrace</strong>(attrs) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Modify the top Sass backtrace entries (that is, the most deeply nested
ones) to have the given attributes.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#sass_backtrace_str-instance_method" title="#sass_backtrace_str (instance method)">#<strong>sass_backtrace_str</strong>(default_filename = &quot;an unknown file&quot;) &#x21d2; String </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns a string representation of the Sass backtrace.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#sass_filename-instance_method" title="#sass_filename (instance method)">#<strong>sass_filename</strong> &#x21d2; String<sup>?</sup> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>The name of the file in which the exception was raised.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#sass_line-instance_method" title="#sass_line (instance method)">#<strong>sass_line</strong> &#x21d2; Integer </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>The line of the Sass template on which the error occurred.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#sass_mixin-instance_method" title="#sass_mixin (instance method)">#<strong>sass_mixin</strong> &#x21d2; String </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>The name of the mixin in which the error occurred.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#to_s-instance_method" title="#to_s (instance method)">#<strong>to_s</strong> &#x21d2; String </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>The error message.</p>
</div></span>
</li>
</ul>
<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>(msg, attrs = {}) &#x21d2; <tt><span class='object_link'><a href="" title="Sass::SyntaxError (class)">SyntaxError</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a new instance of SyntaxError</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>msg</span>
<span class='type'>(<tt>String</tt>)</span>
&mdash;
<div class='inline'>
<p>The error message</p>
</div>
</li>
<li>
<span class='name'>attrs</span>
<span class='type'>(<tt>{Symbol =&gt; Object}</tt>)</span>
<em class="default">(defaults to: <tt>{}</tt>)</em>
&mdash;
<div class='inline'>
<p>The information in the backtrace entry. See <span class='object_link'><a href="#sass_backtrace-instance_method" title="Sass::SyntaxError#sass_backtrace (method)">#sass_backtrace</a></span></p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
55
56
57
58
59</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/error.rb', line 55</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_msg'>msg</span><span class='comma'>,</span> <span class='id identifier rubyid_attrs'>attrs</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='ivar'>@message</span> <span class='op'>=</span> <span class='id identifier rubyid_msg'>msg</span>
<span class='ivar'>@sass_backtrace</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
<span class='id identifier rubyid_add_backtrace'>add_backtrace</span><span class='lparen'>(</span><span class='id identifier rubyid_attrs'>attrs</span><span class='rparen'>)</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>(msg, attrs = {}) &#x21d2; <tt><span class='object_link'><a href="" title="Sass::SyntaxError (class)">SyntaxError</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a new instance of SyntaxError</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>msg</span>
<span class='type'>(<tt>String</tt>)</span>
&mdash;
<div class='inline'>
<p>The error message</p>
</div>
</li>
<li>
<span class='name'>attrs</span>
<span class='type'>(<tt>{Symbol =&gt; Object}</tt>)</span>
<em class="default">(defaults to: <tt>{}</tt>)</em>
&mdash;
<div class='inline'>
<p>The information in the backtrace entry. See <span class='object_link'><a href="#sass_backtrace-instance_method" title="Sass::SyntaxError#sass_backtrace (method)">#sass_backtrace</a></span></p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
55
56
57
58
59</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/error.rb', line 55</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_msg'>msg</span><span class='comma'>,</span> <span class='id identifier rubyid_attrs'>attrs</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='ivar'>@message</span> <span class='op'>=</span> <span class='id identifier rubyid_msg'>msg</span>
<span class='ivar'>@sass_backtrace</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
<span class='id identifier rubyid_add_backtrace'>add_backtrace</span><span class='lparen'>(</span><span class='id identifier rubyid_attrs'>attrs</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="instance_attr_details" class="attr_details">
<h2>Instance Attribute Details</h2>
<span id="sass_backtrace=-instance_method"></span>
<div class="method_details first">
<h3 class="signature first" id="sass_backtrace-instance_method">
#<strong>sass_backtrace</strong> &#x21d2; <tt>Aray&lt;{Symbol =&gt; Object&gt;}</tt>
</h3><div class="docstring">
<div class="discussion">
<p>The backtrace of the error within Sass files. This is an array of hashes
containing information for a single entry. The hashes have the following
keys:</p>
<p>`:filename` : The name of the file in which the exception was raised,</p>
<pre class="code ruby"><code class="ruby">or `nil` if no filename is available.
</code></pre>
<p>`:mixin` : The name of the mixin in which the exception was raised,</p>
<pre class="code ruby"><code class="ruby">or `nil` if it wasn&#39;t raised in a mixin.
</code></pre>
<p>`:line` : The line of the file on which the error occurred. Never nil.</p>
<p>This information is also included in standard backtrace format in the
output of <span class='object_link'><a href="#backtrace-instance_method" title="Sass::SyntaxError#backtrace (method)">#backtrace</a></span>.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Aray&lt;{Symbol =&gt; Object&gt;}</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
45
46
47</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/error.rb', line 45</span>
<span class='kw'>def</span> <span class='id identifier rubyid_sass_backtrace'>sass_backtrace</span>
<span class='ivar'>@sass_backtrace</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="sass_template=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="sass_template-instance_method">
#<strong>sass_template</strong> &#x21d2; <tt>String</tt>
</h3><div class="docstring">
<div class="discussion">
<p>The text of the template where this error was raised.</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">
50
51
52</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/error.rb', line 50</span>
<span class='kw'>def</span> <span class='id identifier rubyid_sass_template'>sass_template</span>
<span class='ivar'>@sass_template</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="class_method_details" class="method_details_list">
<h2>Class Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="exception_to_css-class_method">
.<strong>exception_to_css</strong>(e, line_offset = 1) &#x21d2; <tt>String</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns an error report for an exception in CSS format.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>e</span>
<span class='type'>(<tt>Exception</tt>)</span>
</li>
<li>
<span class='name'>line_offset</span>
<span class='type'>(<tt>Integer</tt>)</span>
<em class="default">(defaults to: <tt>1</tt>)</em>
&mdash;
<div class='inline'>
<p>The number of the first line of the Sass template.</p>
</div>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>String</tt>)</span>
&mdash;
<div class='inline'>
<p>The error report</p>
</div>
</li>
</ul>
<p class="tag_title">Raises:</p>
<ul class="raise">
<li>
<span class='type'>(<tt>Exception</tt>)</span>
&mdash;
<div class='inline'>
<p>`e`, if the <a href="../file.SASS_REFERENCE.html#full_exception-option" title="`:full_exception`">`:full_exception`</a> option is set to false.</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/error.rb', line 161</span>
<span class='kw'>def</span> <span class='id identifier rubyid_exception_to_css'>exception_to_css</span><span class='lparen'>(</span><span class='id identifier rubyid_e'>e</span><span class='comma'>,</span> <span class='id identifier rubyid_line_offset'>line_offset</span> <span class='op'>=</span> <span class='int'>1</span><span class='rparen'>)</span>
<span class='id identifier rubyid_header'>header</span> <span class='op'>=</span> <span class='id identifier rubyid_header_string'>header_string</span><span class='lparen'>(</span><span class='id identifier rubyid_e'>e</span><span class='comma'>,</span> <span class='id identifier rubyid_line_offset'>line_offset</span><span class='rparen'>)</span>
<span class='heredoc_beg'>&lt;&lt;END</span>
<span class='tstring_content'>/*
</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_header'>header</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>*/</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'>*\\/</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>
Backtrace:\n</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>*/</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'>*\\/</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>
*/
body:before {
white-space: pre;
font-family: monospace;
content: &quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_header'>header</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</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='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>\\A </span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>&quot;; }
</span><span class='heredoc_end'>END
</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="add_backtrace-instance_method">
#<strong>add_backtrace</strong>(attrs) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Adds an entry to the exception&#39;s Sass backtrace.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>attrs</span>
<span class='type'>(<tt>{Symbol =&gt; Object}</tt>)</span>
&mdash;
<div class='inline'>
<p>The information in the backtrace entry. See <span class='object_link'><a href="#sass_backtrace-instance_method" title="Sass::SyntaxError#sass_backtrace (method)">#sass_backtrace</a></span></p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
88
89
90</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/error.rb', line 88</span>
<span class='kw'>def</span> <span class='id identifier rubyid_add_backtrace'>add_backtrace</span><span class='lparen'>(</span><span class='id identifier rubyid_attrs'>attrs</span><span class='rparen'>)</span>
<span class='id identifier rubyid_sass_backtrace'>sass_backtrace</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_attrs'>attrs</span><span class='period'>.</span><span class='id identifier rubyid_reject'>reject</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_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span><span class='rbrace'>}</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="backtrace-instance_method">
#<strong>backtrace</strong> &#x21d2; <tt>Array&lt;String&gt;</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the standard exception backtrace, including the Sass backtrace.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Array&lt;String&gt;</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
126
127
128
129
130
131
132
133</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/error.rb', line 126</span>
<span class='kw'>def</span> <span class='id identifier rubyid_backtrace'>backtrace</span>
<span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>if</span> <span class='kw'>super</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='kw'>return</span> <span class='kw'>super</span> <span class='kw'>if</span> <span class='id identifier rubyid_sass_backtrace'>sass_backtrace</span><span class='period'>.</span><span class='id identifier rubyid_all?'>all?</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_h'>h</span><span class='op'>|</span> <span class='id identifier rubyid_h'>h</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span><span class='rbrace'>}</span>
<span class='id identifier rubyid_sass_backtrace'>sass_backtrace</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_h'>h</span><span class='op'>|</span>
<span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_h'>h</span><span class='lbracket'>[</span><span class='symbol'>:filename</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>(sass)</span><span class='tstring_end'>&#39;</span></span><span class='embexpr_end'>}</span><span class='tstring_content'>:</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_h'>h</span><span class='lbracket'>[</span><span class='symbol'>:line</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span>
<span class='lparen'>(</span><span class='id identifier rubyid_h'>h</span><span class='lbracket'>[</span><span class='symbol'>:mixin</span><span class='rbracket'>]</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>:in `</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_h'>h</span><span class='lbracket'>[</span><span class='symbol'>:mixin</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'>&#39;</span><span class='tstring_end'>&quot;</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
<span class='kw'>end</span> <span class='op'>+</span> <span class='kw'>super</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="modify_backtrace-instance_method">
#<strong>modify_backtrace</strong>(attrs) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Modify the top Sass backtrace entries (that is, the most deeply nested
ones) to have the given attributes.</p>
<p>Specifically, this goes through the backtrace entries from most deeply
nested to least, setting the given attributes for each entry. If an entry
already has one of the given attributes set, the pre-existing attribute
takes precedence and is not used for less deeply-nested entries (even if
they don&#39;t have that attribute set).</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>attrs</span>
<span class='type'>(<tt>{Symbol =&gt; Object}</tt>)</span>
&mdash;
<div class='inline'>
<p>The information to add to the backtrace entry. See <span class='object_link'><a href="#sass_backtrace-instance_method" title="Sass::SyntaxError#sass_backtrace (method)">#sass_backtrace</a></span></p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
106
107
108
109
110
111
112
113
114
115</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/error.rb', line 106</span>
<span class='kw'>def</span> <span class='id identifier rubyid_modify_backtrace'>modify_backtrace</span><span class='lparen'>(</span><span class='id identifier rubyid_attrs'>attrs</span><span class='rparen'>)</span>
<span class='id identifier rubyid_attrs'>attrs</span> <span class='op'>=</span> <span class='id identifier rubyid_attrs'>attrs</span><span class='period'>.</span><span class='id identifier rubyid_reject'>reject</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_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span><span class='rbrace'>}</span>
<span class='comment'># Move backwards through the backtrace
</span> <span class='lparen'>(</span><span class='int'>0</span><span class='op'>...</span><span class='id identifier rubyid_sass_backtrace'>sass_backtrace</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span><span class='period'>.</span><span class='id identifier rubyid_reverse_each'>reverse_each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span>
<span class='id identifier rubyid_entry'>entry</span> <span class='op'>=</span> <span class='id identifier rubyid_sass_backtrace'>sass_backtrace</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span>
<span class='id identifier rubyid_sass_backtrace'>sass_backtrace</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_attrs'>attrs</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_entry'>entry</span><span class='rparen'>)</span>
<span class='id identifier rubyid_attrs'>attrs</span><span class='period'>.</span><span class='id identifier rubyid_reject!'>reject!</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_entry'>entry</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_k'>k</span><span class='rparen'>)</span><span class='rbrace'>}</span>
<span class='kw'>break</span> <span class='kw'>if</span> <span class='id identifier rubyid_attrs'>attrs</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="sass_backtrace_str-instance_method">
#<strong>sass_backtrace_str</strong>(default_filename = &quot;an unknown file&quot;) &#x21d2; <tt>String</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a string representation of the Sass backtrace.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>default_filename</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&quot;an unknown file&quot;</tt>)</em>
&mdash;
<div class='inline'>
<p>The filename to use for unknown files</p>
</div>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>String</tt>)</span>
</li>
</ul>
<p class="tag_title">See Also:</p>
<ul class="see">
<li><span class='object_link'><a href="#sass_backtrace-instance_method" title="Sass::SyntaxError#sass_backtrace (method)">#sass_backtrace</a></span></li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
140
141
142
143
144
145
146
147
148
149
150</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/error.rb', line 140</span>
<span class='kw'>def</span> <span class='id identifier rubyid_sass_backtrace_str'>sass_backtrace_str</span><span class='lparen'>(</span><span class='id identifier rubyid_default_filename'>default_filename</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>an unknown file</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_lines'>lines</span> <span class='op'>=</span> <span class='id identifier rubyid_message'>message</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_msg'>msg</span> <span class='op'>=</span> <span class='id identifier rubyid_lines'>lines</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='op'>+</span> <span class='id identifier rubyid_lines'>lines</span><span class='lbracket'>[</span><span class='int'>1</span><span class='op'>..</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span><span class='period'>.</span>
<span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span> <span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> </span><span class='tstring_end'>&quot;</span></span> <span class='op'>*</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Error: </span><span class='tstring_end'>&quot;</span></span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='id identifier rubyid_l'>l</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span>
<span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Error: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_msg'>msg</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span>
<span class='id identifier rubyid_sass_backtrace'>sass_backtrace</span><span class='period'>.</span><span class='id identifier rubyid_each_with_index'>each_with_index</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_entry'>entry</span><span class='comma'>,</span> <span class='id identifier rubyid_i'>i</span><span class='op'>|</span>
<span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_i'>i</span> <span class='op'>==</span> <span class='int'>0</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>on</span><span class='tstring_end'>&#39;</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>from</span><span class='tstring_end'>&#39;</span></span><span class='embexpr_end'>}</span><span class='tstring_content'> line </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_entry'>entry</span><span class='lbracket'>[</span><span class='symbol'>:line</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span>
<span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> of </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_entry'>entry</span><span class='lbracket'>[</span><span class='symbol'>:filename</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='id identifier rubyid_default_filename'>default_filename</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span>
<span class='lparen'>(</span><span class='id identifier rubyid_entry'>entry</span><span class='lbracket'>[</span><span class='symbol'>:mixin</span><span class='rbracket'>]</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>, in `</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_entry'>entry</span><span class='lbracket'>[</span><span class='symbol'>:mixin</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'>&#39;</span><span class='tstring_end'>&quot;</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
<span class='kw'>end</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="sass_filename-instance_method">
#<strong>sass_filename</strong> &#x21d2; <tt>String</tt><sup>?</sup>
</h3><div class="docstring">
<div class="discussion">
<p>The name of the file in which the exception was raised. This could be `nil`
if no filename is available.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>String</tt>, <tt>nil</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
65
66
67</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/error.rb', line 65</span>
<span class='kw'>def</span> <span class='id identifier rubyid_sass_filename'>sass_filename</span>
<span class='id identifier rubyid_sass_backtrace'>sass_backtrace</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='lbracket'>[</span><span class='symbol'>:filename</span><span class='rbracket'>]</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="sass_line-instance_method">
#<strong>sass_line</strong> &#x21d2; <tt>Integer</tt>
</h3><div class="docstring">
<div class="discussion">
<p>The line of the Sass template on which the error occurred.</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">
80
81
82</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/error.rb', line 80</span>
<span class='kw'>def</span> <span class='id identifier rubyid_sass_line'>sass_line</span>
<span class='id identifier rubyid_sass_backtrace'>sass_backtrace</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='lbracket'>[</span><span class='symbol'>:line</span><span class='rbracket'>]</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="sass_mixin-instance_method">
#<strong>sass_mixin</strong> &#x21d2; <tt>String</tt>
</h3><div class="docstring">
<div class="discussion">
<p>The name of the mixin in which the error occurred. This could be `nil` if
the error occurred outside a mixin.</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">
73
74
75</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/error.rb', line 73</span>
<span class='kw'>def</span> <span class='id identifier rubyid_sass_mixin'>sass_mixin</span>
<span class='id identifier rubyid_sass_backtrace'>sass_backtrace</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='lbracket'>[</span><span class='symbol'>:mixin</span><span class='rbracket'>]</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="to_s-instance_method">
#<strong>to_s</strong> &#x21d2; <tt>String</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns The error message</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>String</tt>)</span>
&mdash;
<div class='inline'>
<p>The error message</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
118
119
120</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/error.rb', line 118</span>
<span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span>
<span class='ivar'>@message</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Mon Oct 22 13:20:51 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>