public CPosC InsertAfterCPos(CPosC pos, Tok tok) { if (pos.LAdj_isWS) { return(SplitWS(pos, tok)); } else { // todo probably sanity check if "pos" is at end of token and throw otherwise InsertTokAfterNode(pos.N, tok); return(CPosAtEndOfTok(tok)); } }
public CPosC SplitWS(CPosC CP_at, Tok tok) // returned new CPos is a the end of the inserted node { if (!CP_at.isValid(this)) { throw new Exception(); } if (!CP_at.LAdj_isWS) { throw new Exception(); } var nu_node = new NodeTok { _tok = tok }; SplitWS((NodeWS)CP_at.N, nu_node, CP_at.ci_post); return(new CPosC(this) { N = nu_node, ci_post = nu_node.len }); // todo wird wahrscheinlich nicht gebraucht }