ether-code 0.4.4 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/compiler.js +9 -4
- package/cli/ether.js +1 -1
- package/package.json +1 -1
package/cli/compiler.js
CHANGED
|
@@ -145,17 +145,22 @@ class EtherCompiler {
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
detectTarget(content, filePath) {
|
|
148
|
-
const
|
|
148
|
+
const atMatch = content.match(/^@(?:cible|target)\s*:\s*(\w+)/im)
|
|
149
|
+
if (atMatch) {
|
|
150
|
+
return atMatch[1].toLowerCase()
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const directiveMatch = content.match(/^\/\/\s*(?:cible|target|@cible|@target)\s*:\s*(\w+)/im)
|
|
149
154
|
if (directiveMatch) {
|
|
150
155
|
return directiveMatch[1].toLowerCase()
|
|
151
156
|
}
|
|
152
157
|
|
|
153
|
-
const commentMatch = content.match(/^\/\*\s*(?:cible|target)\s*:\s*(\w+)\s*\*\//im)
|
|
158
|
+
const commentMatch = content.match(/^\/\*\s*(?:cible|target|@cible|@target)\s*:\s*(\w+)\s*\*\//im)
|
|
154
159
|
if (commentMatch) {
|
|
155
160
|
return commentMatch[1].toLowerCase()
|
|
156
161
|
}
|
|
157
162
|
|
|
158
|
-
const hashMatch = content.match(/^#\s*(?:cible|target)\s*:\s*(\w+)/im)
|
|
163
|
+
const hashMatch = content.match(/^#\s*(?:cible|target|@cible|@target)\s*:\s*(\w+)/im)
|
|
159
164
|
if (hashMatch) {
|
|
160
165
|
return hashMatch[1].toLowerCase()
|
|
161
166
|
}
|
|
@@ -249,4 +254,4 @@ class EtherCompiler {
|
|
|
249
254
|
}
|
|
250
255
|
}
|
|
251
256
|
|
|
252
|
-
module.exports = { EtherCompiler, GENERATORS, TARGET_EXTENSIONS }
|
|
257
|
+
module.exports = { EtherCompiler, GENERATORS, TARGET_EXTENSIONS }
|
package/cli/ether.js
CHANGED