This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 123
TOML storage plugin #3292
Merged
Merged
TOML storage plugin #3292
Changes from all commits
Commits
Show all changes
190 commits
Select commit
Hold shift + click to select a range
598c80c
toml: setting plugin up
bauhaus93 b1ba555
toml: Created basic README
bauhaus93 b281217
toml: Further setup
bauhaus93 3da5e79
toml: changes in driver, parser
bauhaus93 b4c2951
toml: Some grammar fixes, Simple table key gen
bauhaus93 7020821
toml: Added arrays
bauhaus93 131c144
toml: Working on array tables
bauhaus93 15f66be
toml: Further table array implementation
bauhaus93 0ad56f9
toml: Work on table arrays
bauhaus93 065ca8d
toml: Finally found a decent table array solution
bauhaus93 6c9be90
toml: fixed table array meta key, improved tests
bauhaus93 b6debd6
toml: Fixed missing KEY_END
bauhaus93 1d56e06
toml: Added inline tables, restructured tests
bauhaus93 4649ad2
toml: Added empty inline table
bauhaus93 914f530
toml: Added test for table arrays with tables
bauhaus93 1336e19
toml: Added tests for multiline values in inline tables
bauhaus93 c186d6c
toml: Added test cases for comments
bauhaus93 0e33d79
toml: Working on comments
bauhaus93 17a1317
toml: Further work on comments
bauhaus93 067a534
toml: Added comments for arrays
bauhaus93 1117df0
toml: Added trailing comments
bauhaus93 e86526f
toml: Fixed keygen in table array, fixed tests
bauhaus93 f2f3897
toml: Fixed comment test
bauhaus93 640a9a3
toml: changed recognition of tables
bauhaus93 dc520c8
toml: Fixed on testcase, simplified table array driver function
bauhaus93 ec1a800
toml: Fixed table array key emission, fixed test
bauhaus93 2a067c8
toml: Added more clear exitKey function
bauhaus93 1966426
toml: Added check/error on duplicate key names
bauhaus93 d97a9a7
toml: Lexer now propagates errors to driver
bauhaus93 e7ab73f
toml: Working on date validation
bauhaus93 c87b0bb
toml: Fixed incorrect simple table keygen
bauhaus93 932e559
toml: Last error now saved in driver
bauhaus93 bfb268b
toml: Added tests for utf8
bauhaus93 27501b6
toml: Added tests for multiline strings
bauhaus93 f41f0bb
toml: Disallowed leading commas in inline tables
bauhaus93 86b4753
toml: Further datetime validation
bauhaus93 8204bf4
toml: Fixed some compiler warnings
bauhaus93 1f8316a
toml: Working on array parsing
bauhaus93 0356645
toml: Working on trailing commas in arrays
bauhaus93 bc2d2c4
toml: Trailing array comma solved
bauhaus93 502a79a
toml: Some cleanup
bauhaus93 ed051f0
toml: Adding order metakey. Tests must be adapted
bauhaus93 0185454
toml: Reformatted code
bauhaus93 06a7636
toml: Fixing tests with order metakey
bauhaus93 4c1b687
toml: Fixed last tests for order
bauhaus93 3e4cb49
toml: Code restructuration
bauhaus93 72598b4
toml: Moved table array function into own file
bauhaus93 65c356a
toml: Changes in lastScalar functions
bauhaus93 d330744
toml: Fixed reduce/reduce conflict
bauhaus93 d019d96
toml: Fixed empty table array index
bauhaus93 edfe49e
toml: Undone table array index change.
bauhaus93 54aef59
toml: Added some basic tests
bauhaus93 b4996d1
toml: Changes in error handling.
bauhaus93 dd513f5
toml: Found correct error emission
bauhaus93 ba922ea
toml: Added infrastructure for testing errors
bauhaus93 3899dea
toml: Added negative tests
bauhaus93 477313d
toml: Fixes in lexing/parsing
bauhaus93 b48993a
toml: Reformatted code
bauhaus93 c5ba685
toml: Fixed segfault due to previous changes
bauhaus93 e522377
toml: Working on value translations
bauhaus93 f19b767
toml: Replaced some mallocs, added checks for failed allocation
bauhaus93 c6b1e91
toml: Replaced mallocs/frees in lexer
bauhaus93 84e7d14
toml: Added checks for NULL scalars
bauhaus93 1fbbe16
toml: Added test case for float as key, fixed bug
bauhaus93 cc98987
toml: Added unicode escape tests, fixed unicode escaping
bauhaus93 fc72492
toml: Added 'check/type' and 'origvalue' metakeys
bauhaus93 cb697fb
toml: Reformatted lexer, parser
bauhaus93 4eb5f4e
toml: Redone reading of strings in lexer. Lexer now includes string q…
bauhaus93 3395037
toml: Replaced strlen,strcmp,strdup with elektras equivalents
bauhaus93 6b76f50
toml: Replaced asserts with elektra equivalent
bauhaus93 2dc6f91
toml: Fixing memleaks
bauhaus93 d5623f2
toml: Fixed another memleak
bauhaus93 7ec423c
toml: Moved utf8/unicode stuff into own file
bauhaus93 c97eee9
toml: Started working on writing
bauhaus93 03275b8
toml: Further work on writing
bauhaus93 766cf98
toml: Reworked some write code
bauhaus93 7157a92
toml: Basic array writing done
bauhaus93 3bd0940
toml: Work done on basic simple table writing
bauhaus93 49a05d5
toml: Working on handling of empty table array elements
bauhaus93 115b1c7
toml: basic table array write done
bauhaus93 35aceba
toml: added basic inline table writing
bauhaus93 7a7610f
toml: Started on comment writing
bauhaus93 0f59255
toml: Further work on comment writing
bauhaus93 8cf4908
toml: added comment writing to arrays
bauhaus93 741ae19
toml: moved some functions
bauhaus93 876ff4a
toml: added writing of document ending comments
bauhaus93 5d1605a
toml: Working on whitespace preservation
bauhaus93 5997374
toml: adapting grammar for whitespaces
bauhaus93 4519e29
toml: Further grammar adaption
bauhaus93 ee35d08
toml: Comment leading spaces now preserved.
bauhaus93 1dac0f7
toml: Some fixes to get error msg printed
bauhaus93 2949bc1
toml: trying some fixes
bauhaus93 e99e7a7
toml: Small changes
bauhaus93 528efdc
toml: various fixes for reading/writing
bauhaus93 11c1b2b
toml: added check for writing floats
bauhaus93 7e5d8de
toml: update readme
bauhaus93 e47c2b3
toml: working on getting tests running again
bauhaus93 aed173e
toml: tests running again
bauhaus93 b1aa559
toml: Now supporting null keys
bauhaus93 d0a6c69
toml: updated readme
bauhaus93 3f031c2
toml: Fixes in writing
bauhaus93 4c942dd
toml: Working on array writing
bauhaus93 cc4ab58
toml: fixed some array writing
bauhaus93 cb54dd9
toml: added date checking on write
bauhaus93 fe68e3d
toml: adding tests for writeReads
bauhaus93 42d793a
toml: reformatted some code
bauhaus93 4a229b9
toml: now using order on write
bauhaus93 c43a771
toml: No longer emitting type metakeys, fixed nested arrays
bauhaus93 7c8fa1c
toml: Small change in assertion
bauhaus93 c53456f
toml: removde unused var
bauhaus93 ef4d7cf
toml: Removed unused var
bauhaus93 ab1c73e
toml: fixed order
bauhaus93 c06c108
toml: another fix in order, fixed tests
bauhaus93 a06d33a
toml: removed some printfs
bauhaus93 d08987f
toml: replaced usage of keyRel
bauhaus93 532d183
toml: fixed some comment preservation
bauhaus93 a87fb97
toml: Fixed boolean writing (now priortized over plain number)
bauhaus93 422e8ca
toml: fixed boolean being written too deliberate
bauhaus93 55a9941
toml: removed some file emission
bauhaus93 c0c5357
toml: fixed type function
bauhaus93 1fcea7c
scripts: Flex now installed in Dockerfiles
bauhaus93 e68ddab
toml: Fixed space restoration
bauhaus93 5ff0a2c
toml: Fixed table writing
bauhaus93 d51baee
toml: replaced occurences of old keyRel
bauhaus93 830ad2f
toml: Fixed old usage of ELEKTRA_SET_OUT_OF_MEMORY_ERROR
bauhaus93 40d6840
toml: Fixed bison CMake options
bauhaus93 e099428
toml: various fixes
bauhaus93 1a96d61
toml: Proper multiline string write handling, moved tests
bauhaus93 4c99f79
toml: Fixed illegal newlines in strings
bauhaus93 2b15bc3
toml: Fixed lexer state between yylex calls
bauhaus93 4ee0e9c
toml: Added doc concerning strings
bauhaus93 0a5a5c2
toml: Some restructuration in errors
bauhaus93 417cca1
toml: added directoryvalue, base64, null plugins to needs
bauhaus93 41a91ca
toml: Removed old handling of null keys
bauhaus93 826bde3
toml: Working on sorting of array elements
bauhaus93 d173c23
toml: Further work on sorting array elements
bauhaus93 3270997
toml: Further array sorting work
bauhaus93 88cb985
toml: table array elements now sorted by order
bauhaus93 40a40e9
toml: Some tweaks, maybe will change sorting now
bauhaus93 d339501
toml: Rewrote writing process
bauhaus93 5635372
toml: Added wr tests for comments. Fixed comment error.
bauhaus93 5117311
toml: Added tests for simple table/table array interaction
bauhaus93 2a5ae0a
toml: Added wr test for inline tables in arrays
bauhaus93 e61a5b0
toml: Added test for alternating array/inline table
bauhaus93 bb6c4c5
toml: Moved function from node to util, removed some printfs
bauhaus93 b3f9fca
toml: Added tomltype to METADATA.ini
bauhaus93 58d748e
toml: Added doc, fixed possible ordering messup
bauhaus93 d844990
toml: Fixed some doc
bauhaus93 60ebda7
toml: Removed some printfs
bauhaus93 2dd2e72
toml: Small Readme change, added missing include
bauhaus93 8725c96
toml: Added doc for table array
bauhaus93 cd241c1
toml: Added doc for three source files
bauhaus93 d365427
toml: Removed unused function
bauhaus93 316c44b
toml: Reformatted README
bauhaus93 b08a9b4
toml: Reformatted README with script
bauhaus93 908cccc
toml: Reformatted CMakeLists
bauhaus93 e7e0749
toml: Removed some memleaks
bauhaus93 3bb4fe9
toml: Fixed memleak
bauhaus93 27fc2d9
toml: Fixed memleaks
bauhaus93 6b3071a
toml: Reformatted source files
bauhaus93 65731a7
toml: Fixed some implicit conversions
bauhaus93 1e07a08
man: Updated man pages
bauhaus93 ba10bb4
toml: Set minimum requirements for flex
bauhaus93 dfd4e3b
toml: Replaced lexer restart, removed unused test
bauhaus93 67e9c49
libs: Fixed #3274
bauhaus93 92be541
libs: Reformatted code
bauhaus93 bf10a82
Update scripts/docker/debian/stretch/Dockerfile
mpranj fcedc17
Update scripts/docker/debian/buster/Dockerfile
mpranj f188fbf
Update scripts/docker/debian/sid/Dockerfile
mpranj 000fe2a
Update scripts/docker/debian/stretch/Dockerfile
mpranj fc809cc
toml: Added memleak status
bauhaus93 bd122c9
toml: reformatted code
bauhaus93 7bf1600
toml: Probably fixed the remaining memleak
bauhaus93 b8f3e8a
toml: Fixed implicit call
bauhaus93 86b82d7
toml: Some README additions
bauhaus93 0c0e8d2
toml: Fixed incorrect example
bauhaus93 10cf736
toml: Added doc for inline tables and arrays
bauhaus93 b3e4624
toml: Replaced cursor_t occurences with elektraCursor
bauhaus93 6ca02dd
toml: Fixed array indices not getting updated
bauhaus93 2fcaef2
toml: Fixed writing of incomplete comment info.
bauhaus93 7fd8a62
toml: Added documentation
bauhaus93 81bf64d
toml: Fixed readme, added release note
bauhaus93 33028df
toml: Fixed README
bauhaus93 a8ae3d6
toml: Another README restyle
bauhaus93 a0f9585
scripts: Added Flex to cirrus/travis targets.
bauhaus93 3326d32
toml: Added homebrew flex handler in cmake
bauhaus93 66cbf47
docker: updated fedora dockerfile with flex/bison.
bauhaus93 ee9b9cd
toml: Fixed error in table array comments.
bauhaus93 95a6bbf
Update scripts/docker/cirrus/fedora/Dockerfile
bauhaus93 100a34d
Update scripts/docker/cirrus/fedora/Dockerfile
bauhaus93 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,6 +163,7 @@ matrix: | |
- bison | ||
- dbus | ||
- discount | ||
- flex | ||
- gpgme | ||
- libev | ||
- libgcrypt | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ RUN apk update \ | |
curl \ | ||
diffutils \ | ||
file \ | ||
flex \ | ||
git \ | ||
gtest-dev \ | ||
ninja \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
function (check_dependencies) | ||
set ( | ||
FOUND_DEPENDENCIES | ||
FALSE | ||
PARENT_SCOPE) | ||
|
||
set (USE_HOMEBREW_FLEX ${APPLE} AND EXISTS /usr/local/opt/flex) | ||
if (USE_HOMEBREW_FLEX) | ||
list (APPEND CMAKE_PREFIX_PATH "/usr/local/opt/flex") | ||
endif (USE_HOMEBREW_FLEX) | ||
find_package (FLEX 2.6.2 QUIET) | ||
|
||
set (USE_HOMEBREW_BISON ${APPLE} AND EXISTS /usr/local/opt/bison) | ||
if (USE_HOMEBREW_BISON) | ||
list (APPEND CMAKE_PREFIX_PATH "/usr/local/opt/bison") | ||
endif (USE_HOMEBREW_BISON) | ||
find_package (BISON 3 QUIET) | ||
|
||
if ((NOT FLEX_FOUND) AND (NOT BISON_FOUND)) | ||
set ( | ||
FAILURE_MESSAGE | ||
"Flex and Bison could not be found" | ||
PARENT_SCOPE) | ||
return () | ||
endif ((NOT FLEX_FOUND) AND (NOT BISON_FOUND)) | ||
if (NOT FLEX_FOUND) | ||
set ( | ||
FAILURE_MESSAGE | ||
"Flex could not be found" | ||
PARENT_SCOPE) | ||
return () | ||
endif (NOT FLEX_FOUND) | ||
if (NOT BISON_FOUND) | ||
set ( | ||
FAILURE_MESSAGE | ||
"Bison could not be found" | ||
PARENT_SCOPE) | ||
return () | ||
endif (NOT BISON_FOUND) | ||
|
||
set ( | ||
FOUND_DEPENDENCIES | ||
TRUE | ||
PARENT_SCOPE) | ||
endfunction (check_dependencies) | ||
|
||
function (generate_code) | ||
set ( | ||
GENERATED_CODE | ||
FALSE | ||
PARENT_SCOPE) | ||
|
||
flex_target (TOMLScanner ${CMAKE_CURRENT_SOURCE_DIR}/lexer.l ${CMAKE_CURRENT_BINARY_DIR}/lexer.c) | ||
bison_target (TOMLParser ${CMAKE_CURRENT_SOURCE_DIR}/parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.c VERBOSE bison_verbose.txt) | ||
add_flex_bison_dependency (TOMLScanner TOMLParser) | ||
|
||
if ((NOT FLEX_TOMLScanner_DEFINED) AND (NOT BISON_TOMLParser_DEFINED)) | ||
set ( | ||
FAILURE_MESSAGE | ||
"Flex and Bison code could not be generated" | ||
PARENT_SCOPE) | ||
return () | ||
endif ((NOT FLEX_TOMLScanner_DEFINED) AND (NOT BISON_TOMLParser_DEFINED)) | ||
if (NOT FLEX_TOMLScanner_DEFINED) | ||
set ( | ||
FAILURE_MESSAGE | ||
"Flex code could not be generated" | ||
PARENT_SCOPE) | ||
return () | ||
endif (NOT FLEX_TOMLScanner_DEFINED) | ||
if (NOT BISON_TOMLParser_DEFINED) | ||
set ( | ||
FAILURE_MESSAGE | ||
"Bison code could not be generated" | ||
PARENT_SCOPE) | ||
return () | ||
endif (NOT BISON_TOMLParser_DEFINED) | ||
|
||
set ( | ||
FLEX_OUTPUT_SOURCE | ||
${FLEX_TOMLScanner_OUTPUTS} | ||
PARENT_SCOPE) | ||
set ( | ||
FLEX_OUTPUT_HEADER | ||
${FLEX_TOMLScanner_OUTPUT_HEADER} | ||
PARENT_SCOPE) | ||
set ( | ||
BISON_OUTPUT_SOURCE | ||
${BISON_TOMLParser_OUTPUT_SOURCE} | ||
PARENT_SCOPE) | ||
set ( | ||
BISON_OUTPUT_HEADER | ||
${BISON_TOMLParser_OUTPUT_HEADER} | ||
PARENT_SCOPE) | ||
|
||
set ( | ||
GENERATED_CODE | ||
TRUE | ||
PARENT_SCOPE) | ||
|
||
endfunction (generate_code) | ||
|
||
if (DEPENDENCY_PHASE) | ||
|
||
check_dependencies () | ||
if (NOT FOUND_DEPENDENCIES) | ||
remove_plugin (toml ${FAILURE_MESSAGE}) | ||
else (NOT FOUND_DEPENDENCIES) | ||
generate_code () | ||
if (NOT GENERATED_CODE) | ||
remove_plugin (toml ${FAILURE_MESSAGE}) | ||
endif (NOT GENERATED_CODE) | ||
endif (NOT FOUND_DEPENDENCIES) | ||
|
||
set ( | ||
SOURCE_FILES | ||
toml.h | ||
toml.c | ||
driver.h | ||
driver.c | ||
scalar.h | ||
scalar.c | ||
table_array.h | ||
table_array.c | ||
comment_list.h | ||
comment_list.c | ||
codepoint.h | ||
codepoint.c | ||
utility.h | ||
utility.c | ||
write.h | ||
write.c | ||
node.h | ||
node.c | ||
prepare.c | ||
prepare.h | ||
type.h | ||
type.c | ||
error.h | ||
error.c | ||
${FLEX_OUTPUT_HEADER} | ||
${FLEX_OUTPUT_SOURCE} | ||
${BISON_OUTPUT_HEADER} | ||
${BISON_OUTPUT_SOURCE}) | ||
|
||
endif (DEPENDENCY_PHASE) | ||
|
||
add_plugin ( | ||
toml ADD_TEST INSTALL_TEST_DATA | ||
LINK_ELEKTRA elektra-meta | ||
SOURCES ${SOURCE_FILES} | ||
INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer if it is directly integrated in the types of Elektra (type, enum, array) and only for the tables there is some internal/toml/type or we even add the "tables" to standardtypes. I would prefer the name "section" though (similar to array as extra meta-data).