Skip to content

Commit

Permalink
Deploying to gh-pages from @ cff462f 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
oxisto committed Dec 1, 2023
1 parent aee5001 commit fd129eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<div class="cover ">
<h1 class="cover"><span>code</span><wbr><span><span>Of</span></span></h1>
</div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":cpg-language-python:dokkaHtmlPartial/main"><div class="symbol monospace"><span class="token keyword">open </span><span class="token keyword">override </span><span class="token keyword">fun </span><a href="code-of.html"><span class="token function">codeOf</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">astNode<span class="token operator">: </span><a href="../-python/-a-s-t/index.html">Python.AST</a></span></span><span class="token punctuation">)</span><span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token operator">?</span></div></div></div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":cpg-language-python:dokkaHtmlPartial/main"><div class="symbol monospace"><span class="token keyword">open </span><span class="token keyword">override </span><span class="token keyword">fun </span><a href="code-of.html"><span class="token function">codeOf</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">astNode<span class="token operator">: </span><a href="../-python/-a-s-t/index.html">Python.AST</a></span></span><span class="token punctuation">)</span><span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token operator">?</span></div><p class="paragraph">This functions extracts the source code from the input file given a location. This is a bit tricky in Python, as indents are part of the syntax. We also don't want to include leading whitespaces/tabs in case of extracting a nested code fragment. Thus, we use the following approximation to retrieve the fragment's source code:</p><ol><li><p class="paragraph">Get the relevant source code lines</p></li><li><p class="paragraph">Delete extra code at the end of the last line that is not part of the provided location</p></li><li><p class="paragraph">Remove trailing whitespaces / tabs</p></li></ol></div></div>
</div>
<div class="footer">
<span class="go-to-top-icon"><a href="#content" id="go-to-top-link"></a></span><span>© 2023 Copyright</span><span class="pull-right"><span>Generated by </span><a href="https://github.com/Kotlin/dokka"><span>dokka</span><span class="padded-icon"></span></a></span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ <h2 class="">Functions</h2>
</span></span></div>
<div>
<div class="title">
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":cpg-language-python:dokkaHtmlPartial/main"><div class="symbol monospace"><span class="token keyword">open </span><span class="token keyword">override </span><span class="token keyword">fun </span><a href="code-of.html"><span class="token function">codeOf</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">astNode<span class="token operator">: </span><a href="../-python/-a-s-t/index.html">Python.AST</a></span></span><span class="token punctuation">)</span><span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token operator">?</span></div></div></div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":cpg-language-python:dokkaHtmlPartial/main"><div class="symbol monospace"><span class="token keyword">open </span><span class="token keyword">override </span><span class="token keyword">fun </span><a href="code-of.html"><span class="token function">codeOf</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">astNode<span class="token operator">: </span><a href="../-python/-a-s-t/index.html">Python.AST</a></span></span><span class="token punctuation">)</span><span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token operator">?</span></div><div class="brief "><p class="paragraph">This functions extracts the source code from the input file given a location. This is a bit tricky in Python, as indents are part of the syntax. We also don't want to include leading whitespaces/tabs in case of extracting a nested code fragment. Thus, we use the following approximation to retrieve the fragment's source code:</p></div></div></div>
</div>
</div>
</div>
Expand Down

0 comments on commit fd129eb

Please sign in to comment.