Skip to content

Commit

Permalink
check for trailing brackets in named lexicons
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-martian committed Jun 27, 2024
1 parent dae5c8f commit 98d02ce
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AC_PREREQ(2.61)

AC_INIT([lexd], [1.3.4], [[email protected]])
AC_INIT([lexd], [1.3.5], [[email protected]])
AM_INIT_AUTOMAKE
AC_CONFIG_MACRO_DIR([m4])

Expand Down
1 change: 1 addition & 0 deletions src/lexdcompiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1004,6 +1004,7 @@ LexdCompiler::processNextLine()
for(unsigned int i = 0; i < currentLexiconPartCount; i++)
{
entry.push_back(processLexiconSegment(iter, line, i));
if (*iter == "]") die("Unexpected closing bracket.");
}
if(*iter == ' ') ++iter;
if(!iter.at_end())
Expand Down
1 change: 1 addition & 0 deletions tests/feature/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ check-pos: $(foreach src,$(sources),$(O)/$(src).txt.strings.check)

negtests = \
col0 \
trailing-bracket \

negsources = $(foreach test,$(negtests),negtest-$(test).lexd)

Expand Down
5 changes: 5 additions & 0 deletions tests/feature/negtest-trailing-bracket.lexd
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
PATTERNS
X

LEXICON X
a]

0 comments on commit 98d02ce

Please sign in to comment.