diff --git a/docs/markdown/Syntax.md b/docs/markdown/Syntax.md index efb12e4ca..ff4c14286 100644 --- a/docs/markdown/Syntax.md +++ b/docs/markdown/Syntax.md @@ -354,11 +354,34 @@ else endif opt = get_option('someoption') -if opt == 'foo' +if opt != 'foo' do_something() endif ``` +Logical operations +-- + +Meson has the standard range of logical operations which can be used in +`if` statements. + +```meson +if a and b + # do something +endif +if c or d + # do something +endif +if not e + # do something +endif +if not (f or g) + # do something +endif +``` + +Logical operations work only on boolean values. + ## Foreach statements To do an operation on all elements of an iterable, use the `foreach` @@ -409,28 +432,6 @@ foreach name, sources : components endforeach ``` -Logical operations --- - -Meson has the standard range of logical operations. - -```meson -if a and b - # do something -endif -if c or d - # do something -endif -if not e - # do something -endif -if not (f or g) - # do something -endif -``` - -Logical operations work only on boolean values. - Comments --