[javascriptlint-commit] SF.net SVN: javascriptlint:[208] branches/cjsl/src
Status: Beta
Brought to you by:
matthiasmiller
|
From: <mat...@us...> - 2008-08-23 19:01:59
|
Revision: 208
http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=208&view=rev
Author: matthiasmiller
Date: 2008-08-23 19:01:54 +0000 (Sat, 23 Aug 2008)
Log Message:
-----------
Fix column indices for very long lines.
Modified Paths:
--------------
branches/cjsl/src/jsapi.h
branches/cjsl/src/jsl.c
branches/cjsl/src/jsscan.c
Modified: branches/cjsl/src/jsapi.h
===================================================================
--- branches/cjsl/src/jsapi.h 2008-08-22 13:24:53 UTC (rev 207)
+++ branches/cjsl/src/jsapi.h 2008-08-23 19:01:54 UTC (rev 208)
@@ -1722,6 +1722,7 @@
struct JSErrorReport {
const char *filename; /* source file name, URL, etc., or null */
uintN lineno; /* source line number */
+ uintN linepos;
const char *linebuf; /* offending source line without final \n */
const char *tokenptr; /* pointer to error token in linebuf */
const jschar *uclinebuf; /* unicode (original) line buffer */
Modified: branches/cjsl/src/jsl.c
===================================================================
--- branches/cjsl/src/jsl.c 2008-08-22 13:24:53 UTC (rev 207)
+++ branches/cjsl/src/jsl.c 2008-08-23 19:01:54 UTC (rev 208)
@@ -2171,7 +2171,7 @@
/* colno is 1-based */
colno = 0;
if (report->linebuf)
- colno = PTRDIFF(report->tokenptr, report->linebuf, char)+1;
+ colno = report->linepos + PTRDIFF(report->tokenptr, report->linebuf, char)+1;
OutputErrorMessage(report->filename, report->lineno, colno,
errorNames[report->errorNumber], prefix, message);
Modified: branches/cjsl/src/jsscan.c
===================================================================
--- branches/cjsl/src/jsscan.c 2008-08-22 13:24:53 UTC (rev 207)
+++ branches/cjsl/src/jsscan.c 2008-08-23 19:01:54 UTC (rev 208)
@@ -560,6 +560,7 @@
linestr = js_NewStringCopyN(cx, ts->linebuf.base,
ts->linebuf.limit - ts->linebuf.base,
0);
+ report.linepos = ts->linepos;
report.linebuf = linestr
? JS_GetStringBytes(linestr)
: NULL;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|