parser

package
v0.0.0-...-8ea42c6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 14, 2016 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package parser parse and loads a cherry file to the memory. --

  • Copyright (C) 2015 by Rafael Santiago *
  • This is a free software. You can redistribute it and/or modify under
  • the terms of the GNU General Public License version 2. *

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNextSetFromData

func GetNextSetFromData(data string, currLine int, tok string) ([]string, int, string)

GetNextSetFromData returns the next "field = value".

func StripBlanks

func StripBlanks(data string) string

StripBlanks strips all blanks.

Types

type CherryFileError

type CherryFileError struct {
	// contains filtered or unexported fields
}

CherryFileError is returned by any parse function implemented in "parser.go".

func GetDataFromSection

func GetDataFromSection(section, configData string, currLine int, currFile string) (string, int, int, *CherryFileError)

GetDataFromSection returns the raw section data from a cherry file section data.

func GetRoomActions

func GetRoomActions(roomName string, cherryRooms *config.CherryRooms, configData, filepath string) *CherryFileError

GetRoomActions parses "cherry.[roomName].actions" section.

func GetRoomImages

func GetRoomImages(roomName string, cherryRooms *config.CherryRooms, configData, filepath string) *CherryFileError

GetRoomImages parses "cherry.[roomName].images" and "cherry.[roomName].images.url".

func GetRoomMisc

func GetRoomMisc(roomName string, cherryRooms *config.CherryRooms, configData, filepath string) *CherryFileError

GetRoomMisc parses "cherry.[roomName].misc" section.

func GetRoomTemplates

func GetRoomTemplates(roomName string, cherryRooms *config.CherryRooms, configData, filepath string) *CherryFileError

GetRoomTemplates parses "cherry.[roomName].templates" section.

func NewCherryFileError

func NewCherryFileError(src string, line int, msg string) *CherryFileError

NewCherryFileError creates a *CherryFileError.

func ParseCherryFile

func ParseCherryFile(filepath string) (*config.CherryRooms, *CherryFileError)

ParseCherryFile parses a file at @filepath and returns a *config.CherryRooms or a *CherryFileError.

func (*CherryFileError) Error

func (c *CherryFileError) Error() string

Error spits the error string.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL