Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: 0.6
Fetching contributors…

Cannot retrieve contributors at this time

18 lines (17 sloc) 0.813 kb
/*
A Grammar for a small subset of CSS useful for syntax highlighting in an NSTextView + NSAttributedString
*/
@start = ruleset*;
ruleset = selectors '{' decls '}'!;
selectors = selector commaSelector*;
selector = LowercaseWord; // forcing selectors to be lowercase words for use in a future syntax-highlight framework where i want that
commaSelector = ','! selector;
decls = Empty | actualDecls;
actualDecls = decl decl*;
decl = property ':'! expr ';'!?;
property = 'color' | 'background-color' | 'font-family' | 'font-size';
expr = pixelValue | rgb | string | constants;
pixelValue = Number 'px'!;
rgb = 'rgb'! '(' Number ','! Number ','! Number ')'!;
string = QuotedString;
constants = 'bold' | 'normal' | 'italic';
Jump to Line
Something went wrong with that request. Please try again.