#include "slick.sh" _command void insert_debug_value() { // get the original values to restore later int curCol = p_col; int curLine = p_line; // get the current word under the cursor int temp = 0; _str curWord = cur_word(temp); // get the indentation of the current line first_non_blank(); int indentCol = p_col - 1; // start building the new line of code _str lineText = indent_string(indentCol); // figure out which language we're in (Slick-C, C++ or Java for now) switch (p_LangId) { case 'e': // Slick-C lineText :+= "say('"curWord" = '"curWord");"; break; case 'c': // C++ lineText :+= "printf(\""curWord" = %s\", "curWord");"; break; case 'java': // Java lineText :+= "System.out.println(\""curWord" = \" + "curWord".toString());"; break; } // insert the new debug line after the current line insert_line(lineText); // restore the original line and column p_col = curCol; p_line = curLine; }