Replace StringRange w/ an actual StrRVal + more command implementations
This commit is contained in:
13
src/vm/output.ts
Normal file
13
src/vm/output.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import {StrRVal} from "./commands/command.js";
|
||||
|
||||
export const getSubjectDisplay = (sub: StrRVal): string => {
|
||||
if ( sub.term === 'string' ) {
|
||||
return sub.value
|
||||
}
|
||||
|
||||
if ( sub.term === 'int' ) {
|
||||
return String(sub.term)
|
||||
}
|
||||
|
||||
return JSON.stringify(sub.value, null, '\t') // fixme
|
||||
}
|
||||
Reference in New Issue
Block a user