Posts

Maven Tutorial

Mar 23, 2020
Tutorials

Maven真的是看上去难,学了之后感觉还行,还行之后又觉得难。被Maven的发布(Deployment)整的晕头转向,赶紧在这里记录一下过程,免得到时候忘了。

...

ANSI Escape Code

Jan 31, 2020

The way that most programs interact with the Unix terminal is through ANSI escape codes. These are special codes that your program can print in order to give the terminal instructions. Various terminals support different subsets of these codes, and it’s difficult to find a “authoritative” list of what every code does. Wikipedia has a reasonable listing of them, as do many other sites.

Build your own Command Line with ANSI escape codes

JLine Tutorial

Jan 31, 2020
Tutorials

JLine 是一个Java版的GNU ReadLine,通过它,我们可以很方便的实现一个多功能的命令行程序,支持历史记录,光标移动,自动补全,多行编辑,高亮等。

...

为Hugo添加Yan语言代码高亮支持

Jan 28, 2020

为了能让文档阅读起来更顺畅,更美观,我们通常会高亮文档中出现的代码。Hugo使用高亮器 chroma 来对代码进行分析实现代码高亮,但是chroma不支持我们自己定义的语言Yan。

另一种高亮器是Pygments, 但是Hugo自0.6版本后就删除了使用pygments作为高亮器的选项。

为了能让Hugo支持高亮Yan语言,我们可以修改chroma或Pygments让它们支持高亮Yan语言,再重新编译Hugo,安装,但是,这种方法太麻烦了。因此,这里我们采用另一种方式进行workaround。

...

Design note 如何给语言添加IO功能 Adding a function call in my IR code in llvm llvm - How to implement print function in my language? How To Call @printf in LLVM through the module builder system private char skipWhitespace(char ch) { while (true) { if (ch == ' ' || ch == '\t' || ch == '\n') ch = buffer.next(); else break; } return ch; } 改写buffer. ...