diff options
author | Daniel Mensinger <daniel@mensinger-ka.de> | 2019-03-02 11:45:26 +0100 |
---|---|---|
committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2019-03-04 13:00:06 +0100 |
commit | c98987c19efabac06296c0e65692b7822db95a72 (patch) | |
tree | 5534ebaa9b716fe8a3b35de2e0dbd15bca574dac /docs/markdown/Rewriter.md | |
parent | eabc35340dc0fd63d70058f93c94674bc7782c19 (diff) | |
download | meson-c98987c19efabac06296c0e65692b7822db95a72.zip meson-c98987c19efabac06296c0e65692b7822db95a72.tar.gz meson-c98987c19efabac06296c0e65692b7822db95a72.tar.bz2 |
rewriter: Fixed docs.
Diffstat (limited to 'docs/markdown/Rewriter.md')
-rw-r--r-- | docs/markdown/Rewriter.md | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/docs/markdown/Rewriter.md b/docs/markdown/Rewriter.md index 4550170..46b117e 100644 --- a/docs/markdown/Rewriter.md +++ b/docs/markdown/Rewriter.md @@ -99,10 +99,48 @@ For setting and deleting default options, use the following command: meson rewrite default-options {set/delete} <opt1> <value1> <opt2> <value2> ... ``` +## Limitations + +Rewriting a meson file is not guranteed to keep the indentation of the modified +functions. Additionally, comments inside a modified statement will be removed. +Furthermore, all source files will be sorted alphabetically. + +For instance adding `e.c` to srcs in the following code + +```meson +# Important comment + +srcs = [ +'a.c', 'c.c', 'f.c', +# something important about b + 'b.c', 'd.c', 'g.c' +] + +# COMMENT +``` + +would result in the following code: + +```meson +# Important comment + +srcs = [ + 'a.c', + 'b.c', + 'c.c', + 'd.c', + 'e.c', + 'f.c', + 'g.c' +] + +# COMMENT +``` + ## Using the "script mode" -The "script mode" should be the preferred API for party programs, since it -offers more flexibility and higher API stability. The "scripts" are stored +The "script mode" should be the preferred API for third party programs, since +it offers more flexibility and higher API stability. The "scripts" are stored in JSON format and executed with `meson rewrite command <JSON file or string>`. The JSON format is defined as follows: |