Expose some layouter elements, improve readme (#12361)
Useful for writing linters and static code analysis
This commit is contained in:
parent
26676066cc
commit
a03d8ed4c2
2 changed files with 4 additions and 3 deletions
|
|
@ -21,7 +21,7 @@ type
|
||||||
SemicolonKind = enum
|
SemicolonKind = enum
|
||||||
detectSemicolonKind, useSemicolon, dontTouch
|
detectSemicolonKind, useSemicolon, dontTouch
|
||||||
|
|
||||||
LayoutToken = enum
|
LayoutToken* = enum
|
||||||
ltSpaces,
|
ltSpaces,
|
||||||
ltCrucialNewline, ## a semantically crucial newline (indentation!)
|
ltCrucialNewline, ## a semantically crucial newline (indentation!)
|
||||||
ltSplittingNewline, ## newline used for splitting up long
|
ltSplittingNewline, ## newline used for splitting up long
|
||||||
|
|
@ -41,8 +41,8 @@ type
|
||||||
col, lastLineNumber, lineSpan, indentLevel, indWidth*, inSection: int
|
col, lastLineNumber, lineSpan, indentLevel, indWidth*, inSection: int
|
||||||
keepIndents*: int
|
keepIndents*: int
|
||||||
doIndentMore*: int
|
doIndentMore*: int
|
||||||
kinds: seq[LayoutToken]
|
kinds*: seq[LayoutToken]
|
||||||
tokens: seq[string]
|
tokens*: seq[string]
|
||||||
indentStack: seq[int]
|
indentStack: seq[int]
|
||||||
fixedUntil: int # marks where we must not go in the content
|
fixedUntil: int # marks where we must not go in the content
|
||||||
altSplitPos: array[SplitKind, int] # alternative split positions
|
altSplitPos: array[SplitKind, int] # alternative split positions
|
||||||
|
|
|
||||||
|
|
@ -2,3 +2,4 @@ This directory contains the Nim compiler written in Nim. Note that this
|
||||||
code has been translated from a bootstrapping version written in Pascal, so
|
code has been translated from a bootstrapping version written in Pascal, so
|
||||||
the code is **not** a poster child of good Nim code.
|
the code is **not** a poster child of good Nim code.
|
||||||
|
|
||||||
|
See https://nim-lang.org/docs/intern.html for more information.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue