MCPcopy Create free account
hub / github.com/codecombat/codecombat / compileActions

Function compileActions

app/lib/level-generation.js:978–993  ·  view source on GitHub ↗
(actions)

Source from the content-addressed store, hash-verified

976}
977
978function compileActions (actions) {
979 const lines = []
980 let indent = ''
981 for (const action of actions) {
982 let line = actionToCode(action)
983 if (action.type === '}') {
984 indent = indent.replace(/ {4}$/, '')
985 }
986 line = indent + line
987 if (action.type === 'for') {
988 indent += ' '
989 }
990 lines.push(line)
991 }
992 return lines.join('\n')
993}
994
995function codeToAction (line) {
996 const type = line.trim().split('(')[0].trim()

Callers 1

Calls 1

actionToCodeFunction · 0.85

Tested by

no test coverage detected