@@ -4,6 +4,7 @@ component {
4
4
variables .parser = " " ;
5
5
variables .isScript = false ;
6
6
variables .fileLength = 0 ;
7
+ variables .isComponentFile = false ;
7
8
8
9
function init (string filePath = " " , string fileContent = " " , string parser = " detect" ) {
9
10
if (len (arguments .fileContent ) == 0 && len (arguments .filePath ) > 0 ) {
@@ -25,6 +26,7 @@ component {
25
26
if (local .hasScriptComponentPattern && ! local .hasTagComponentPattern ) {
26
27
// script cfc
27
28
variables .isScript = true ;
29
+ variables .isComponentFile = true ;
28
30
29
31
} else if (local .hasTagComponentPattern && local .hasScriptComponentPattern ) {
30
32
@@ -39,17 +41,25 @@ component {
39
41
} else {
40
42
variables .isScript = false ;
41
43
}
42
-
44
+ variables . isComponentFile = true ;
43
45
} else {
44
46
// tag based file
45
47
variables .isScript = false ;
48
+ if (local .hasTagComponentPattern ) {
49
+ variables .isComponentFile = true ;
50
+ }
46
51
}
47
52
} else if (parser == " script" ) {
48
53
variables .isScript = true ;
54
+
49
55
} else {
50
56
variables .isScript = false ;
57
+
51
58
}
52
59
60
+ if (! variables .isComponentFile && right (arguments .filePath , 4 ) == " .cfc" ) {
61
+ variables .isComponentFile = true ;
62
+ }
53
63
54
64
55
65
if (variables .isScript ) {
@@ -86,6 +96,10 @@ component {
86
96
return variables .isScript ;
87
97
}
88
98
99
+ boolean function isComponentFile () {
100
+ return variables .isComponentFile ;
101
+ }
102
+
89
103
numeric function getLineNumber (numeric position ) {
90
104
return listLen (left (variables .fileContent , arguments .position ), chr (10 ), true );
91
105
}
0 commit comments