cobra -correct-source ...
Posted: Sun Nov 07, 2010 2:34 pm
Suppose you have a file named MyProgram.cobra like so:
Cobra is case-sensitive so the line "get name as string" will give an error:
MyProgram.cobra: error: Cannot find type for "string". Try "String". Also, consider the -correct-source option (see cobra -h for details).
Leave the source in its bad state and try compiling again with the -correct-source option:
cobra -c -correct-source MyProgram.cobra
You will get no error:
Compilation succeeded
And you will find that the compiler wrote back the source code file with "String":
This works best when you can configure your editor to automatically reload files that have changed.
If you have any questions, let me know.
class MyProgram
def main
print 'Hello, [.name]'
get name as string
return 'world'
Cobra is case-sensitive so the line "get name as string" will give an error:
MyProgram.cobra: error: Cannot find type for "string". Try "String". Also, consider the -correct-source option (see cobra -h for details).
Leave the source in its bad state and try compiling again with the -correct-source option:
cobra -c -correct-source MyProgram.cobra
You will get no error:
Compilation succeeded
And you will find that the compiler wrote back the source code file with "String":
class MyProgram
def main
print 'Hello, [.name]'
get name as String
return 'world'
This works best when you can configure your editor to automatically reload files that have changed.
If you have any questions, let me know.