[Omake] Should we add some sort of "syntax" parser directive?
Aleksey Nogin
anogin at hrl.com
Tue Oct 30 14:19:33 PDT 2007
Jason,
I see that on the "syntax" branch, the transition into the program
syntax is done using the "program-syntax" directive. I am thinking that
perhaps we should create a more general mechanism for declaring the
syntax used by a particular file. The general mechanism could then also
be used to also declare the versions of the syntax to make it easier to
ensure that an unsupported syntax (e.g. a newer OMake file under an
older OMake program) would result in a meaningful error message, not in
a cryptic syntax error.
One possibility would be to use something like:
.SYNTAX: program #Use program syntax
.SYNTAX: make: 1 #Use legacy make-style syntax, requires support for rev
>=1 of the legacy syntax. Not sure what a good name for the legacy
syntax is.
.SYNTAX: make: 1-3 #Use legacy syntax, requires support for rev >=1 and
<=3 of legacy syntax
There are several advantages:
- The ".SYNTAX: ..." form would IMHO stand out a lot more than
"program-syntax" (we want to make it as obvious as possible which syntax
a certain file should use).
- If we start routinely using the ".SYNTAX: make" in the legacy files,
it would make it easier to make the program syntax be the default one in
certain cases (e.g. for osh).
If we settle on this approach, it would probably be a good idea to add
it to 0.9.8.x now to ensure that an attempt to use program syntax in a
any future pre-syntax version of OMake would result in a meaningful
error message.
Aleksey
--
Aleksey Nogin, Research Scientist
Advanced Technologies Department, Information & System Sciences Lab
HRL Laboratories, LLC, Malibu, CA
More information about the OMake-Devel
mailing list