From f5197dc5b96bd59b55c2731f56f713202cfe750d Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Wed, 14 Jan 2009 15:25:43 +0000 Subject: Support pointers in the expected bytecode. Add a simple test that uses this functionality. svn path=/trunk/libcss/; revision=6065 --- test/data/parse/README | 9 ++++----- test/data/parse/tests1.dat | 7 +++++++ 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'test/data/parse') diff --git a/test/data/parse/README b/test/data/parse/README index f1cc46a..135dd3b 100644 --- a/test/data/parse/README +++ b/test/data/parse/README @@ -19,8 +19,9 @@ Format of rule list rule ::= '| ' type ' '+ name name ::= .+ type ::= [0-9]+ - bytecode ::= '| ' ' '* hexnum (' '+ hexnum)* + bytecode ::= '| ' ' '* hexnum (' '+ (hexnum | ptr))* hexnum ::= '0x' [0-9a-fA-F]+ + ptr ::= 'PTR(' .* ')' Type corresponds to css_rule_type. Consult the library sources for the values. @@ -32,18 +33,16 @@ Example ------- #data -* { color: #ff0000 } +* { color: #ff0000; background-image: url("foo.png"); } #errors #expected | 1 * | 0x0200000f 0xff000000 +| 0x02000003 PTR(foo.png) #reset TODO ---- + Permit nesting of rules (for nested block support) - + There's no way of flagging a pointer in the bytecode (ideally, this will - be defined in such a way that we'll be able to validate the data pointed - to, too) diff --git a/test/data/parse/tests1.dat b/test/data/parse/tests1.dat index 1bd05dc..2aa6f56 100644 --- a/test/data/parse/tests1.dat +++ b/test/data/parse/tests1.dat @@ -21,3 +21,10 @@ | 0x0000080f #reset +#data +* { background-image: url("foo.png"); color: inherit } +#errors +#expected +| 1 * +| 0x02000003 PTR(foo.png) 0x0000080f +#reset -- cgit v1.2.3