[Nice-commit] Nice/stdlib/nice/lang source-lines.nice,1.5,1.6
Brought to you by:
bonniot
From: Daniel B. <bo...@us...> - 2004-06-25 12:53:47
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11281/stdlib/nice/lang Modified Files: source-lines.nice Log Message: Handle the cases where files appear after the lines, and also where the line numebr is not found even though there is a SMAP. Index: source-lines.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/source-lines.nice,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** source-lines.nice 25 Jun 2004 11:23:29 -0000 1.5 --- source-lines.nice 25 Jun 2004 12:53:35 -0000 1.6 *************** *** 145,152 **** stream.readFully(value); return new String(value, "UTF-8"); - - // Skip the two higher-order bytes. Problematic for large source maps? - //let dummy = stream.readUnsignedShort(); - //return stream.readUTF(); } --- 145,148 ---- *************** *** 213,217 **** var resultLine = 0; ! var resultId = 1; let r = new BufferedReader(new StringReader(map)); --- 209,213 ---- var resultLine = 0; ! var resultId = -1; let r = new BufferedReader(new StringReader(map)); *************** *** 282,286 **** resultId = id; ! if (files.get(id) != null) return (notNull(files.get(id)), resultLine); } --- 278,283 ---- resultId = id; ! // If we already know the file, we know everything we want. ! if (files.size() > id && files.get(id) != null) return (notNull(files.get(id)), resultLine); } *************** *** 294,297 **** --- 291,297 ---- } while (true); + if (resultId == -1) + return null; + return (notNull(files.get(resultId)), resultLine); } |