Skip to content

Commit

Permalink
修复bug...
Browse files Browse the repository at this point in the history
  • Loading branch information
fengdeyingzi committed Sep 12, 2024
1 parent 8dd54e8 commit 9567c3d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
6 changes: 4 additions & 2 deletions bin/definetool.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import 'util/DefineTool.dart';
*/
void main(List<String> arguments) {
// #ifdef WEB
// #else
// #ifndef WEB
/**/// #endif

// #ifdef WINDOWS
/* print("Hello windows");*/
// #endif

Expand Down
26 changes: 14 additions & 12 deletions bin/util/DefineTool.dart
Original file line number Diff line number Diff line change
Expand Up @@ -281,15 +281,16 @@ class DefineTool {
if(keyWordItem.type == KeyWordType.TYPE_ANNOTATION){
//判断是否是ifdef
if(keyWordItem.word.contains("#ifdef")){
isContains = false;
defineState = 1;
List<String> dlist = keyWordItem.word.split(" ");
// print("dlist "+dlist.toString());
if(dlist.length>1){
for(int n=0;n<dlist.length;n++){
String define = dlist[n];
if(definesList.contains(define) && !isContains){
// List<String> dlist = keyWordItem.word.split(" ");
print("dlist "+ keyWordItem.word+","+definesList.toString());
if(definesList.length>=1){
for(int n=0;n<definesList.length;n++){
// String define = dlist[n];
if(keyWordItem.word.contains(definesList[n]) && !isContains){
isContains = true;
// print("isContains = true;");
print("isContains = true;");
}
}
//如果包含则对后面的内容去除注释
Expand All @@ -316,11 +317,12 @@ class DefineTool {
}
}else if(keyWordItem.word.contains("#ifndef")){
defineState = 2;
List<String> ndlist = keyWordItem.word.split(" ");
if(ndlist.length>1){
for(int n=0;n<ndlist.length;n++){
String define = ndlist[n];
if(definesList.contains(define) && !isContains){
isContains = false;
// List<String> ndlist = keyWordItem.word.split(" ");
if(definesList.length>=1){
for(int n=0;n<definesList.length;n++){
String define = definesList[n];
if(keyWordItem.word.contains(define) && !isContains){
isContains = true;
}
}
Expand Down

0 comments on commit 9567c3d

Please sign in to comment.