Skip to content

Instantly share code, notes, and snippets.

View chmaynard's full-sized avatar

Craig H Maynard chmaynard

View GitHub Profile
@PRBorges
PRBorges / diff.ebnf
Last active January 21, 2025 12:34
A grammar for diff output in normal, unified, and git formats
(* EBNF grammar for diff output in normal, unified, and git formats *)
(* Author: Pedro R. Borges *)
(* Read the accompanying article at https://www.prborges.com/2023/grammar-for-diff-output *)
diff = emptyDiff | normalDiff | uniDiff | gitDiff ;
(* 1. Empty diff *)
emptyDiff = "" ;