Skip to content

Instantly share code, notes, and snippets.

[1] Root ::= Body?
[2] Body ::= Line ( TERMINATOR Line | TERMINATOR )*
[3] Line ::= Expression
| Statement
[4] Statement
::= Return
| Comment
| STATEMENT
[5] Expression
::= Value
#!/usr/bin/env ruby
$:.unshift File.dirname(__FILE__)
$:.unshift File.expand_path("./lib")
$:.unshift File.expand_path("./lib/ebnf")
require 'ebnf'
ebnf = EBNF.parse(File.open("/opt/coffee2-mode/grammar.js.out.ebnf"))
puts ebnf.to_ebnf
defmodule Dexter do
use Application
@port 7400
def start(_type, _args) do
import Supervisor.Spec, warn: false
port = case _args[:port] do
nil ->
defmodule Dexter do
use Application
@port 7400
def start(_ \\ nil, port \\ @port) do
import Supervisor.Spec, warn: false
children = [
worker(Reagent, [Dexter.Server, [port: port]])
(defun elixir-smie--semi-ends-match ()
"Return non-nil if the current line concludes a match block."
(save-excursion
;; Warning: Recursion.
;; This is easy though.
;; 1. If we're at a blank line, move forward a character. This takes us to
;; the next line.
;; 2. If we're not at the end of the buffer, call this function again.
;; (Otherwise, return nil.)
(defun elixir-smie--semi-ends-match ()
"Return non-nil if the current line concludes a match block."
(save-excursion
;; Warning: Recursion.
;; This is easy though.
;; 1. If we're at a blank line, move forward a character. This takes us to
;; the next line.
;; 2. If we're not at the end of the buffer, call this function again.
;; (Otherwise, return nil.)
(defun elixir-smie--in-match-block ()
(save-excursion
(let ((start (point)))
(search-backward-regexp elixir-smie--block-operator-regexp)
;; `here' is the point of the first character in `->'.
(let ((here (point)))
;; Local Variables:
;; whitespace-action: nil
;; End:
(defmacro* elixir-def-indentation-test (name args initial-contents expected-output)
(declare (indent 2))
`(elixir-deftest ,name ,args
(elixir-ert-with-test-buffer (:name ,(format "(Expected)" name))
,initial-contents
(let ((indented (ert-buffer-string-reindented)))
def init(conn) do
Process.flag :trap_exit, true
{ip, port} = conn |> Socket.remote!
host = case Socket.Host.by_address(ip) do
{:ok, _host} ->
_host.name
{:error, _} ->
defmodule Dexter do
use Application
@port 7400
def start(_, port \\ @port) do
import Supervisor.Spec, warn: false
children = [
worker(Reagent, [Dexter.Server, [port: port]], [])