summaryrefslogtreecommitdiff
path: root/src/filter.c
Commit message (Collapse)AuthorAge
* filter: faster is_blank_line implementationExplorer092017-07-15
| | | | Using regex_t regex_blank_line is *slow*.
* filter: new internal function is_blank_line()Explorer092017-07-13
| | | | | | It's simply to return (regexec(&regex_blank_line, str, 0, NULL, 0) == 0); The reason for encapsulation is to allow replacing this with a non-regex method if necessary.
* filter: memory leak free scanner postprocessing.viktor.shepel2017-07-03
| | | | | | | | | | | | | | | **Issue:** Scanner postprocessing leaks memory during correction of `#line` directives values and generation of C header file. **Root cause:** `filter_fix_linedirs` and `filter_tee_header` functions do not dispose allocated memory. **Solution:** Automatically reclaim affected memory by allocating it on stack insted of heap. Stack allocation should not be a problem as its only 512 bytes and there is no recursive calls.
* filter: Output correct #line value for current file.Jeff Smith2017-05-14
| | | | | | | A #line pre-processor directive specifies the line number and source file of the following lines. If the source file _is_ the current file, the line number should be that of the line following the directive. So the specified line number should be the current line number plus 1.
* FLEX_EXIT() is the preferred way to exit flexJeff Smith2017-05-02
|
* filter: Don't emit #line if %option noline setTobias Klauser2017-01-12
| | | | | | One place emitting a #line directive to the generated header was missed in commit 647a92b9f4 when resolving #55. Fix it to respect gen_line_dirs as well.
* Fix M4 quoting of section 3.Demi Obenour2016-10-05
| | | | | | | | | | This fixes M4 quoting of section 3 of the input file, including escape sequences and character constants. Tests were added to verify the behavior in section 3 with respect to quoting. Both escaping of quotes and quoting of potential macro-start characters are tested. Existing tests were also fixed to account for the new -- and now correct -- behavior. Many tests relied on the old behavior of expanding M4 macros in section 3. They needed to be updated for the new behavior.
* use type size_t in filter_tee_header() to avoid warningsrlar2016-03-01
|
* add (size_t) casts to malloc invocations to prevent warningsrlar2016-03-01
|
* Improved pipe-stdin hack behavior; resolves sf#198.Michael van Elst2016-01-08
| | | | Signed-off-by: Thomas <Klausner wiz@NetBSD.org>
* Removed flex_realloc().Michael McConville2015-12-09
| | | | | As with flex_alloc(), replace calls to flex_realloc(), which was just a wrapper around realloc().
* Removed flex_alloc; cleaned up style.Michael McConville2015-12-09
| | | | | | | | | | | The function flex_alloc() was just a wrapper around malloc(). Since this only added unclarity, and the flex_alloc() function is likely a legacy of olden times, remove it in favor of calls to malloc() directly. Style elements cleaned up: * superfluous spacing around parentheses * non-constant initialization in variable declarations * needless casts * almost all uses of assignments as subexpressions
* Remove unused variable from src/filter.c:filter_fix_linedirsMariusz PluciƄski2014-11-25
|
* NetBSD downstream patches.Christos Zoulas2014-11-11
| | | | | | | | | | | | | | | | const fixes. -Wconversion fixes for the skeleton files. param namespace protection (add _ to inline function parameters). unused variable/code removal. rename warn to lwarn to avoid conflict with <err.h>. ctype.h function argument correction. merged the error functions lerrif and lerrsf -> lerr.
* move flex program sources into src/ directoryWill Estes2014-02-16
The *.[chly] sources are now in the src directory. This implies a bunch of changes in Makefile.am and friends to account for the new location. The .gitignore files are now more local to places where various object files and generated source files occur.