-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split parser into php/php_only dialects with common files
- Loading branch information
Showing
48 changed files
with
147,336 additions
and
1,737 deletions.
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
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 @@ | ||
module.exports = require('./index').php; |
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 @@ | ||
module.exports = require('./index').php_only; |
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 |
---|---|---|
@@ -1,19 +1,29 @@ | ||
fn main() { | ||
let src_dir = std::path::Path::new("src"); | ||
let root_dir = std::path::Path::new("."); | ||
let php_dir = root_dir.join("php").join("src"); | ||
let php_only_dir = root_dir.join("php_only").join("src"); | ||
|
||
let mut c_config = cc::Build::new(); | ||
c_config.include(src_dir); | ||
c_config.include(&php_dir); | ||
c_config | ||
.flag_if_supported("-Wno-unused-parameter") | ||
.flag_if_supported("-Wno-unused-but-set-variable") | ||
.flag_if_supported("-Wno-trigraphs"); | ||
let parser_path = src_dir.join("parser.c"); | ||
c_config.file(&parser_path); | ||
|
||
let scanner_path = src_dir.join("scanner.c"); | ||
c_config.file(&scanner_path); | ||
println!("cargo:rerun-if-changed={}", scanner_path.to_str().unwrap()); | ||
for path in &[ | ||
php_dir.join("parser.c"), | ||
php_dir.join("scanner.c"), | ||
php_only_dir.join("parser.c"), | ||
php_only_dir.join("scanner.c"), | ||
] { | ||
c_config.file(&path); | ||
println!("cargo:rerun-if-changed={}", path.to_str().unwrap()); | ||
} | ||
|
||
println!("cargo:rerun-if-changed={}", parser_path.to_str().unwrap()); | ||
c_config.compile("parser"); | ||
println!( | ||
"cargo:rerun-if-changed={}", | ||
root_dir.join("common").join("scanner.h").to_str().unwrap() | ||
); | ||
|
||
c_config.compile("parser-scanner"); | ||
} |
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
Oops, something went wrong.