[
  {
    "path": ".github/workflows/main.yml",
    "content": "name: website\n\non: [push]\n#on:\n#  push:\n#    tags:\n#      - 'v*.*.*'\n\njobs:\n  publish:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v1\n      - name: Set output\n        id: vars\n        run: |\n          echo \"::set-output name=tag::${GITHUB_REF:10}\"\n          echo \"::set-output name=sha::$(git rev-parse HEAD)\"\n      - name: Cache choosenim\n        id: cache-choosenim\n        uses: actions/cache@v1\n        with:\n          path: ~/.choosenim\n          key: ${{ runner.os }}-choosenim-stable\n      - name: Cache nimble\n        id: cache-nimble\n        uses: actions/cache@v1\n        with:\n          path: ~/.nimble\n          key: ${{ runner.os }}-nimble-stable\n      - uses: jiro4989/setup-nim-action@v1.0.2\n        with:\n          nim-version: 'stable'\n      - name: Build and test\n        run: |\n          nimble build -Y\n          #nimble test -Y\n      - name: Build doc\n        env:\n          RELEASE_COMMIT: ${{ steps.vars.outputs.sha }}\n        run: |\n          nimble doc --git.url:https://github.com/$GITHUB_REPOSITORY --git.commit:$RELEASE_COMMIT src/nicy.nim\n          nimble doc --git.url:https://github.com/$GITHUB_REPOSITORY --git.commit:$RELEASE_COMMIT src/nicypkg/functions.nim\n          # Deploying documentation of the latest version.\n          mkdir -p ./public\n          mv nicy.html functions.html nimdoc.out.css ./public/\n          cd ./public/\n          ln -s ./nicy.html index.html\n      - name: Deploy\n        if: success()\n        uses: crazy-max/ghaction-github-pages@v1.3.0\n        with:\n          target_branch: gh-pages\n          build_dir: ./public\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n"
  },
  {
    "path": ".gitignore",
    "content": "nicy\nexamples/fish\nexamples/pure\nexamples/simple\nexamples/test\nexamples/power\n*.html\n*.css"
  },
  {
    "path": ".travis.yml",
    "content": "language: c\n\ncache: ccache\ncache:\n    directories:\n        - .cache\n\nmatrix:\n    include:\n        - os: linux\n          env: CHANNEL=stable\n          compiler: gcc\n\n        - os: linux\n          env: CHANNEL=devel\n          compiler: gcc\n\n        - os: osx\n          env: CHANNEL=stable\n          compiler: clang\n\n    allow_failures:\n        - env: CHANNEL=devel\n        - os: osx\n\n    fast_finish: true\n\nenv:\n    global:\n        - PROGNAME=\"$(basename ${TRAVIS_BUILD_DIR})\"\n        - NIMFILE=\"src/${PROGNAME}.nim\"\n        - BINFILE=\"src/${PROGNAME}\"\n        - ASSETFILE=\"${PROGNAME}-${TRAVIS_TAG}-linux64\"\n\ninstall:\n    - export CHOOSENIM_NO_ANALYTICS=1\n    - curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh\n    - sh init.sh -y\n    - export PATH=~/.nimble/bin:$PATH\n    - echo \"export PATH=~/.nimble/bin:$PATH\" >> ~/.profile\n    - choosenim $CHANNEL\n\nscript:\n    - cd \"${TRAVIS_BUILD_DIR}\"\n    - nim c \"${NIMFILE}\" \n    - \"${BINFILE}\" \n\nbefore_deploy:\n    - cd \"${TRAVIS_BUILD_DIR}\"\n    - cp \"${BINFILE}\" \"${ASSETFILE}\"\ndeploy:\n    provider: releases\n    api_key: \"${GITHUB_OAUTH_TOKEN}\"\n    file: \"${ASSETFILE}\"\n    skip_cleanup: true\n    on:\n        tags: true\n"
  },
  {
    "path": "examples/config.nims",
    "content": "switch(\"path\", \"$projectDir/../src\")\n"
  },
  {
    "path": "examples/fish.nim",
    "content": "# fish’s default prompt '~>'\n\nimport nicy, strformat\n\nlet\n  prompt = color(\"> \", green)\n  tilde = tilde(getCwd())\n\necho fmt\"{tilde}{prompt}\"\n"
  },
  {
    "path": "examples/power.nim",
    "content": "# power by @xyb\nimport\n  nicypkg/functions,\n  strformat\n\nlet\n  prompt = uidsymbol(root = color(\"#\", fg = red, bg = white),\n                     user = color(\"$\", green))\n  nl = \"\\n\"\n  cwd = color(tilde(getCwd()), cyan)\n\n  ahead = color(\"⬆ \", yellow)\n  behind = color(\"⬇ \", yellow)\n  untracked = color(\"?\", yellow)\n  changed = color(\"✎\", yellow)\n  staged = color(\"✔ \", yellow)\n  conflicted = color(\"✼\", yellow)\n  stash = color(\"⎘\", yellow)\n\n  gs = newGitStats()\n  gitStatus = gs.status(ahead, behind, untracked, changed, staged,\n    conflicted, stash)\n  gitBranch = color(gs.branch(), yellow)\n  git = gitBranch & gitStatus\n\n# the prompt\necho fmt\"{nl}{virtualenv()}{cwd}{git}{nl}{prompt} \"\n"
  },
  {
    "path": "examples/pure.nim",
    "content": "# pure by @sindresorhus (kinda)\n\nimport nicy, strformat\n\nlet\n  prompt = color(\"❯ \", magenta)\n  tilde = color(tilde(getCwd()), cyan)\n  git = color(gitBranch() & gitStatus(\"*\", \"\"), red)\n  nl = \"\\n\"\n\necho fmt\"{nl}{tilde}{git}{nl}{prompt}\"\n"
  },
  {
    "path": "examples/simple.nim",
    "content": "# ‘user@host $’ prompt\n\nimport nicy, strformat\n\nlet\n  user = color(user(), green)\n  host = color(host(), red)\n  prompt = color(\"$ \", cyan)\n  at = color(\"@\", yellow)\n\necho fmt\"{user}{at}{host} {prompt}\"\n"
  },
  {
    "path": "examples/test.nim",
    "content": "import nicy, strformat\n\nlet\n  prompt = uidsymbol(\"#\", \"$\")\n  nl = \"\\n\"\n\necho fmt\"{nl}{prompt}\"\n"
  },
  {
    "path": "license",
    "content": "MIT License\n\nCopyright (c) 2018 Anirudh Oppiliappan <icyph0x@pm.me>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "nicy.nimble",
    "content": "# Package\n\nversion       = \"2.5.1\"\nauthor        = \"Anirudh\"\ndescription   = \"A nice and icy ZSH prompt in Nim\"\nlicense       = \"MIT\"\nsrcDir        = \"src\"\ninstallExt    = @[\"nim\"]\nbin           = @[\"nicy\"]\n\n\n# Dependencies\n\nrequires \"nim >= 0.18.0\"\n"
  },
  {
    "path": "readme.md",
    "content": "<h1 align=\"center\">                                                              \n    <img src=\"https://x.icyphox.sh/5DyAD.png\" width=\"280\">                            \n</h1>\n\n> A nice and icy zsh and bash prompt in Nim\n\n[![Build Status](https://travis-ci.org/icyphox/nicy.svg?branch=master)](https://travis-ci.org/icyphox/nicy)\n\n![scrot](https://x.icyphox.sh/SltdI.png)\n\n### Why?\nI’ve always wanted to minimize my reliance on frameworks like [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh), so I figured, why not write my own ZSH prompt in my new favourite language? Turned out to be a really fun exercise.\n\n### Highlights\n- Written in Nim 👑\n- Fast (in theory, since Nim compiles to C)\n- Pretty defaults.\n- Plugin-like system for prompt customization, in case you didn’t like the pretty defaults.\n- Support both zsh and bash.\n- Fun, I guess.\n\n## Installation\n**Note**: It’s probably a good idea to uninstall `oh-my-zsh`, or any other plugin framework you’re using\naltogether. It may cause conflicts.\n\n```console\n$ nimble install nicy\n```\n\nDon’t know what that is? New to Nim? Check out the Nim [docs](https://nim-lang.org/documentation.html). `nimble` is packaged with Nim by default.  \n\n## Quick start\nAdd this to your `~/.zshrc`. If you installed via `nimble`, set `PROMPT` to `$(~/.nimble/bin/nicy)`.\n\n```zsh\nautoload -Uz add-zsh-hook\n_nicy_prompt() {\n\tPROMPT=$(\"/path/to/nicy\")\n}\nadd-zsh-hook precmd _nicy_prompt\n```\nMake sure you disable all other themes.\n\nNicy supports BASH also, and you could simply add it to your `~/.bashrc` or `~/.bash_profile`:\n```bash\nfunction nicy_prompt_command {\n    PS1=$(/path/to/nicy)\n}\nPROMPT_COMMAND=\"nicy_prompt_command\"\n```\n\n## Configuration\nIf you want to configure `nicy` as it is, you’ll have to edit the `src/nicy.nim` file and recompile. Messy, I know.\n\n### Build your own prompt\nAlternatively, you can just as easily write your own prompt in Nim using `nicy`’s built-in API. Refer to the [Examples](#Examples) section for some insight.\n\nOnce you’re done, compile it and add a similar function to your `.zshrc` as above, replacing `PROMPT` with the path to your own binary.\n\n### Examples\n\n```nim\n# ‘user@host $’ prompt\n\nimport nicy, strformat\n\nlet\n  user = color(user(), green)\n  host = color(host(), red)\n  prompt = color(\"$ \", cyan)\n  at = color(\"@\", yellow)\n\necho fmt\"{user}{at}{host} {prompt}\"\n```\n\n```nim\n# fish’s default prompt '~>'\n\nimport nicy, strformat\n\nlet\n  prompt = color(\"> \", green)\n  tilde = tilde(getCwd())\n\necho fmt\"{tilde}{prompt}\"\n```\n\n```nim\n# pure by @sindresorhus (kinda)\n\nimport nicy, strformat\n\nlet\n  prompt = color(\"❯ \", magenta)\n  tilde = color(tilde(getCwd()), cyan)\n  git = color(gitBranch() & gitStatus(\"*\", \"\"), red)\n  nl = \"\\n\"\n\necho fmt\"{tilde}{git}{nl}{prompt}\"\n```\n\n```nim\n# switching by return code\n\nimport nicy, strformat\n\nlet\n  prompt = returnCondition(ok = \"👍\", ng = \"👎\") & \" \"\n  tilde = color(tilde(getCwd()), cyan)\n  git = color(gitBranch() & gitStatus(\"*\", \"\"), red)\n  nl = \"\\n\"\n\necho fmt\"{tilde}{git}{nl}{prompt}\"\n# ~ master\n# 👍 \n```\n\nIf you like to know more details about git status, you may want to try the following powerful example which is including the number of untracked, modified, staged, conflicted and the number of commits your local branch is ahead, behind, etc:\n```\nnim c -d:release examples/power.nim\n```\n\n### API\n\n**`zeroWidth(s: string): string`**  \nReturns the given string wrapped in zsh zero-width codes. Useful for prompt alignment and cursor positioning.  \nAll procs below return strings wrapped by this.\n\n**`foreground(s: string, color: Color): string`**  \nReturns the given string, colorized.  \nPossible colors are `black`, `red`, `green`, `blue`, `cyan`, `yellow`, `magenta`, `white`.\n\n**`background(s, color: string): string`**  \nReturns the given string with its background colorized.  \nSame possible colors as above.\n\n**`bold(s: string): string`**  \nMakes the given string bold.\n\n**`underline(s: string): string`**  \nAdds an underline to the given string.\n\n**`italics(s: string): string`**  \nItalicizes the given text. **May not work in some terminal emulators!**\n\n**`reverse(s: string): string`**  \nSwaps the foreground/background colors for the given string.\n\n**`reset(s: string): string`**  \nResets all attributes. Useful for disabling all styling.\n\n**`color*(s: string, fg, bg = Color.none, b, u, r = false): string`**  \nConvenience proc that sets all attributes to a given string.  \n`fg`: foreground, `bg`: background, `b`: bold, `u`: underline, `r`: reverse\n\n**`horizontalRule(c: char): string`**  \nReturns a string of characters `c`, having the length of the current terminal width. Useful for positioning right-side prompts.\n\n**`tilde(path: string): string`**  \nIf `path` starts with `/home/user`, it is replaced by a `~/`.\n\n**`getCwd(): string`**  \nReturns the full path of the current working directory, or returns the string `[not found]` if current path doesn’t exist. (eg: `rm -rf ../curpath`)\n\n**`virtualenv(): string`**  \nReturns the current virtualenv name if in one.\n\n**`gitBranch(): string`**  \nReturns the current git branch, if in a git directory.\n\n**`gitStatus(dirty, clean: string): string`**  \nReturns either `dirty` or `clean` if in a git repository. For example, return `•` if clean and `×` if dirty.\n\n**`user(): string`**  \nReturns the current username.\n\n**`host(): string`**  \nReturns the current hostname.\n\n**`returnCondition*(ok: string, ng: string, delimiter = \".\"): string`**  \nIf the return code is `0` then returns `ok` string, otherwise `ng`.\n\n**`returnCondition*(ok: proc(): string, ng: proc(): string, delimiter = \".\"): string`**  \nReturns result of `ok` proc or `ng` proc.\nIf the return code is `0` then this proc calls `ok` proc, otherwise calls `ng` proc.\n\n**`shellName*: string`**\nContains the name of shell in which your prompt progoram is running.\nCurrently it may be `zsh` or `bash`. \nYou can specify it during compilation using the switch `-d:zsh` or `-d:bash`, or you can let the program detect it automatically, which may slow it down by a few milliseconds.\n\n#### GitStats API\n\n**`newGitStats*(): GitStats`**  \nReturns a `GitStats` object which contains the name of the local branch, the name of remote reference, number of commits your local branch is ahead or behind remote ref, number of untracked, modified, staged, conflicted, and the number of stashed changes. \n\n**`branch*(gs: GitStats, detachedPrefix = \"\", postfix = \" \"): string`**  \nReturns the current git branch name.\n\n**`status*(gs: GitStats, ahead, behind, untracked, changed, staged, conflicted, stash: string, separator, postfix = \" \"): string`**  \nReturns the git status string.\n\n**`dirty*(gs: GitStats): bool`**  \nReturns whether the current directory has been changed.\n\n## Contributing\nBad code? New feature in mind? Open an issue. Better still, learn [Nim](https://nim-lang.org/documentation.html) and shoot a PR :sparkles:\n\n## License\nMIT © [Anirudh Oppiliappan](https://icyphox.sh)\n"
  },
  {
    "path": "src/nicy.nim",
    "content": "import \n  nicypkg/functions,\n  strformat\n\nexport\n  functions\n\nwhen isMainModule:\n  let\n    prompt = color(\"› \", magenta)\n    nl = \"\\n\"\n    gitBranch = color(gitBranch(), yellow)\n    cwd = color(tilde(getCwd()), cyan)\n    dirty = color(\"×\", red)\n    clean = color(\"•\", green)\n  let git = gitBranch & gitStatus(dirty, clean)\n\n  # the prompt\n  echo fmt\"{nl}{virtualenv()}{cwd}{git}{nl}{prompt}\"\n"
  },
  {
    "path": "src/nicypkg/functions.nim",
    "content": "import\n  nre,\n  os,\n  osproc,\n  posix,\n  strformat,\n  strutils,\n  tables,\n  terminal\n\ntype\n  Color* = enum\n    none = -1\n    black = 0\n    red = 1\n    green = 2\n    yellow = 3\n    blue = 4\n    magenta = 5\n    cyan = 6\n    white = 7\n\n  GitStats* = object\n    branchName*: string\n    detached*: bool\n    localRef*: string\n    remoteRef*: string\n    ahead*: int\n    behind*: int\n    untracked*: int\n    conflicted*: int\n    changed*: int\n    staged*: int\n    stash*: int\n\nwhen defined(bash): # shell switch during compilation using \"-d:bash\"\n  proc isBash(): bool =\n    result = true\nelif defined(zsh): # or \"-d:zsh\"\n  proc isBash(): bool =\n    result = false\nelse: # or detect shell automatic\n  proc isBash(): bool =\n    result = false\n    let ppid = getppid()\n    let (o, err) = execCmdEx(fmt\"ps -p {ppid} -oargs=\")\n    if err == 0:\n      let name = o.strip()\n      if name.endswith(\"bash\"):\n        result = true\n\nlet\n  shellName* = # make sure the shell detection runs once only\n    if isBash():\n      \"bash\"\n    else:\n      \"zsh\"    # default\n\nproc zeroWidth*(s: string): string =\n  if shellName == \"bash\":\n    return fmt\"\\[{s}\\]\"\n  else:\n    # zsh, default\n    return fmt\"%{{{s}%}}\"\n\nproc foreground*(s: string, color: Color): string =\n  let c = \"\\x1b[\" & $(ord(color)+30) & \"m\"\n  result = fmt\"{zeroWidth($c)}{s}\"\n\nproc background*(s: string, color: Color): string =\n  let c = \"\\x1b[\" & $(ord(color)+40) & \"m\"\n  result = fmt\"{zeroWidth($c)}{s}\"\n\nproc bold*(s: string): string =\n  const b = \"\\x1b[1m\"\n  result = fmt\"{zeroWidth(b)}{s}\"\n\nproc underline*(s: string): string =\n  const u = \"\\x1b[4m\"\n  result = fmt\"{zeroWidth(u)}{s}\"\n\nproc italics*(s: string): string =\n  const i = \"\\x1b[3m\"\n  result = fmt\"{zeroWidth(i)}{s}\"\n\nproc reverse*(s: string): string =\n  const rev = \"\\x1b[7m\"\n  result = fmt\"{zeroWidth(rev)}{s}\"\n\nproc reset*(s: string): string =\n  const res = \"\\x1b[0m\"\n  result = fmt\"{s}{zeroWidth(res)}\"\n\nproc color*(s: string, fg, bg = Color.none, b, u, r = false): string =\n  if s.len == 0:\n    return\n  result = s\n  if fg != Color.none:\n    result = foreground(result, fg)\n  if bg != Color.none:\n    result = background(result, bg)\n  if b:\n    result = bold(result)\n  if u:\n    result = underline(result)\n  if r:\n    result = reverse(result)\n  result = reset(result)\n\nproc horizontalRule*(c = '-'): string =\n  for _ in 1 .. terminalWidth():\n    result &= c\n  result &= zeroWidth(\"\\n\")\n\nproc tilde*(path: string): string =\n  # donated by @misterbianco\n  let home = getHomeDir()\n  if path.startsWith(home):\n    result = \"~/\" & path.split(home)[1]\n  else:\n    result = path\n\nproc getCwd*(): string =\n  result = try:\n    getCurrentDir() & \" \"\n  except OSError:\n    \"[not found]\"\n\nproc virtualenv*(): string =\n  let env = getEnv(\"VIRTUAL_ENV\")\n  result = extractFilename(env) & \" \"\n  if env.len == 0:\n    result = \"\"\n\nproc gitBranch*(): string =\n  let (o, err) = execCmdEx(\"git status\")\n  if err == 0:\n    let firstLine = o.split(\"\\n\")[0].split(\" \")\n    result = firstLine[^1] & \" \"\n  else:\n    result = \"\"\n\nproc gitStatus*(dirty, clean: string): string =\n  let (o, err) = execCmdEx(\"git status --porcelain\")\n  result = if err == 0:\n    if o.len != 0:\n      dirty\n    else:\n      clean\n  else:\n    \"\"\n\nproc user*(): string =\n  result = $getpwuid(getuid()).pw_name\n\nproc host*(): string =\n  const size = 64\n  result = newString(size)\n  discard gethostname(cstring(result), size)\n\nproc uidsymbol*(root, user: string): string =\n  result = if getuid() == 0: root else: user\n\nproc returnCondition*(ok: string, ng: string, delimiter = \".\"): string =\n  result = fmt\"%(?{delimiter}{ok}{delimiter}{ng})\"\n\nproc returnCondition*(ok: proc(): string, ng: proc(): string,\n    delimiter = \".\"): string =\n  result = returnCondition(ok(), ng(), delimiter)\n\nproc getGitDetachedBranch(): string =\n  let (o, err) = execCmdEx(\"git describe --tags --always\")\n  if err == 0:\n    result = o.strip()\n\nproc getStashCount(): int =\n  let (o, err) = execCmdEx(\"git stash list\")\n  if err == 0:\n    result = o.count(\"\\n\")\n\nproc newGitStats*(): GitStats =\n  let (o, err) = execCmdEx(\"git status --porcelain -b\")\n  if err == 0:\n    let pattern = re\"^## (?P<local>\\S+?)(\\.{3}(?P<remote>\\S+?)( \\[(ahead (?P<ahead>\\d+)(, )?)?(behind (?P<behind>\\d+))?\\])?)?$\"\n    let lines = o.split(\"\\n\")\n\n    let firstLine = lines[0]\n    let matched = firstLine.match(pattern)\n    if matched.isSome:\n      let status = matched.get.captures.toTable\n      result.localRef = status[\"local\"]\n      result.remoteRef = status.getOrDefault(\"remote\", \"\")\n      result.ahead = parseInt(status.getOrDefault(\"ahead\", \"0\"))\n      result.behind = parseInt(status.getOrDefault(\"behind\", \"0\"))\n      result.branchName = status[\"local\"]\n    else:\n      result.branchName = getGitDetachedBranch()\n      if result.branchName.len > 0:\n        result.detached = true\n      else:\n        result.branchName = \"Big Bang\"\n        result.detached = false\n\n    for line in lines[1..^1]:\n      if line.len < 2:\n        continue\n      let code = line[0..<2]\n      if code == \"??\":\n        result.untracked.inc\n      elif code in @[\"DD\", \"AU\", \"UD\", \"UA\", \"DU\", \"AA\", \"UU\"]:\n        result.conflicted.inc\n      else:\n        if code[1] != ' ':\n          result.changed.inc\n        if code[0] != ' ':\n          result.staged.inc\n    result.stash = getStashCount()\n\nproc dirty*(gs: GitStats): bool =\n  (gs.untracked + gs.changed + gs.staged + gs.conflicted) > 1\n\nproc branch*(gs: GitStats, detachedPrefix = \"\", postfix = \" \"): string =\n  if gs.branchName.len > 0:\n    result = gs.branchName & postfix\n  if gs.detached and detachedPrefix.len > 0:\n    result = detachedPrefix & result\n\nproc status*(gs: GitStats, ahead, behind, untracked, changed, staged,\n    conflicted, stash: string, separator, postfix = \" \"): string =\n  var parts = newSeq[string]()\n\n  template add(gs: GitStats, field: untyped, value: string, ss: seq[string]) =\n    if gs.`field` > 0:\n      if gs.`field` > 1:\n        ss.add($gs.`field` & value)\n      else:\n        ss.add(value)\n\n  if gs.branchName.len > 0:\n    add(gs, ahead, ahead, parts)\n    add(gs, behind, behind, parts)\n    add(gs, untracked, untracked, parts)\n    add(gs, changed, changed, parts)\n    add(gs, staged, staged, parts)\n    add(gs, conflicted, conflicted, parts)\n    add(gs, stash, stash, parts)\n    result = parts.join(separator)\n    if result.len > 0 and postfix.len > 0:\n      result &= postfix\n"
  }
]