Skip to content

Instantly share code, notes, and snippets.

@mynameislau
Last active April 21, 2017 13:14
Show Gist options
  • Save mynameislau/6adcfa968e48d71692609e245c09f33b to your computer and use it in GitHub Desktop.
Save mynameislau/6adcfa968e48d71692609e245c09f33b to your computer and use it in GitHub Desktop.
# ne marche pas : erg*gregre**gregre*
main -> stuff
stuff -> delimitedStuff
| textStuff
textStuff -> text delimited textStuff
| text
| null
delimitedStuff -> delimited stuff
| delimited
| null
delimited -> ita
any -> delimited | text
ita -> "*" text "*" {% ita %}
text -> [^*]:+ {% text %}
@{%
const typed = (type) => (data) => ({ type, data})
const dataToString = data => data.join('').split(',').join('');
const ita = (data, location, reject) => {
return `<i>${dataToString(data)}</i>`;
}
const text = (data, location, reject) => {
return `<p>${dataToString(data)}</p>`;
}
%}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment