summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* [master]: Fix a couple of FTBS bugsdebian/2.6.4-4archive/debian/2.6.4-4Manoj Srivastava2018-02-16
| | | | Signed-off-by: Manoj Srivastava <srivasta@debian.org>
* Merge branch 'upstream'Manoj Srivastava2018-02-12
|\
| * Update to a new upstream commit for some bug fixes.Manoj Srivastava2018-02-08
| |\ | | | | | | | | | Signed-off-by: Manoj Srivastava <srivasta@debian.org>
| | * scanner: Allow "--" as option argument.Explorer092017-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, invocations such as: flex --outfile -- wc1.l would fail with "requires an argument" error message. Fixes #285
| | * scanner: scanopt_err() now returns voidExplorer092017-12-08
| | |
| | * scanner: simplify scanopt_usage().Explorer092017-12-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In-function macro CALC_LEN removed and no longer needed. Local variable renames: maxlen[0] => opt_col_width maxlen[1] => desc_col_width indent now explicitly const
| | * scanner: prevent overflow in add_action()Explorer092017-12-06
| | |
| | * scanner: use calloc to allocate new filter memoryMichael W. Bombardieri2017-11-29
| | |
| | * Obsolete yypad64() macro.Explorer092017-11-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | Slightly rewrite the logic in yytbl_data_load() and yytbl_write_pad64() so they simply check if the bytes read/written are in 8-byte boundary. No need to calculate how many bytes we need to pad. (Incidentally this makes smaller code in x86_64.) For yytbl_hdr_init(), just expand the calculation from the macro.
| | * scanner: temporarily protect against ccl overflow & overwriting.Explorer092017-11-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | For ccladd(), if cclp given is a non-last ccl, adding a char into it will overflow the buffer and overwrite the first char in the next ccl. For now, add a temporary detection and protection code. (Not sure if this could happen in user input, but if it could, then you can expect some "corrupted" behavior for generated scanners.)
| | * build: fix ENABLE_NLS preprocessor check.Explorer092017-11-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | Because ENABLE_NLS may be defined to 0 (manually, not through autoconf) and it's semantically incorrect to only check whether it's defined. This is a correction to commit 661d603b65385f62f372acd2017e5af2e0f0cd50.
| | * scanner: Rename genecs() local variables. No code changes.Explorer092017-11-03
| | |
| | * scanner: Remove unused BASENAME() macro.Explorer092017-11-03
| | | | | | | | | | | | (Simply forgot to do so in commit fb731ac0221e1866534dfe072b84b8af7a5d88f3)
| | * build: use #ifdef for ENABLE_NLS check.Alex Richardson2017-11-03
| | | | | | | | | | | | | | | | | | config.h will have either define ENABLE_NLS or not define it. If it is not defined we get a -Wundef warning due to using #if with an undefined macro
| | * scanner: Define _POSIX_C_SOURCE when needed in skeleton.Explorer092017-11-03
| | | | | | | | | | | | | | | | | | The function fileno() is defined by POSIX. When flex would otherwise not provide that feature macro, we define it. Fixes #263
| | * build: Remove custom reallocarray() declaration.Lukasz Baj2017-10-05
| | | | | | | | | | | | Use one from <stdlib.h> instead because that is more portable.
| | * scanner: Simplify PRINT_SPACES() macroExplorer092017-10-05
| | |
| | * scanner: Include flexdef.h at %top block of scan.lExplorer092017-09-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | config.h may define macros that alter the API of the standard library funtions, and so it should be included before any other standard header, even before the skeleton's standard header inclusion. For example: config.h may #define _GNU_SOURCE that would expose the reallocarray() prototype from <stdlib.h> on glibc 2.26+ systems. If we include <stdlib.h> before config.h, reallocarray() would not be available for use in lex file since the second include doesn't help due to header guard. For now our config.h might `#define malloc rpl_malloc` -- this substitution must work before including stdlib.h, or else the compiler will complain about missing prototypes, and may result in incorrect code in scan.l (gcc warning: return makes pointer from integer without a cast [-Wint-conversion]). Fixes #247.
| | * {re,}allocate_array code cleanupExplorer092017-09-02
| | |
| | * Don't install libfl.pc if --disable-libfl.Explorer092017-08-27
| | |
| | * libfl.pc: Rewrite descriptions, remove unneeded Cflags.Explorer092017-08-27
| | | | | | | | | | | | There's no need to include any header when linking with `-lfl`.
| | * Move libfl.pc.in to src subdirectory.Explorer092017-08-27
| | |
| | * Hardcode flex name in --help textExplorer092017-08-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't use program_name in the description of -T/--trace or -V/--version option. It's ugly when user invokes flex with a long path like "/home/username/tools/bin/my-custom-built-flex". This solution is not long term. If possible, the help text should be modified so that the "flex" name is no longer needed below the first "Usage:" line. All translations of help text will need to be updated as well.
| | * Remove an unneeded gettext() in --version outputExplorer092017-08-24
| | | | | | | | | | | | "%s %s\n" is not translatable
| | * scanner: remove BASENAME(); don't strip path from program_nameExplorer092017-08-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no technical need of stripping path from program_name. I think the users should be fine if they see the path they use to invoke flex is diagnostic messages and help texts. Yes, users will see "Usage: ../flex [OPTIONS]..." now if they invoke flex with the path "../flex". The --version output has been changed so that the name field will be always "flex" or "flex++". If the flex program has been renamed to "lex" (for compatibility or other reason) this will allow identifying the implementation name ("flex"). (And it's a recommended practice in GNU Coding Standards)
| | * have libobjs depend on libobjdir (#244)Michael Haubenwallner2017-08-24
| | |
| | * scanner: #define BASENAME, remove #include libgen.hJannick2017-07-17
| | |
| | * mkskel.sh: fix EOL issue for CRLF systemsJannick2017-07-18
| | |
| | * scanner: Ignore comment lines in skeleton files.jannick02017-07-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | In skeleton files comments are indicated by leading `%#` and when directly read in using `flex -S <skeleton.skl>` they should be ignored. Example: `flex.skl`. Amending commit 2f21edac99b5efc432417233e6e53326d630e08f which removed this conditional branch.
| | * 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.
| | * scanner: memory leak free scanner generator.viktor.shepel2017-07-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | **Issue:** Scanner generation leaks memory for transition tables when invoked without `--tables-file` option. **Root cause:** `gentabs` function has different memory acquire/release conditions. **Solution:** Reclaim memory at the same scope where it was alloacated.
| | * 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.
| | * scanner: c{i,j} should preserve case.NieDzejkob2017-07-03
| | | | | | | | | | | | Fixes #193
| | * scanner: add optionn to specify backup filename.EricSharkey2017-07-03
| | | | | | | | | | | | | | | | | | In a directory containing multiple scanners, we want to allow specifying the name of the backup file else the backup files will be overwritten.
| | * scanner: Use reallocarr() when available.Thomas Klausner2017-05-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | NetBSD had a crash during build. Since the provided substitute for reallocarray() wasn't working, use NetBSD's reallocarr(). Let configure choose that function whenever it is available. Use reallocarray if available. Still fallback if neither is available. Fixes #219
| | * 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.
| | * scanner: corrected typoWill Estes2017-05-13
| | |
| | * scanner: finish support for noyy{get,set}_column.Will Estes2017-05-13
| | | | | | | | | | | | Unattributed patch carried over from sourceforge bug tracker.
* | | Merge branch 'upstream'Manoj Srivastava2018-02-08
|\| | | | | | | | | | | | | | | | | Update to v2.6.4 Signed-off-by: Manoj Srivastava <srivasta@debian.org>
| * | New upstream version 2.6.4Manoj Srivastava2018-02-08
| | |
| * | Merge tag 'v2.6.4' into upstreamManoj Srivastava2018-02-08
| |\| | | | | | | | | | | | | | | | version 2.6.4 Signed-off-by: Manoj Srivastava <srivasta@debian.org>
| | * scanner: Mention %# comments are removed when building skel.cExplorer092017-05-06
| | |
| | * Honor user definitions of yy_* macrosDemi Obenour2017-05-03
| | | | | | | | | | | | | | | The user may have defined the yy_* macros themselves. In that case, don't clobber them.
| | * Don't leak macro definitions into header filesDemi Obenour2017-05-03
| | | | | | | | | | | | | | | | | | | | | This allowed unnamespaced definitions to leak into header files, breaking client code. Fixes #142
| | * scanner: Check for 0 bracecount when EOL ends quoted literal.Demi Obenour2017-05-03
| | | | | | | | | | | | | | | This can happen in the case of // comments (which Flex doesn't handle specially).
| | * scanner: when bracelevel is negative, treat as zero.Demi Obenour2017-05-03
| | | | | | | | | | | | | | | This really should never happen, but this at least fixes the breakage on Verilator.
| | * build: Delete comments from skeleton file.Demi Obenour2017-05-03
| | | | | | | | | | | | | | | | | | Since the comments in flex.skl are, by hypothesis, not needed in skel.c, we remove them. THis reduces the size of the resulting executable somewhat.
| | * FLEX_EXIT() is the preferred way to exit flexJeff Smith2017-05-02
| | |
| | * Fix myesc() 'sptr' conditionalsExplorer092017-05-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Don't call isascii() here. It's deprecated in POSIX and not needed for myesc's case. * The check of the character class and range here should match what's defined as {ESCSEQ} in scan.l, so for [[:xdigit:]] we use isxdigit(); for [0-7] we check '0' <= c <= '7' (not isdigit(c) because isdigit is locale-dependant in standard's sense) * Add missing length limit for "\x<hex>" (<hex> is at most 2 digits)