macMikey / LCB-missing-manual

I'm trying to learn LCB, again, but the docs are thin.
MIT License
4 stars 4 forks source link

warnings also stop compilation #12

Closed macMikey closed 2 years ago

macMikey commented 2 years ago

Are warnings also supposed to prevent a compile/build? They do. Example:

LC-NavRad/navrad.lcb:1912:11: warning: All-lowercase name 'i' may cause future syntax error
  variable i as Integer
           ^
LC-NavRad/navrad.lcb:1914:11: warning: All-lowercase name 'items' may cause future syntax error
  variable items as Array
           ^
12:00 PM: Error: failed to compile module
12:00 PM: Error: Could not compile module LC-NavRad
bwmilby commented 2 years ago

LCB style guide indicates that the first char of a variable indicates scope (t, p, ...), so if using that convention then a variable will be at least 2 char and the first will be lower case.

Here's the code I added:

public handler onTest()
    variable i as Integer
end handler

Here's the compile result:

6:37 PM: Compiling module /Users/milby/GitHub/livecode/extensions/widgets/pinkcircle/pinkcircle.lcb 6:37 PM: /Users/milby/GitHub/livecode/extensions/widgets/pinkcircle/pinkcircle.lcb:50:11: warning: All-lowercase name 'i' may cause future syntax error variable i as Integer ^

6:37 PM: Launching in Test Window

I made a change to the code to verify that it did compile.

macMikey commented 2 years ago

I know, and if I was to adhere to every style guide for every language I use, instead of stealing the best ideas from each... It's interesting that yours launched the test window, when mine didn't.