Jump to content

ASCII art diagram converter: Difference between revisions

m
Corrected several typos.
m (Fixed typo.)
m (Corrected several typos.)
Line 941:
 
proc getNextToken(lexer: var Lexer) =
## Search next tokentoke/* {{header|Nim}} */ n and update lexer state accordingly.
 
doAssert(lexer.pos < lexer.line.high)
Line 991:
 
proc parseSepLine(lexer: var Lexer): int =
## Parse a separation line. returnReturn the corresponding size in bits.
 
lexer.getNextToken()
Line 1,271:
 
iterator fieldPairs*(struct: Structure): tuple[key: string, val: uint64] =
## Yield thenames and values of the successive fields of a structure
 
for name in struct.names:
Line 1,279:
 
proc `$`*(struct: Structure): string =
## DisplayProduce thea representation of a structure.
 
result = "("
Line 1,290:
 
proc toHex(struct: Structure): string =
## Return the hexadecimal representation of thea structure.
 
case struct.unit
Line 1,316:
createStructType(Diagram, "Header")
 
# Declare a variable of type Header and initialize its fields.
var header1 = Header(ID: 30791, QR: 0, Opcode: 15, AA: 0, TC: 1, RD: 1, RA: 1, Z: 3, RCODE:15,
QDCOUNT: 21654, ANCOUNT: 57646, NSCOUNT: 7153, ARCOUNT: 27044)
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.