diff --git a/lib/ace/ext/chromevox.js b/lib/ace/ext/chromevox.js index 3243a7a6..e51800a4 100644 --- a/lib/ace/ext/chromevox.js +++ b/lib/ace/ext/chromevox.js @@ -356,6 +356,28 @@ var speakTokenQueue = function(token) { speakToken_(token, 1); }; +/** + * @param {!cvoxAce.Token} token Token to speak. + * Get the token speech property. + */ +var getTokenProp = function(token) { + /* Types are period delimited. In this case, we only syntax speak the outer + * most type of token. */ + if (!token || !token.type) { + return; + } + var split = token.type.split('.'); + if (split.length === 0) { + return; + } + var type = split[0]; + var prop = rules[type]; + if (!prop) { + prop = DEFAULT_PROP; + } + return prop; +}; + /** * Speak the token based on the syntax of the token. * @private