fc  

Re: [FC] PHP syntax in editor, and UTF-8

Krzysztof Trybowski
Wed, 07 May 2008 07:03:05 -0700

Hello Steven,
On Wednesday, May 7, 2008 Steven Grim wrote:
> Hi everyone,

> For the PHP highlighting, I have the following in my FCWSYNTAX
> file. I don't remember where I found it. I remember copying it from someone 
> about a year or more ago.

> ----8<----8<----8<----8<----8<----8<----8<----8<----8<----

> [PHP : *.{php,php4,php5}]
> wordchars : _

> words : keyword : \
>  NULL __FILE__ __FUNCTION__ __CLASS__ __METHOD__ __LINE__ and or \
>  xor exception array as break case class const continue declare \
>  default die do echo else elseif empty enddeclare endfor endforeach \
>  endif endswitch endwhile eval exit extends for foreach function \
>  global if include include_once isset list new print require \
>  require_once return static switch unset use var while final \
>  php_user_filter interface implements extends public private \
>  proteched abstract clone try catch throw cfunction old_function \
>  this true false parent self

> words : type : my our local

> symbols : operators : +-*/!%^&()=|[]{}<>?.,
> linecomment : comment : #
> string : string : "
> number : number 
> escape : \ :

> ----8<----8<----8<----8<----8<----8<----8<----8<----8<----


> Hope this helps. Enjoy.

> Steven

Nice!
Not bugless, but nice. What else you've got? CSS?

I improved your code a bit, so that it recognizes strings in
apostrophes and comments:

----8<----8<----8<----8<----8<----8<----8<----8<----8<----

[PHP : *.{php,php4,php5,phtml}]
wordchars : _

words : keyword : \
 NULL __FILE__ __FUNCTION__ __CLASS__ __METHOD__ __LINE__ and or \
 xor exception array as break case class const continue declare \
 default die do echo else elseif empty enddeclare endfor endforeach \
 endif endswitch endwhile eval exit extends for foreach function \
 global if include include_once isset list new print require \
 require_once return static switch unset use var while final \
 php_user_filter interface implements extends public private \
 proteched abstract clone try catch throw cfunction old_function \
 this true false parent self <?php <? ?>

words : type : my our local

symbols : operators : +-*/!%^&()=|[]<>?.,
linecomment : comment : #
linecomment : comment : //
blockcomment : comment : /* : */
string : string : "'
number : number 
escape : \ :
symbols : structure : {};

----8<----8<----8<----8<----8<----8<----8<----8<----8<----

-- 
Krzysztof Trybowski
  Gadu-Gadu: 1458144 --- Skype: trybowski
  AQQ: 141062 --- ICQ: 4350719 --- gpg key-id: 0xC937B0F2
Using FC 2.30-dev under Windows XP 5.1 build 2600.


_______________________________________________
Fc mailing list
Fc@silk.apana.org.au
http://silk.apana.org.au/mailman/listinfo/fc
Bug Tracker: http://bugs.silk.apana.org.au/