Skip to content

Commit

Permalink
build based on e4aa2d3
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Jul 1, 2023
1 parent a403fbf commit 8fa2a2a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions previews/PR322/api/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion previews/PR322/design/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@
d)</code></pre><p>But not always!</p><pre><code class="language-julia hljs">f(a,
g(b,
c # -- missing closing `,` ?
d))</code></pre><p>Another particularly difficult problem for diagnostics in the current system is broken parentheses or double quotes in string interpolations, especially when nested.</p><h1 id="Fun-research-questions"><a class="docs-heading-anchor" href="#Fun-research-questions">Fun research questions</a><a id="Fun-research-questions-1"></a><a class="docs-heading-anchor-permalink" href="#Fun-research-questions" title="Permalink"></a></h1><h3 id="Parser-Recovery"><a class="docs-heading-anchor" href="#Parser-Recovery">Parser Recovery</a><a id="Parser-Recovery-1"></a><a class="docs-heading-anchor-permalink" href="#Parser-Recovery" title="Permalink"></a></h3><p>Can we learn fast and reasonably accurate recovery heuristics for when the parser encounters broken syntax, rather than hand-coding these? How would we set the parser up so that training works and injecting the model is nonintrusive? If the model is embedded in and works together with the parser, can it be made compact enough that training is fast and the model itself is tiny?</p><h3 id="Formatting"><a class="docs-heading-anchor" href="#Formatting">Formatting</a><a id="Formatting-1"></a><a class="docs-heading-anchor-permalink" href="#Formatting" title="Permalink"></a></h3><p>Given source and syntax tree, can we regress/learn a generative model of indentation from the syntax tree? Source formatting involves a big pile of heuristics to get something which &quot;looks nice&quot;... and ML systems have become very good at heuristics. Also, we&#39;ve got huge piles of training data — just choose some high quality, tastefully hand-formatted libraries.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../api/">« API Reference</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.24 on <span class="colophon-date" title="Saturday 1 July 2023 17:49">Saturday 1 July 2023</span>. Using Julia version 1.9.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
d))</code></pre><p>Another particularly difficult problem for diagnostics in the current system is broken parentheses or double quotes in string interpolations, especially when nested.</p><h1 id="Fun-research-questions"><a class="docs-heading-anchor" href="#Fun-research-questions">Fun research questions</a><a id="Fun-research-questions-1"></a><a class="docs-heading-anchor-permalink" href="#Fun-research-questions" title="Permalink"></a></h1><h3 id="Parser-Recovery"><a class="docs-heading-anchor" href="#Parser-Recovery">Parser Recovery</a><a id="Parser-Recovery-1"></a><a class="docs-heading-anchor-permalink" href="#Parser-Recovery" title="Permalink"></a></h3><p>Can we learn fast and reasonably accurate recovery heuristics for when the parser encounters broken syntax, rather than hand-coding these? How would we set the parser up so that training works and injecting the model is nonintrusive? If the model is embedded in and works together with the parser, can it be made compact enough that training is fast and the model itself is tiny?</p><h3 id="Formatting"><a class="docs-heading-anchor" href="#Formatting">Formatting</a><a id="Formatting-1"></a><a class="docs-heading-anchor-permalink" href="#Formatting" title="Permalink"></a></h3><p>Given source and syntax tree, can we regress/learn a generative model of indentation from the syntax tree? Source formatting involves a big pile of heuristics to get something which &quot;looks nice&quot;... and ML systems have become very good at heuristics. Also, we&#39;ve got huge piles of training data — just choose some high quality, tastefully hand-formatted libraries.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../api/">« API Reference</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.24 on <span class="colophon-date" title="Saturday 1 July 2023 21:10">Saturday 1 July 2023</span>. Using Julia version 1.9.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion previews/PR322/howto/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>How To · JuliaSyntax.jl</title><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">JuliaSyntax.jl</a></span></div><form class="docs-search" action="../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../">Overview</a></li><li class="is-active"><a class="tocitem" href>How To</a><ul class="internal"><li><a class="tocitem" href="#Use-JuliaSyntax-as-the-default-parser"><span>Use JuliaSyntax as the default parser</span></a></li></ul></li><li><span class="tocitem">Reference</span><ul><li><a class="tocitem" href="../reference/">Syntax Trees</a></li><li><a class="tocitem" href="../api/">API Reference</a></li></ul></li><li><a class="tocitem" href="../design/">Design Discussion</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>How To</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>How To</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/JuliaLang/JuliaSyntax.jl/blob/main/docs/src/howto.md#L" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="How-To"><a class="docs-heading-anchor" href="#How-To">How-To</a><a id="How-To-1"></a><a class="docs-heading-anchor-permalink" href="#How-To" title="Permalink"></a></h1><p>This section contains brief recipes for particular tasks</p><h2 id="Use-JuliaSyntax-as-the-default-parser"><a class="docs-heading-anchor" href="#Use-JuliaSyntax-as-the-default-parser">Use JuliaSyntax as the default parser</a><a id="Use-JuliaSyntax-as-the-default-parser-1"></a><a class="docs-heading-anchor-permalink" href="#Use-JuliaSyntax-as-the-default-parser" title="Permalink"></a></h2><p>To use JuliaSyntax as the default Julia parser for the REPL and to <code>include()</code> files, parse code with <code>Meta.parse()</code>, etc, put the following in your startup.jl file:</p><pre><code class="language-julia hljs">using JuliaSyntax
JuliaSyntax.enable_in_core!()</code></pre><p>This works well in Julia 1.9 but in Julia 1.8 will cause some startup latency. To reduce that you can create a custom system image by running the code in <code>./sysimage/compile.jl</code> as a Julia script (or directly using the shell, on unix). Then use <code>julia -J $resulting_sysimage</code>.</p><p>Using a custom sysimage has the advantage that package precompilation will also go through the JuliaSyntax parser.</p><h3 id="VSCode"><a class="docs-heading-anchor" href="#VSCode">VSCode</a><a id="VSCode-1"></a><a class="docs-heading-anchor-permalink" href="#VSCode" title="Permalink"></a></h3><p>To use JuliaSyntax as the default parser for Julia within VSCode, add the following to your <code>startup.jl</code> file:</p><pre><code class="language-julia hljs">import JuliaSyntax
JuliaSyntax.enable_in_core!()</code></pre><p>To reduce startup latency you can combine with a custom system as described in the <a href="https://www.julia-vscode.org/docs/dev/userguide/compilesysimage/#Creating-a-sysimage-for-the-active-environment">Julia VScode docs</a>, combined with the precompile execution file in <code>sysimage/precompile_exec.jl</code> in the source tree. For additional detail see the discussion in <a href="https://github.com/JuliaLang/JuliaSyntax.jl/issues/128">issue #128</a>.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Overview</a><a class="docs-footer-nextpage" href="../reference/">Syntax Trees »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.24 on <span class="colophon-date" title="Saturday 1 July 2023 17:49">Saturday 1 July 2023</span>. Using Julia version 1.9.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
JuliaSyntax.enable_in_core!()</code></pre><p>To reduce startup latency you can combine with a custom system as described in the <a href="https://www.julia-vscode.org/docs/dev/userguide/compilesysimage/#Creating-a-sysimage-for-the-active-environment">Julia VScode docs</a>, combined with the precompile execution file in <code>sysimage/precompile_exec.jl</code> in the source tree. For additional detail see the discussion in <a href="https://github.com/JuliaLang/JuliaSyntax.jl/issues/128">issue #128</a>.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Overview</a><a class="docs-footer-nextpage" href="../reference/">Syntax Trees »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.24 on <span class="colophon-date" title="Saturday 1 July 2023 21:10">Saturday 1 July 2023</span>. Using Julia version 1.9.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion previews/PR322/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@
7:7 │ ) &quot;)&quot;
8:8 │ * ✔ &quot;*&quot;
9:9 │ Identifier ✔ &quot;z&quot;</code></pre><p>Julia <code>Expr</code> can also be produced:</p><pre><code class="language-julia hljs">julia&gt; JuliaSyntax.parsestmt(Expr, &quot;(x + y)*z&quot;)
:((x + y) * z)</code></pre></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="howto/">How To »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.24 on <span class="colophon-date" title="Saturday 1 July 2023 17:49">Saturday 1 July 2023</span>. Using Julia version 1.9.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
:((x + y) * z)</code></pre></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="howto/">How To »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.24 on <span class="colophon-date" title="Saturday 1 July 2023 21:10">Saturday 1 July 2023</span>. Using Julia version 1.9.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion previews/PR322/reference/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@
│ ├─ 1
│ ├─ :c
│ └─ :d
└─ :x</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../howto/">« How To</a><a class="docs-footer-nextpage" href="../api/">API Reference »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.24 on <span class="colophon-date" title="Saturday 1 July 2023 17:49">Saturday 1 July 2023</span>. Using Julia version 1.9.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
└─ :x</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../howto/">« How To</a><a class="docs-footer-nextpage" href="../api/">API Reference »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.24 on <span class="colophon-date" title="Saturday 1 July 2023 21:10">Saturday 1 July 2023</span>. Using Julia version 1.9.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 8fa2a2a

Please sign in to comment.