The example presented here shows how one would use groc to create
an internationalized die-roll application:
$ roll
You rolled a one
$ roll
| #!/usr/bin/env python3 | |
| import os | |
| import tempfile | |
| import shutil | |
| import difflib | |
| from pathlib import Path | |
| # Define source and destination paths | |
| source = Path(__file__).resolve().parent | |
| dest = Path('/opt/X-Plane 12/Custom Scenery') |
| call plug#begin() | |
| Plug 'tomasr/molokai' | |
| Plug 'itchyny/lightline.vim' | |
| call plug#end() | |
| filetype plugin on | |
| set mouse=a |
| # .bashrc | |
| # Source global definitions | |
| if [ -f /etc/bashrc ]; then | |
| . /etc/bashrc | |
| fi | |
| # User specific environment | |
| if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:$HOME/code/tools/text-tools/bin" ]] | |
| then |
| #include <cheax.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| int main(void) | |
| { | |
| int result; | |
| CHEAX *c = cheax_init(); |
| %code requires { | |
| #include "types.h" | |
| #include <stddef.h> | |
| #include <stdio.h> | |
| } | |
| %code { | |
| int yylex(); | |
| void yyerror(ASTFileElement **f, const char *msg); | |
| } |
| use v6; | |
| unit module CTokens; | |
| grammar CTokens::Token is export { | |
| token TOP { | |
| [ | |
| <preproc> | | |
| <comment> | | |
| <line-comment> | |
| antonijn, 2017 | |
| ___ _ _ _ _ | |
| |_ _|_ _| |_ _ _ ___ __| |_ _ __| |_(_)___ _ _ | |
| | || ' \ _| '_/ _ \/ _` | || / _| _| / _ \ ' \ | |
| |___|_||_\__|_| \___/\__,_|\_,_\__|\__|_\___/_||_| | |
| Because all other text editors suck (although |
| $ ./cheaky | |
| > (let i 0) | |
| > i | |
| 0 | |
| > (let j 10) | |
| > j | |
| 10 | |
| > (let k j) | |
| > k | |
| 10 |