summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Correctly refer to ctrl.traceline_template:Burke Libbey2023-03-131-2/+2
| | | | | This was refactored in 0e32cd, but left a dangling reference to the previous location here.
* Fix #539 crash on Apple M1 by casting 0 to (char *) explicitlyYifeng Li2023-03-091-1/+1
| | | | | | | | | | | | | | | | | | | | | Currently, when the NULL-terminated variadic function filter_create_ext() is invoked, the value "0" is passed as the last argument to act as a terminator. However, this is an integer value, which is incompatible with the pointer data type expected by filter_create_ext(). This is undefined behavior in C, correct operation is not guaranteed. In fact, it causes flex to crash on Apple M1 when GCC is used - the loop is not terminated when it should, instead, it keeps running, corrupting the argument list for invoking m4. As a result, it creates the following error: > flex: fatal internal error, exec of gm4 failed This commit fixes the problem by explicitly casting the value 0 to the correct pointer type (char *). Signed-off-by: Yifeng Li <tomli@tomli.me>
* .gitignore adjustments for WIN32Simon Sobisch2023-03-011-0/+5
|
* Merge pull request #527 from Mightyjo/issue-525Will Estes2022-06-173-3/+21
|\ | | | | Fix Issue #525 - Segfault in yyinput
| * fix(issue-525): Fail gracefully when yy_get_next_buffer can't find one.Joseph Langley2022-05-183-3/+21
| | | | | | | | Demonstrate yyinput() error checking for this condition.
* | Also check for C++ standard version when deciding to include <stdint.h>Explorer092022-06-171-0/+9
|/ | | | | | Fixes: #517 Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
* Add command-line options --noyyget_debug and --noyyset_debugggujjula2021-12-293-0/+12
|
* Add command-line options --noinput and --noyyinputggujjula2021-12-293-0/+8
|
* Remove trailing whitespaceSean McBride2021-10-233-35/+35
| | | | Many projects have pre-commit hooks that check for pedantic things like trailing whitespace. No harm in removing it to pacify them.
* Merge pull request #491 from Mightyjo/issue_469Will Estes2021-08-135-41/+202
|\ | | | | Issue 469; Compute length of yy_state_buf correctly
| * chore(skel): Fix permissions on cpp-flex.sklJoseph Langley2021-07-021-0/+0
| |
| * chore(skel): Improve comment at state buffer init.Joseph Langley2021-07-021-1/+3
| |
| * fix(skel): Init state buffer correctlyJoseph Langley2021-07-023-57/+40
| | | | | | | | State buffer initialization in cpp-flex.skl got lost during a rebase. Added it back in from c99-flex.skl and made improvements suggested by smcpeak.
| * chore(perm): Fix permissions 755->644Joseph Langley2021-07-025-0/+0
| |
| * chore(make): Ensure distcheck cleans up directories.Joseph Langley2021-06-091-0/+1
| |
| * fix(skel): Fix porting errors from the cpp to the c99 and go skeletons.Joseph Langley2021-06-092-2/+5
| |
| * fix(skel): Use yypanic in place of YY_FATAL_ERROR.Joseph Langley2021-06-092-2/+2
| | | | | | | | yypanic() is new in the c99 and go skeletons.
| * fix(skel): Add state buffer size handling to reentrant scanner skeletons.Joseph Langley2021-06-093-12/+79
| |
| * fix(skel): Add state buffer size handling to non-reentrant scanner skeletons.Joseph Langley2021-06-093-5/+109
| |
| * Ensure size of Reject state buffer is sufficient each time ↵Mightyjo2021-06-092-0/+1
| | | | | | | | yy_switch_to_buffer is called.
* | fix compile warning originating in cpp skeletonSimon Sobisch2021-06-221-1/+1
|/ | | `gcount()` is of type `streamsize` which has a system-dependent size with at least `int`. Because of the `int max_size` limit no bigger value will be returned, the explicit cast fixes warnings from compilers/static analyzers.
* Merge branch 'yy-init-buffer-nonnull' of git://github.com/Explorer09/flex ↵Will Estes2021-06-083-3/+3
|\ | | | | | | into Explorer09-yy-init-buffer-nonnull
| * scanner: Fix compiler confusion in yy_init_buffer()Explorer092021-06-073-3/+3
| | | | | | | | | | | | | | | | | | | | | | When complied with 'gcc -O3', the yy_init_buffer call can confuse gcc, thinking the 'b' pointer may be NULL. (gcc would warn that if '-Wnull-dereference' is used). Fix the confusion by never pass a NULL constant to the function. Fixes: #377 Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
* | Remove manual m4 search code. No more stat() dependency.Explorer092021-06-072-38/+0
|/ | | | | | | | | | | | | | This reverts commit c34590c4bf067d4e749e5298a8ce9f90072d6332 and all search code patches that followed it. The execvp() would do the $PATH searching of m4 for flex. There's no need to duplicate the effort. Another reason for the removal is to remove dependency on stat() system call, which would cause a problem in a 32-bit OS accessing a filesystem with 64-bit inode number (see #413). Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
* fix(build): Replace wildcards in Makefile.am.Joseph Langley2021-06-041-3/+11
| | | | Wildcards were causing automake to generate build rules for the *-filename dummies. They're not generally portable.
* Go back end: More Goification of names.Eric S. Raymond2020-12-041-26/+33
|
* check that each skeleton we build has the correct number of sections (#7)Daniel Brooks2020-11-262-0/+36
| | | | Probably we could turn the section markers into m4 macros, but until then this will prevent accidents.
* Mollify picky C compilers some more (#8)Daniel Brooks2020-11-262-2/+2
|
* Improve standards conformance in C99 and Go skeletons.Eric S. Raymond2020-11-262-14/+24
|
* Deal with a GCC warning elicited by upgrade to GCC 10.2.0.Eric S. Raymond2020-11-201-2/+2
|
* In the Go back end, more moves towards Go conventions.Eric S. Raymond2020-11-201-87/+89
| | | | All documented in the go-flex.skl header comment.
* Improve information hiding in C99 and Go back ends.Eric S. Raymond2020-11-202-235/+232
| | | | | | Things that don't need to be declared before that DFA tables shouldn't be.
* In the Go back end, begin Go-ifying the public interface.Eric S. Raymond2020-11-201-68/+68
| | | | struct yyguts_t becomes FlexLexer typedef.
* Eliminate forwards in the C99 back end.Eric S. Raymond2020-11-191-38/+29
|
* In the Go back end, elimate some forwards.Eric S. Raymond2020-11-191-38/+30
|
* More Go back end cleanup.Eric S. Raymond2020-11-191-91/+16
| | | | | | Remove the Bison-bdidge kludge. Rearrange yyguts_t so the public members are grouped together.
* In the C99 and Go back ends, rearrange code...Eric S. Raymond2020-11-192-404/+404
| | | | ...to clean out a forward declaeation.
* Improve type checking in c99 and Go back ends.Eric S. Raymond2020-11-192-5/+5
|
* In the Go back end, more moves towards Go-like names.Eric S. Raymond2020-11-192-335/+328
| | | | Not touching the public interface yet.
* More massaging of the fake Go skeleton in the direction of Go.Eric S. Raymond2020-11-191-333/+333
|
* Stop emitting unbalanced markup in the skeleton.Eric S. Raymond2020-11-194-4/+3
| | | | | It was fixed up by generating matcing unbalanced markuo in dfa.c, but a good idea this was not.
* In C88 and Go back ends, remove remnant GENTABLES conditionals.Eric S. Raymond2020-11-192-146/+2
|
* Partial move of Go back end to Go canelCasing in names.Eric S. Raymond2020-11-192-343/+343
| | | | | No publicly visible names are touched yet. This is all preep work. All tesrs pass.
* Go back end: Change the prefix option to set Go package name...Eric S. Raymond2020-11-183-79/+18
| | | | ...presebtly commented out. All tests pass.
* TYhis commit is a model for how to add a new back end.Eric S. Raymond2020-11-173-0/+2560
| | | | | | | Begin the Go back end. Right now it's a fake that generates C... ...but this commit puts all the build and testnmachinery in place for when it's not. All tests pass.
* In C99, remove unneeded forward declarations.Eric S. Raymond2020-11-161-6/+0
|
* Up-gun a test to use the lineno code in the array+BOL case...Eric S. Raymond2020-11-162-2/+2
| | | | ...and fix the bug that turned up.
* Repair some bitrotted variable-trailing-context code.Eric S. Raymond2020-11-152-6/+14
| | | | | It decayed because the test for this feature only exercised the nr back end. We add a ruleset--based test to verify on all back ends.
* Fix typo revealed by Go porting work, and improve test coverage to match.Eric S. Raymond2020-11-152-2/+2
| | | | | | | | | | | We a ruleset test for BOL matching and a test for the array case of yymore. Improve yymore testing by adding tests that require a BOL match in both array and pointer cases. Also, convert lineno sporadic test to be ruleset-based so it's applied on all back ends. No cide changes.
* Minor build system fixes before starting the Go port.Eric S. Raymond2020-11-133-22/+20
| | | | | | | | | | | | | | | Remove two dependencies that the C99 back end no longer has. Repair to force in-time building of skel.h files. This way of doing it reduces where a new skel dependency has to be declared in the vuilld recipe to the one spot where the flex.h file is made from the flex.skl file. The posixly correct test only needs to be done once, since it only affects how the tables are genetated rather than setting code conditionals in the back end. Also, some comment typo fixes.