A Fidget-Symbol based Brainfuck Dialect
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

jit.go 778B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package fidgetlang
  2. import "strings"
  3. func compileDebug(debug string) []instruction {
  4. var program = []instruction{}
  5. instr := strings.Split(debug, " ")
  6. for k := range instr {
  7. instr[k] = strings.TrimSpace(instr[k])
  8. program = append(program, debugToInstruction(instr[k]))
  9. }
  10. return program
  11. }
  12. func compileProgram(prg string) []instruction {
  13. var program = []instruction{}
  14. instr := strings.Split(prg, " ")
  15. for k := range instr {
  16. instr[k] = strings.TrimSpace(instr[k])
  17. program = append(program, stringToInstruction(instr[k]))
  18. }
  19. return program
  20. }
  21. func makeDebug(k []instruction) string {
  22. if len(k) == 0 {
  23. return ""
  24. }
  25. var out = instructionToDebug(k[0])
  26. if len(k) > 1 {
  27. for i := range k[1:] {
  28. out += " " + instructionToDebug(k[i])
  29. }
  30. }
  31. return out
  32. }