nl_tokens: attempts to find the full function call expression ( over multiple lines ) given the sources lines and a starting point
pl_tokens: function findFullSourceLine ( fileLines , startLine ) { var lines = [ ] var parenCount = 0 var mode = 0 // mode 0 for paren searching, mode 1 for double-quote searching, mode 2 for single-quote searching var lastWasBackslash = false // used for quote searching for ( var n = startLine ; n < fileLines . length ; n ++ ) { var line = fileLines [ n ] lines . push ( line . trim ( ) ) for ( var i = 0 ; i < line . length ; i ++ ) { var c = line [ i ] if ( <mask> === 0 ) { if ( c === '(' ) { parenCount ++ //if(parenCount === 0) { //  return lines.join('\n') // done //} } else if ( c === ')' && parenCount > 0 ) { parenCount -- if ( parenCount === 0 ) { return lines . join ( '\n' ) // done } } else if ( c === '"' ) { mode = 1 } else if ( c === "'" ) { mode = 2 } } else if ( mode === 1 ) { if ( c === '"' && ! lastWasBackslash ) { mode = 0 } lastWasBackslash = c === '\\' } else { // mode === 2 if ( c === "'" && ! lastWasBackslash ) { mode = 0 } lastWasBackslash = c === '\\' } } } return lines . join ( '\n' ) // if it gets here, something minor went wrong }