This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[1] Root ::= Body? | |
[2] Body ::= Line ( TERMINATOR Line | TERMINATOR )* | |
[3] Line ::= Expression | |
| Statement | |
[4] Statement | |
::= Return | |
| Comment | |
| STATEMENT | |
[5] Expression | |
::= Value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Dexter do | |
use Application | |
@port 7400 | |
def start(_type, _args) do | |
import Supervisor.Spec, warn: false | |
port = case _args[:port] do | |
nil -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, _} -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Dexter do | |
use Application | |
@port 7400 | |
def start(_, port \\ @port) do | |
import Supervisor.Spec, warn: false | |
children = [ | |
worker(Reagent, [Dexter.Server, [port: port]], []) |