This template:
/*
packets
${name} ${id} %{packet_fields for fields}.
?{if not last:$n}
.
packet_fields
?{if first:$n} ${value} ${key}$n| y = 0 | |
| around = [ ( x, y ) for x in range( -1, 2 ) for y in range( -1, 2 ) ] | |
| del around[4] | |
| cells = [ [ False for j in xrange( 10 ) ] for i in xrange( 10 ) ] | |
| def display_cells( c ): | |
| s = "" | |
| for w in c: | |
| for l in w: |
| Handshake 0xFF | |
| u32 magic | |
| u32 version | |
| str token | |
| . | |
| Error 0 | |
| u32 error_id | |
| str? error_msg |
This template:
/*
packets
${name} ${id} %{packet_fields for fields}.
?{if not last:$n}
.
packet_fields
?{if first:$n} ${value} ${key}$nThis template:
/*
enums
${name}( ${id}, "${msg}" ),?{if not last:$n }
.
case_name_from_id
?{if not first: }case ${id}:| # The Templator format | |
| The Templator foramt is a format for generating source code files from a set of structured data. | |
| It's relatively flexible making it applicable for a large amount of different input data. | |
| ## Contents: | |
| * #### API | |
| * #### Syntax | |
| * #### Semantics | |
| * #### Examples |
| -- BoardApp.hs | |
| {-# LANGUAGE OverloadedStrings #-} | |
| {-# LANGUAGE TemplateHaskell #-} | |
| {-# LANGUAGE DeriveDataTypeable #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| module BoardApp ( BoardApp | |
| , Board (..) |
| use VERSION_UINT; | |
| use std::io::{IoResult, BufWriter}; | |
| use super::Packet; | |
| use super::error::{NetError}; | |
| use super::id::{Idable}; | |
| pub struct Handshake { | |
| magic : u32, | |
| version : u32, | |
| token : String |