swarm-0.5.0.0: 2D resource gathering game with programmable robots
LicenseBSD-3-Clause
Safe HaskellSafe-Inferred
LanguageHaskell2010

Swarm.Game.World.Parse

Description

Parser for the Swarm world description DSL.

Synopsis

Documentation

sc :: Parser () Source #

Skip spaces and comments.

lexeme :: Parser a -> Parser a Source #

In general, we follow the convention that every token parser assumes no leading whitespace and consumes all trailing whitespace. Concretely, we achieve this by wrapping every token parser using lexeme.

symbol :: Text -> Parser Text Source #

A lexeme consisting of a literal string.

integerOrFloat :: Parser (Either Integer Double) Source #

A positive integer literal token.

reserved :: Text -> Parser () Source #

Parse a case-insensitive reserved word, making sure it is not a prefix of a longer variable name, and allowing the parser to backtrack if it fails.

identifier :: Parser Var Source #

Parse an identifier, i.e. any non-reserved string containing alphanumeric characters and underscores and not starting with a number.

Orphan instances

FromJSON WExp Source # 
Instance details