From 9f6e54e92820754d4f05e7d6ef556c11c5351411 Mon Sep 17 00:00:00 2001 From: murphy Date: Tue, 20 Oct 2009 11:12:26 +0000 Subject: Updated PHP scanner (#36) * highlighting of class and function definitions * improved HTML/PHP detection * heredocs (simple) * a new test for classes --- test/scanners/php/class.expected.raydebug | 83 +++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 test/scanners/php/class.expected.raydebug (limited to 'test/scanners/php/class.expected.raydebug') diff --git a/test/scanners/php/class.expected.raydebug b/test/scanners/php/class.expected.raydebug new file mode 100644 index 0000000..bc46870 --- /dev/null +++ b/test/scanners/php/class.expected.raydebug @@ -0,0 +1,83 @@ +comment() +inline_delimiter()ident(items)operator([)local_variable($artnr)operator(]) operator(+=) local_variable($num)operator(;) + operator(}) + + comment(// Take $num articles of $artnr out of the cart) + + reserved(function) function(remove_item)operator(()local_variable($artnr)operator(,) local_variable($num)operator(\)) operator({) + reserved(if) operator(()local_variable($this)operator(->)ident(items)operator([)local_variable($artnr)operator(]) operator(>) local_variable($num)operator(\)) operator({) + local_variable($this)operator(->)ident(items)operator([)local_variable($artnr)operator(]) operator(-=) local_variable($num)operator(;) + reserved(return) pre_constant(true)operator(;) + operator(}) reserved(elseif) operator(()local_variable($this)operator(->)ident(items)operator([)local_variable($artnr)operator(]) operator(==) local_variable($num)operator(\)) operator({) + predefined(unset)operator(()local_variable($this)operator(->)ident(items)operator([)local_variable($artnr)operator(])operator(\))operator(;) + reserved(return) pre_constant(true)operator(;) + operator(}) reserved(else) operator({) + reserved(return) pre_constant(false)operator(;) + operator(}) + operator(}) +operator(}) +inline_delimiter(?>) + + +inline_delimiter(operator(\))operator(;) + reserved(var) local_variable($name) operator(=) local_variable($firstname)operator(;) + reserved(var) local_variable($owner) operator(=) string operator(.) stringoperator(;) + comment(/* Arrays containing constant values will, though. */) + reserved(var) local_variable($items) operator(=) predefined(array)operator(()stringoperator(,) stringoperator(\))operator(;) +operator(}) + +comment(/* This is how it should be done. */) +reserved(class) class(Cart) operator({) + reserved(var) local_variable($todays_date)operator(;) + reserved(var) local_variable($name)operator(;) + reserved(var) local_variable($owner)operator(;) + reserved(var) local_variable($items) operator(=) predefined(array)operator(()stringoperator(,) stringoperator(\))operator(;) + + reserved(function) function(Cart)operator(()operator(\)) operator({) + local_variable($this)operator(->)ident(todays_date) operator(=) predefined(date)operator(()stringoperator(\))operator(;) + local_variable($this)operator(->)ident(name) operator(=) local_variable($GLOBALS)operator([)stringoperator(])operator(;) + comment(/* etc. . . */) + operator(}) +operator(}) +inline_delimiter(?>) + +inline_delimiter(operator(;) + predefined(echo) predefined(get_class)operator(()local_variable($this)operator(\))operator(;) + predefined(echo) stringoperator(;) + operator(}) reserved(else) operator({) + predefined(echo) stringoperator(;) + operator(}) + operator(}) +operator(}) + +reserved(class) class(B) +operator({) + reserved(function) function(bar)operator(()operator(\)) + operator({) + constant(A)operator(::)ident(foo)operator(()operator(\))operator(;) + operator(}) +operator(}) + +local_variable($a) operator(=) reserved(new) constant(A)operator(()operator(\))operator(;) +local_variable($a)operator(->)ident(foo)operator(()operator(\))operator(;) +constant(A)operator(::)ident(foo)operator(()operator(\))operator(;) +local_variable($b) operator(=) reserved(new) constant(B)operator(()operator(\))operator(;) +local_variable($b)operator(->)ident(bar)operator(()operator(\))operator(;) +constant(B)operator(::)ident(bar)operator(()operator(\))operator(;) +inline_delimiter(?>) -- cgit v1.2.1