Remove EXTERN_C macros and use block based solution

Related issue: #900

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
This commit is contained in:
László Langó
2016-02-18 11:34:51 +00:00
parent b2edaafaa1
commit a0bedaa43d
14 changed files with 140 additions and 206 deletions
@@ -17,7 +17,7 @@
foreach fileName [getSourceFileNames] {
set funcStart 0
set funcName {}
set funcName ""
set lineNumber 1
foreach line [getAllLines $fileName] {
if {[regexp {^((static |const )*\w+ )*\w+ \(.*[,\)]} $line]} {
@@ -33,17 +33,17 @@ foreach fileName [getSourceFileNames] {
}
if {$funcStart == 1} {
if {[regexp {^\}$} $line]} {
if {[regexp {^\}$} $line] && [string length $funcName] != 0} {
report $fileName $lineNumber "missing comment at the end of function: /* $funcName */"
set funcStart 0
} elseif {[regexp {^\} /\*\s*\w+\s*\*/$} $line]} {
} elseif {[regexp {^\} /\*\s*\w+\s*\*/$} $line] && [string length $funcName] != 0} {
set comment {}
regexp {^\} /\*\s*(\w+)\s*\*/$} $line -> comment
if {$comment != $funcName} {
report $fileName $lineNumber "comment missmatch. (Current: $comment, Expected: $funcName)"
report $fileName $lineNumber "comment missmatch. (Current: $comment, Expected: $funcName) "
}
set funcStart 0
} elseif {[regexp {^\}.*;$} $line]} {
} elseif {[regexp {^\}.*;?$} $line]} {
set funcStart 0
}
}
@@ -1,6 +1,7 @@
#!/usr/bin/tclsh
# Copyright 2014-2015 Samsung Electronics Co., Ltd.
# Copyright 2014-2016 Samsung Electronics Co., Ltd.
# Copyright 2016 University of Szeged.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -52,7 +53,7 @@ foreach fileName [getSourceFileNames] {
set lastCheckedLineNumber $lineNumber
} elseif {$type == "space"} {
} elseif {$type != "eof"} {
if {$type == "rightbrace"} {
if {$type == "rightbrace" && $indent > 0} {
incr indent -2
}
@@ -100,7 +101,9 @@ foreach fileName [getSourceFileNames] {
}
if {$type == "leftbrace"} {
incr indent 2
if {![regexp {^extern "C"} [getLine $fileName [expr {$lineNumber - 1}]]]} {
incr indent 2
}
} elseif {$type == "leftparen"} {
incr parentheses_level 1
} elseif {$type == "rightparen"} {