summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-02-08 16:16:49 +0100
committerTyge Løvset <[email protected]>2023-02-08 17:18:24 +0100
commitc4441f5fc665194fbd7a894a67a64a08c3beac42 (patch)
tree82f231b6e8fcb75625166f98aa785baaa265a3d6 /src
parent673dd5319a488d4b702b94dd9aeda4e497ae4fbc (diff)
downloadSTC-modified-c4441f5fc665194fbd7a894a67a64a08c3beac42.tar.gz
STC-modified-c4441f5fc665194fbd7a894a67a64a08c3beac42.zip
Changed to use lowercase flow-control macros in examples (uppercase will still be supported). Improved many examples to use c_make() to init containers.
Diffstat (limited to 'src')
-rw-r--r--src/checkauto.l40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/checkauto.l b/src/checkauto.l
index 4af35c49..3bb536a1 100644
--- a/src/checkauto.l
+++ b/src/checkauto.l
@@ -1,4 +1,4 @@
-/* Check for illegal return/break/continue usage inside a STC-lib c_AUTO* block (RAII).
+/* Check for illegal return/break/continue usage inside a STC-lib c_auto* block (RAII).
* Copyright Tyge Løvset, (c) 2023.
*/
%{
@@ -38,13 +38,13 @@ c_forfilter |
c_forwhile |
c_formatch |
c_fortoken |
-c_FOREACH |
-c_FORPAIR |
-c_FORRANGE |
-c_FORFILTER |
-c_FORWHILE |
-c_FORMATCH |
-c_FORTOKEN |
+c_foreach |
+c_forpair |
+c_forrange |
+c_forfilter |
+c_forwhile |
+c_formatch |
+c_fortoken |
for |
while |
switch { block_type |= LOOP; state = BRACES; }
@@ -53,10 +53,10 @@ c_with |
c_scope |
c_defer |
c_auto |
-c_WITH |
-c_SCOPE |
-c_DEFER |
-c_AUTO { block_type = AUTO; state = BRACES; }
+c_with |
+c_scope |
+c_defer |
+c_auto { block_type = AUTO; state = BRACES; }
\( { if (state == BRACES) ++braces_lev; }
\) { if (state == BRACES && --braces_lev == 0) {
state = BRACESDONE;
@@ -64,8 +64,8 @@ c_AUTO { block_type = AUTO; state = BRACES; }
}
if { if (state == BRACESDONE) {
if (block_type == AUTO) {
- printf("%s:%d: warning: 'if' after c_AUTO* not enclosed in curly braces.\n"
- " Make sure to enclose 'if - else' statement in { } after c_AUTO*.\n",
+ printf("%s:%d: warning: 'if' after c_auto* not enclosed in curly braces.\n"
+ " Make sure to enclose 'if - else' statement in { } after c_auto*.\n",
fname, yylineno);
++warnings;
}
@@ -81,20 +81,20 @@ if { if (state == BRACESDONE) {
\{ { if (state != BRACES) { block[++block_lev] = block_type; state = NORMAL; } }
\} { if (state != BRACES) block_type = block[--block_lev]; }
return { if (block_type == AUTO) {
- printf("%s:%d: error: 'return' used inside a c_AUTO* scope.\n"
- " Use 'continue' to exit the current c_AUTO* scope before return.\n"
+ printf("%s:%d: error: 'return' used inside a c_auto* scope.\n"
+ " Use 'continue' to exit the current c_auto* scope before return.\n"
, fname, yylineno);
++errors;
} else if (block_type & AUTO) {
- printf("%s:%d: error: 'return' used in a loop inside a c_AUTO* scope.\n"
- " Use 'break' to exit loop, then 'continue' to exit c_AUTO*.\n"
+ printf("%s:%d: error: 'return' used in a loop inside a c_auto* scope.\n"
+ " Use 'break' to exit loop, then 'continue' to exit c_auto*.\n"
, fname, yylineno);
++errors;
}
}
break { if (block_type == AUTO) {
- printf("%s:%d: error: 'break' used inside a c_AUTO* scope.\n"
- " Use 'continue' to exit the current c_AUTO* scope.\n"
+ printf("%s:%d: error: 'break' used inside a c_auto* scope.\n"
+ " Use 'continue' to exit the current c_auto* scope.\n"
, fname, yylineno);
++errors;
}