aboutsummaryrefslogtreecommitdiff
path: root/project/src/lib-parser.c
diff options
context:
space:
mode:
authorWiimm <wiimm@wiimm.de>2020-11-30 16:16:56 +0100
committerWiimm <wiimm@wiimm.de>2020-11-30 16:16:56 +0100
commit9c0078c6b9c1309b48f9ece8b5cad1b9be9a75c5 (patch)
tree0abd3b6a244076650e40a07e42adae9c2a6b2d8c /project/src/lib-parser.c
parenta0815499b2d9014695e6e261c909476729445360 (diff)
SZS v2.21a
Diffstat (limited to '')
-rw-r--r--project/src/lib-parser.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/project/src/lib-parser.c b/project/src/lib-parser.c
index 6437b2c..3224c12 100644
--- a/project/src/lib-parser.c
+++ b/project/src/lib-parser.c
@@ -2377,6 +2377,7 @@ void GotoEolSI
ScanInfo_t * si // valid data
)
{
+ DASSERT(si);
ScanFile_t *sf = si->cur_file;
DASSERT(sf);
sf->prev_ptr = sf->ptr;
@@ -2511,9 +2512,9 @@ ccp FindEndOfLineSI
ccp FindLineFeedSI
(
- ScanInfo_t * si, // valid data
+ const ScanInfo_t * si, // valid data
ccp ptr, // start search here
- bool mark_error // true: increment error counter
+ bool mark_error // true: increment error counter (ignore const)
)
{
DASSERT(si);
@@ -2523,7 +2524,7 @@ ccp FindLineFeedSI
if (mark_error)
{
sf->line_err++;
- si->total_err++;
+ ((ScanInfo_t*)si)->total_err++;
}
while ( ptr < sf->end && *ptr != '\n' )
@@ -2536,8 +2537,8 @@ ccp FindLineFeedSI
ccp FindNextLineFeedSI
(
- ScanInfo_t * si, // valid data
- bool mark_error // true: increment error counter
+ const ScanInfo_t * si, // valid data
+ bool mark_error // true: increment error counter (ignore const)
)
{
DASSERT(si);
@@ -2545,6 +2546,22 @@ ccp FindNextLineFeedSI
return FindLineFeedSI(si,si->cur_file->ptr,mark_error);
}
+///////////////////////////////////////////////////////////////////////////////
+
+mem_t GetLineSI
+(
+ const ScanInfo_t * si // valid data
+)
+{
+ DASSERT(si);
+ DASSERT(si->cur_file);
+ ccp eol = FindNextLineFeedSI(si,false);
+ mem_t mem;
+ mem.ptr = si->cur_file->ptr;
+ mem.len = eol ? eol - mem.ptr : 0;
+ return mem;
+}
+
//
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////