yabeenico / concat

concat notation - an implementation of rfc9402

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Description

An implementation of rfc9402.

Supported notations (See Examples below):

  • <>: grouping
  • /: over
  • *: multiple
  • +: next
  • (): round container
  • {}: soft container
  • []: square container
  • @: ball
  • tac: reverse cat
  • cat: cat

BNF:

concat    :  cat | ball | container | brace | paren | adjacent | multiple | over | group
group      :  "<" concat ">"
over      :  concat [ "/" concat ]
multiple  :  concat "*" /[0-9]+/
adjacent  :  concat [ "+" concat ]
paren     :  "(" [ concat ] ")"
brace     :  "{" [ concat ] "}"
container :  "[" [ concat ] "]"
ball      :  "@"
tac       :  "tac"
cat       :  "cat"

Installation

$ git clone https://github.com/yabeenico/concat.git
$ cd concat/
$ pip3 install -r requirements.txt
$ ./concat.py 'cat'
 /\    /
(' )  (
 (  \  )
 |(__)/

Examples

$ ./concat.py 'cat'
 /\    /
(' )  (
 (  \  )
 |(__)/

$ ./concat.py '[cat]'
 --------
| /\    /|
|(' )  ( |
| (  \  )|
| |(__)/ |
 --------

$ ./concat.py 'cat + cat'
 /\    /  /\    /
(' )  (  (' )  (
 (  \  )  (  \  )
 |(__)/   |(__)/

$ ./concat.py 'cat / cat'
 /\    /
(' )  (
 (  \  )
 |(__)/
 /\    /
(' )  (
 (  \  )
 |(__)/

$ ./concat.py '<(tac * 2) + {@ + cat}> / [cat]'
  ~~~~~~~~~~~~~~~~~     -----------------
 (\    /\  \    /\ )   /          /\    /\
(  )  ( ')  )  ( ') ) /          (' )  (  |
( (  /  )  (  /  )  ) |    __     (  \  ) |
 ( \(__)|   \(__)| )   \ _/  \_@  |(__)/  |
  ~~~~~~~~~~~~~~~~~     \________________/
 --------
| /\    /|
|(' )  ( |
| (  \  )|
| |(__)/ |
 --------

License

MIT

About

concat notation - an implementation of rfc9402


Languages

Language:Python 100.0%