Sha256: 79b36200595471ad75ad63328f6ad7f17d8bbd92190511e41d930abdb0f6d878

Contents?: true

Size: 753 Bytes

Versions: 6

Compression:

Stored size: 753 Bytes

Contents

# vim: syntax=ruby

require 'yaml'

class PuppetDB::Lexer
macro
STR	[\w_:]
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(?!{STR})		{ [:NOT, text] }
	and(?!{STR})		{ [:AND, text] }
	or(?!{STR})		{ [:OR, text] }
	true(?!{STR})		{ [:BOOLEAN, true]}
	false(?!{STR})		{ [:BOOLEAN, false]}
	-?\d+\.\d+		{ [:NUMBER, text.to_f] }
	-?\d+			{ [:NUMBER, text.to_i] }
	\"(\\.|[^\\"])*\"	{ [:STRING, YAML.load(text)] }
	{STR}+			{ [:STRING, text] }
	@@			{ [:EXPORTED, text] }
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ruby-puppetdb-1.3.3 lib/puppetdb/lexer.l
ruby-puppetdb-1.3.2 lib/puppetdb/lexer.l
ruby-puppetdb-1.3.1 lib/puppetdb/lexer.l
ruby-puppetdb-1.3.0 lib/puppetdb/lexer.l
ruby-puppetdb-1.2.0 lib/puppetdb/lexer.l
ruby-puppetdb-1.1.1 lib/puppetdb/lexer.l