File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -4,16 +4,36 @@ import (
44 "bufio"
55 "fmt"
66 "os"
7+ "regexp"
78 "strings"
89)
910
1011var arguments []string = os .Args
1112var parserIsInsideVariableBlock bool = false
13+ var isErrorDetected bool = false
14+
15+ func isCamelCase (input string ) bool {
16+ expression := regexp .MustCompile (`^[a-z]+([A-Z][a-z]*)*$` )
17+ return expression .MatchString (input )
18+ }
1219
1320func handleLine (input string ) {
1421 inputWithoutWhiteSpaces := strings .ReplaceAll (input , " " , "" )
1522 if parserIsInsideVariableBlock {
16-
23+ if strings .Contains (inputWithoutWhiteSpaces , "LibVersion" ) ||
24+ strings .Contains (inputWithoutWhiteSpaces , "S7_SetPoint" ) {
25+ fmt .Printf ("System Call detected ignoring for now.\n " )
26+ return
27+ }
28+ if strings .Contains (inputWithoutWhiteSpaces , ":" ) {
29+ parts := strings .Split (inputWithoutWhiteSpaces , ":" )
30+ if isCamelCase (parts [0 ]) {
31+ fmt .Printf ("Success: Variable %s is camel case.\n " , parts [0 ])
32+ } else {
33+ fmt .Printf ("Error: Variable %s is not camel case.\n " , parts [0 ])
34+ }
35+ return
36+ }
1737 }
1838
1939 if inputWithoutWhiteSpaces == "VAR_INPUT" ||
You can’t perform that action at this time.
0 commit comments