date: 2020-09-26 01:15 tags: [] categories: []
// (1)
### Added by Zinit's installer | |
if [[ ! -f $HOME/.zinit/bin/zinit.zsh ]]; then | |
print -P "%F{33}▓▒░ %F{220}Installing %F{33}DHARMA%F{220} Initiative Plugin Manager (%F{33}zdharma/zinit%F{220})…%f" | |
command mkdir -p "$HOME/.zinit" && command chmod g-rwX "$HOME/.zinit" | |
command git clone https://github.com/zdharma/zinit "$HOME/.zinit/bin" && \ | |
print -P "%F{33}▓▒░ %F{34}Installation successful.%f%b" || \ | |
print -P "%F{160}▓▒░ The clone has failed.%f%b" | |
fi | |
source "$HOME/.zinit/bin/zinit.zsh" |
""" | |
./leaderf/ghq.py | |
""" | |
from functools import wraps | |
from ghqExpl import GhqExplManager | |
from leaderf.utils import lfCmd | |
def command(func): |
""" | |
:Leaderf ghq | |
してから | |
py3file ~\ghq\github.com\tamago324\sandbox\vim\leaderf\add_command_leaderf_ghq.py | |
で読み込む | |
""" | |
from functools import wraps | |
from ghqExpl import ghqExplManager |
# vim: set fenc=utf-8 ft=dosini: | |
# define a new task named "file-build" | |
[file-build] | |
# shell command, use quotation for filenames containing spaces | |
# check ":AsyncTaskMacro" to see available macros | |
command=gcc -g "$(VIM_FILEPATH)" -o "$(VIM_FILEDIR)/$(VIM_FILENOEXT).exe" | |
# working directory, can change to $(VIM_ROOT) for project root |
""" | |
中置記法の数式のASTを作成する | |
graphviz のテキストも出力できる | |
expr -> expr + term | |
| expr - term | |
| term | |
term -> term * factor | |
| term / factor |
""" Graphviz で使えるテキストを吐き出すやつ | |
""" | |
from node import Node, NodeKind | |
def gen(node: Node, node_id=""): | |
if node.kind == NodeKind.NUM: | |
# 数値は値を表示 | |
print(f'\t{node_id} [label="{node.value}"];') |
""" | |
中置記法の数式のASTを作成する | |
graphviz のテキストも出力できる | |
expr -> expr + term | |
| expr - term | |
| term | |
term -> term * factor | |
| term / factor |
""" | |
expr -> expr + term | |
| expr - term | |
| term | |
term -> term * factor | |
| term / factor | |
| factor | |
factor -> digit | |
| ( expr ) |
""" | |
expr -> expr + term | |
| expr - term | |
| term | |
term -> term * factor | |
| term / factor | |
| factor | |
factor -> digit | ( expr ) | |