Write initial code for matching the patterns to a single string.

The code is limited in two aspects, at the moment:
* It's not very well tested
* The current "best" match is just the one that occurred last. While
this is just fine in terms of length, this leaves open to chance which
pattern type will be returned if multiple patterns of the same length
match.
This commit is contained in:
2017-02-04 00:28:36 -08:00
parent d753bbe1ab
commit 0b6d73ebdf
3 changed files with 306 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 2.7)
project(liblex)
add_library(lex STATIC src/pattern.c src/pairmap.c)
add_library(lex STATIC src/pattern.c src/pairmap.c src/eval.c)
add_executable(liblex src/main.c)
add_subdirectory(external/libds)