(actions)
| 976 | } |
| 977 | |
| 978 | function 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 | |
| 995 | function codeToAction (line) { |
| 996 | const type = line.trim().split('(')[0].trim() |
no test coverage detected