07-28-2004, 07:19 AM
I was wondering if this was true in all programming languages.
In languages where the code (in particular, the code I would want to highlight) can "start" and "stop" at certain places in the file, for example PHP:
and in HTML:
In PHP, multiline comments seem to have top priority. So if you have a <?php or a ?> inside a multiline comment it is ignored, however even in a single line comment if there is a ?> mark then code interpretation stops. And in HTML, < and > marks inside <!-- comments are ignored.
Is this true of any language like this? Do multiline comments seem to have "top priority" in this respect? Does anyone know a language where even single line comments have this ability?
In languages where the code (in particular, the code I would want to highlight) can "start" and "stop" at certain places in the file, for example PHP:
Code:
<?php
// code
?>
<!-- HTML here
<?php
// more php
?>
and in HTML:
Code:
<html highlightthis="yesplease">Don't highlight this</html>
In PHP, multiline comments seem to have top priority. So if you have a <?php or a ?> inside a multiline comment it is ignored, however even in a single line comment if there is a ?> mark then code interpretation stops. And in HTML, < and > marks inside <!-- comments are ignored.
Is this true of any language like this? Do multiline comments seem to have "top priority" in this respect? Does anyone know a language where even single line comments have this ability?