diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-02-17 10:58:07 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-17 10:58:07 +0000 |
commit | 752bf6c80a922e09edf5bcb53e15e08e83057a7f (patch) | |
tree | 0968dcfc9a8ccc858a5aa5531463cc50a713eab4 /gcc/rust/rust-lang.cc | |
parent | 6a6c21709314e72f2edb5539913a4b7ce7a1cb66 (diff) | |
parent | 766a9002a3d5fb6701de2d84ce689379811eabff (diff) | |
download | gcc-752bf6c80a922e09edf5bcb53e15e08e83057a7f.zip gcc-752bf6c80a922e09edf5bcb53e15e08e83057a7f.tar.gz gcc-752bf6c80a922e09edf5bcb53e15e08e83057a7f.tar.bz2 |
Merge #935
935: frust-cfg: Only allow double quoted values r=philberty a=CohenArthur
Closes #910
This PR separates the `handle_cfg_option()` function in two, separating the parsing logic from the session logic. The parsing logic is able to be unit tested, and now only allows quoted values.
What remains to be done is to only allow `key` and `value` to be proper rust identifiers. We need to figure out if we'd like to spawn a parser here and parse identifiers, or simply sanitize both strings to make sure they do not contain invalid characters.
Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
Diffstat (limited to 'gcc/rust/rust-lang.cc')
-rw-r--r-- | gcc/rust/rust-lang.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/rust/rust-lang.cc b/gcc/rust/rust-lang.cc index fbab9b1..5ecd79b 100644 --- a/gcc/rust/rust-lang.cc +++ b/gcc/rust/rust-lang.cc @@ -33,6 +33,7 @@ #include "langhooks.h" #include "langhooks-def.h" #include "selftest.h" +#include "rust-cfg-parser.h" #include <mpfr.h> // note: header files must be in this order or else forward declarations don't @@ -453,6 +454,7 @@ run_rust_tests () { // Call tests for the rust frontend here simple_assert (); + rust_cfg_parser_test (); } } // namespace selftest |