Skip to content

Commit

Permalink
add support for Meson (XAMPPRocky#169)
Browse files Browse the repository at this point in the history
* add support for Meson

Fixes: XAMPPRocky#168
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>

* tests: add meson.build

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>

* remove unused variable

warning: unused variable: `key`
  --> build.rs:31:10
   |
31 |     for (key, ref mut item) in json.get_mut("languages")
   |          ^^^
   |
   = note: #[warn(unused_variables)] on by default
   = note: to avoid this warning, consider using `_key` instead

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
  • Loading branch information
Igor Gnatenko authored and Aaronepower committed Jan 27, 2018
1 parent 553736f commit 01791bd
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ Lucius
Madlang
Makefile
Markdown
Meson
ModuleDef
Mustache
Nim
Expand Down
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn generate_languages(out_dir: &OsStr) {
serde_json::from_reader(json).expect("Can't parse json")
};

for (key, ref mut item) in json.get_mut("languages")
for (_key, ref mut item) in json.get_mut("languages")
.unwrap()
.as_object_mut()
.unwrap()
Expand Down
13 changes: 13 additions & 0 deletions languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,19 @@
"extensions": ["def"],
"line_comment": [";"]
},
"Meson":{
"line_comment":[
"#"
],
"quotes":[
["'", "'"],
["'''", "'''"]
],
"filenames":[
"meson.build",
"meson_options.txt"
]
},
"Mustache":{
"multi_line":[
["{{!", "}}"]
Expand Down
12 changes: 12 additions & 0 deletions tests/data/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 12 lines 6 code 2 comments 4 blanks

project('xyz', 'c',
meson_version : '>=0.30.0') # not counted

xyz_gen = '''
# comment inside
print("This is generated source.")
'''

# this is a comment

0 comments on commit 01791bd

Please sign in to comment.