Skip to content

Instantly share code, notes, and snippets.

View Aerijo's full-sized avatar

Benjamin Gray Aerijo

View GitHub Profile
@Aerijo
Aerijo / example.tex
Last active January 16, 2021 08:43
LaTeX commands for Hoare logic
\documentclass[a4paper]{article}
\input{./hoare.tex}
\begin{document}
\begin{hoare}
\heq[a]{m * (a-b) > 0}{n := a-b}{m * n > 0}{\A}
\heq[b]{1 * (a-b) > 0}{m := 1}{m * (a-b) > 0}{\A}
\heq[c]{a > b}{m := 1}{m * (a-b) > 0}{\PrE(b)}
\heq[d]{a > b}{m := 1; n := a-b}{m * n > 0}{\Seq(c, a)}
\end{hoare}
@Aerijo
Aerijo / README.md
Created April 11, 2023 12:13
PowerPC ISA 3.1B Instructions

isa.json (v1)

These instructions were extracted from the public PowerPC 3.1B ISA (September 14, 2021).

More work to follow on extracting the descriptions with correct fomatting and fix any issues found in the current data.

@Aerijo
Aerijo / latex_in_atom.md
Last active July 31, 2023 09:31
Setting up Atom for LaTeX

Disclaimer: I wrote the packages language-latex2e, autocomplete-latex, latex-wordcount, and hyperclick-latex. I still try to provide a list of all useful packages though, so let me know if I have missed one.

This is a general guide for how to get started with LaTeX in Atom.

NOTE: This guide assumes you already have LaTeX installed on your computer. If you do not, I recommend TeX Live.

@Aerijo
Aerijo / making_language_grammar.md
Last active March 18, 2024 05:03
Guide to writing an Atom language grammar

A guide to writing a language grammar (TextMate) in Atom

Tree sitter

  • Atom is transitioning to an entirely new way of defining grammars using tree-sitter. This will be enabled by default quite soon now. It is theoretically faster and more powerful than regex based grammars (the one described in this guide), but requires a steeper learning curve. My understanding is that regex based grammars will still be supported however (at least until version 2), so this guide can still be useful. To enable it yourself, go to Settings -> Core and check Use Tree Sitter Parsers

Links for tree-sitter help:

@Aerijo
Aerijo / tree_sitter_guide.md
Last active March 30, 2024 15:19
Guide to writing your first Tree-sitter grammar

Guide to your first Tree-sitter grammar

NOTE: The Tree-sitter API and documentation has changed and improved since this guide was created. I can't guarantee this is up to date.

About

Tree-sitter is the new way Atom is providing language recognition features, such as syntax highlighting, code folding, autocomplete, and more. In contrast to TextMate grammars, which work by regex matching, Tree-sitter will generate an entire syntax tree. But more on that can be found in it's own docs.

Here, we look at making one from scratch.