https://github.com/kasworld/nonkey
customized monkey interpreter
https://github.com/kasworld/nonkey
Last synced: about 1 month ago
JSON representation
customized monkey interpreter
- Host: GitHub
- URL: https://github.com/kasworld/nonkey
- Owner: kasworld
- License: mit
- Created: 2021-01-14T06:51:06.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-01-20T06:36:33.000Z (over 5 years ago)
- Last Synced: 2023-03-24T12:04:17.230Z (over 3 years ago)
- Language: Go
- Size: 373 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nonkey
customized monkey interpreter
from https://github.com/skx/monkey/
from https://interpreterbook.com/
## changed
changed to typed enum by genenum (https://github.com/kasworld/genenum)
tokentype
objecttype
precedence
change builtin function init
interpreter/evaluator/builtin_init.go
change parse function init
interpreter/parser/parser.go
prefixParseFns
infixParseFns
postfixParseFns
add repl from waig_code
add runmon for runfile, runstring with env
update nonkey, run 1 line ,run file, repl
add autoload arg
add global data package builtinfunctions, pragmas
change some map to slice for performance
interpreter/parser/parser.go
prefixParseFns
infixParseFns
postfixParseFns
enum/tokentype/attrib.go
Token2Precedences
add "I" to interface name
split asti interface package
change version handle (use https://github.com/kasworld/version)
update build script
update build version, args handle
add tokentype.attrib
change switch by operator string to tokentype
add NodeI(token.Token) to object.Error for source code line, posinline
## TODO
replace ';' with '\n' or '\r'
del method call (tokentype PERIOD .) implement incomplete
If the implementation is hard to explain, it's a bad idea.
del redundant function define (tokentype DEFINE_FUNCTION function)
There should be one--and preferably only one--obvious way to do it.
del redundant ternary operator( tokentype QUESTION "? :" )
del indentifier composite char ( ? . % )
identifier start char must letter and _ , not digit, following letter,_ and digit
change "for" keyword to "while"
## bug to fix
method call act oddly