文件名称:monkey-giggle:我对Thorsten Bell的书的实现(用Go语言编写翻译)
文件大小:51KB
文件格式:ZIP
更新时间:2024-04-03 03:26:20
Go
猴子咯咯地笑 monkey-giggle是一种基于玩具的语言,其语法与Javascript相似,该语言经过解释和编译。 monkey-giggle编译为在基于堆栈的中运行的。 建造 user@box:$ go build cmd/ 旅游 Monkey是一种功能语言,支持闭包,条件和常规包。 绑定和功能: let a = 5 ; let b = 10 ; let c = 120 ; let add = fn ( x , y , y ) { x + y + z } ; 有条件的 let a = 10 ; let b = - 10 ; let c = if ( ( a + b ) == 0 ) { 5 ; } else { 10 ; } 构造函数 giggle >> len ( "Hello World" ) 11 giggle >> len ( [ 1 , 2 , 3
【文件预览】:
monkey-giggle-master
----.gitignore(2KB)
----README.md(3KB)
----lexer()
--------lexer.go(4KB)
--------lexer_test.go(4KB)
----eval()
--------eval.go(11KB)
--------eval_test.go(12KB)
--------builtin.go(337B)
----code()
--------code_test.go(2KB)
--------code.go(6KB)
----token()
--------types.go(2KB)
--------keywords.go(412B)
--------token.go(539B)
----repl()
--------repl.go(2KB)
----STATS.md(2KB)
----compiler()
--------compiler.go(10KB)
--------compiler_test.go(28KB)
--------symbol_table.go(2KB)
----go.mod(56B)
----parser()
--------parser.go(14KB)
--------parser_test.go(23KB)
----vm()
--------vm.go(15KB)
--------vm_test.go(13KB)
--------frame.go(617B)
----go.sum(0B)
----ast()
--------ast.go(1KB)
--------nodes.go(10KB)
--------ast_test.go(625B)
----object()
--------env.go(879B)
--------builtinfn.go(3KB)
--------function.go(2KB)
--------closure.go(363B)
--------hashmap.go(1KB)
--------object.go(1KB)
--------integer.go(324B)
--------null.go(323B)
--------boolean.go(312B)
--------error.go(318B)
--------return.go(325B)
--------string.go(285B)
--------array.go(528B)
----cmd()
--------main.go(302B)