Sha256: ab96744dbf07f80f79c3d5b33093050ceb3002c2c51c17615fdd6036b518eb30

Contents?: true

Size: 701 Bytes

Versions: 4

Compression:

Stored size: 701 Bytes

Contents

# vim: syntax=ruby

require 'json'

class PuppetDB::Lexer
rule
	\s			# whitespace no action
	\(			{ [:LPAREN, text] }
	\)			{ [:RPAREN, text] }
	\[			{ [:LBRACK, text] }
	\]			{ [:RBRACK, text] }
	\{			{ [:LBRACE, text] }
	\}			{ [:RBRACE, text] }
	=			{ [:EQUALS, text] }
	\!=			{ [:NOTEQUALS, text] }
	~			{ [:MATCH, text] }
	<			{ [:LESSTHAN, text] }
	>			{ [:GREATERTHAN, text] }
	not			{ [:NOT, text] }
	and			{ [:AND, text] }
	or			{ [:OR, text] }
	true			{ [:BOOLEAN, true]}
	false			{ [:BOOLEAN, false]}
	-?\d+			{ [:NUMBER, text.to_i] }
	-?\d+\.?(\d+)?		{ [:NUMBER, text.to_f] }
	\"(\\.|[^\\"])*\"	{ [:STRING, JSON.load(text)] }
	[\w_:]+			{ [:STRING, text] }
	@@			{ [:EXPORTED, text] }
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby-puppetdb-1.0.2 lib/puppetdb/lexer.l
ruby-puppetdb-1.0.1 lib/puppetdb/lexer.l
ruby-puppetdb-1.0.0 lib/puppetdb/lexer.l
ruby-puppetdb-1.0.0.pre5 lib/puppetdb/lexer.l