mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
663 lines
72 KiB
HTML
663 lines
72 KiB
HTML
<?xml version="1.0" encoding="utf-8" ?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<!-- This file is generated by Nim. -->
|
|
<html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en" data-theme="auto">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>lexer</title>
|
|
|
|
<!-- Google fonts -->
|
|
<link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
|
|
<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
|
|
|
|
<!-- Favicon -->
|
|
<link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/>
|
|
<link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QQQEwksSS9ZWwAAAk1JREFUWMPtll2ITVEUx39nn/O7Y5qR8f05wtCUUr6ZIS++8pEnkZInPImneaCQ5METNdOkeFBKUhMPRIkHKfEuUZSUlGlKPN2TrgfncpvmnntnmlEyq1Z7t89/rf9a6+y99oZxGZf/XeIq61EdtgKXgdXA0xrYAvBjOIF1AI9zvjcC74BSpndrJPkBWDScTF8Aa4E3wDlgHbASaANmVqlcCnwHvgDvgVfAJ+AikAAvgfVZwLnSVZHZaOuKoQi3ZOMi4NkYkpe1p4J7A8BpYAD49hfIy/oqG0+hLomiKP2L5L+1ubn5115S+3OAn4EnwBlgMzCjyt6ZAnQCJ4A7wOs88iRJHvw50HoujuPBoCKwHWiosy8MdfZnAdcHk8dxXFJ3VQbQlCTJvRBCGdRbD4M6uc5glpY3eAihpN5S5w12diSEcCCEcKUO4ljdr15T76ur1FDDLIQQ3qv71EdDOe3Kxj3leRXyk+pxdWnFWod6Wt2bY3de3aSuUHcPBVimHs7mK9WrmeOF6lR1o9qnzskh2ar2qm1qizpfXaPeVGdlmGN5pb09qMxz1Xb1kLqgzn1RyH7JUXW52lr5e/Kqi9qpto7V1atuUzfnARrV7jEib1T76gG2qxdGmXyiekkt1GswPTtek0aBfJp6YySGBfWg2tPQ0FAYgf1stUfdmdcjarbYJEniKIq6gY/Aw+zWHAC+p2labGpqiorFYgGYCEzN7oQdQClN07O1/EfDyGgC0ALMBdYAi4FyK+4H3gLPsxfR1zRNi+NP7nH5J+QntnXe5B5mpfQAAAAASUVORK5CYII=">
|
|
|
|
<!-- CSS -->
|
|
<link rel="stylesheet" type="text/css" href="nimdoc.out.css?v=2.3.1">
|
|
|
|
<!-- JS -->
|
|
<script type="text/javascript" src="dochack.js?v=2.3.1"></script>
|
|
</head>
|
|
<body>
|
|
<div class="document" id="documentId">
|
|
<div class="container">
|
|
<h1 class="title">lexer</h1>
|
|
<div class="row">
|
|
<div class="three columns">
|
|
<div class="theme-select-wrapper">
|
|
<label for="theme-select">Theme: </label>
|
|
<select id="theme-select" onchange="setTheme(this.value)">
|
|
<option value="auto">🌗 Match OS</option>
|
|
<option value="dark">🌑 Dark</option>
|
|
<option value="light">🌕 Light</option>
|
|
</select>
|
|
</div>
|
|
<div id="global-links">
|
|
<ul class="simple">
|
|
<li><a id="indexLink" href="theindex.html">Index</a></li>
|
|
</ul>
|
|
</div>
|
|
<div id="searchInputDiv">
|
|
Search: <input type="search" id="searchInput" oninput="search()"/>
|
|
</div>
|
|
<div>
|
|
Group by:
|
|
<select onchange="groupBy(this.value)">
|
|
<option value="section">Section</option>
|
|
<option value="type">Type</option>
|
|
</select>
|
|
</div>
|
|
<ul class="simple simple-toc" id="toc-list">
|
|
<li>
|
|
<a class="reference reference-toplevel" href="#6" id="56">Imports</a>
|
|
</li>
|
|
<li>
|
|
<details open>
|
|
<summary><a class="reference reference-toplevel" href="#7" id="57">Types</a></summary>
|
|
<ul class="simple simple-toc-section">
|
|
<li><a class="reference" href="#ErrorHandler" title="ErrorHandler = proc (conf: ConfigRef; info: TLineInfo; msg: TMsgKind;
|
|
arg: string)">ErrorHandler</a></li>
|
|
<li><a class="reference" href="#Lexer" title="Lexer = object of TBaseLexer
|
|
fileIdx*: FileIndex
|
|
indentAhead*: int
|
|
currLineIndent*: int
|
|
errorHandler*: ErrorHandler
|
|
cache*: IdentCache
|
|
when defined(nimsuggest):
|
|
tokenEnd*: TLineInfo
|
|
previousTokenEnd*: TLineInfo
|
|
config*: ConfigRef">Lexer</a></li>
|
|
<li><a class="reference" href="#NumericalBase" title="NumericalBase = enum
|
|
base10, base2, base8, base16">NumericalBase</a></li>
|
|
<li><a class="reference" href="#Token" title="Token = object
|
|
tokType*: TokType
|
|
base*: NumericalBase
|
|
spacing*: set[TokenSpacing]
|
|
indent*: int
|
|
ident*: PIdent
|
|
iNumber*: BiggestInt
|
|
fNumber*: BiggestFloat
|
|
literal*: string
|
|
line*, col*: int
|
|
when defined(nimpretty):
|
|
offsetA*, offsetB*: int
|
|
commentOffsetA*, commentOffsetB*: int">Token</a></li>
|
|
<li><a class="reference" href="#TokenSpacing" title="TokenSpacing = enum
|
|
tsLeading, tsTrailing, tsEof">TokenSpacing</a></li>
|
|
<li><a class="reference" href="#TokType" title="TokType = enum
|
|
tkInvalid = "tkInvalid", tkEof = "[EOF]", tkSymbol = "tkSymbol",
|
|
tkAddr = "addr", tkAnd = "and", tkAs = "as", tkAsm = "asm", tkBind = "bind",
|
|
tkBlock = "block", tkBreak = "break", tkCase = "case", tkCast = "cast",
|
|
tkConcept = "concept", tkConst = "const", tkContinue = "continue",
|
|
tkConverter = "converter", tkDefer = "defer", tkDiscard = "discard",
|
|
tkDistinct = "distinct", tkDiv = "div", tkDo = "do", tkElif = "elif",
|
|
tkElse = "else", tkEnd = "end", tkEnum = "enum", tkExcept = "except",
|
|
tkExport = "export", tkFinally = "finally", tkFor = "for", tkFrom = "from",
|
|
tkFunc = "func", tkIf = "if", tkImport = "import", tkIn = "in",
|
|
tkInclude = "include", tkInterface = "interface", tkIs = "is",
|
|
tkIsnot = "isnot", tkIterator = "iterator", tkLet = "let", tkMacro = "macro",
|
|
tkMethod = "method", tkMixin = "mixin", tkMod = "mod", tkNil = "nil",
|
|
tkNot = "not", tkNotin = "notin", tkObject = "object", tkOf = "of",
|
|
tkOr = "or", tkOut = "out", tkProc = "proc", tkPtr = "ptr", tkRaise = "raise",
|
|
tkRef = "ref", tkReturn = "return", tkShl = "shl", tkShr = "shr",
|
|
tkStatic = "static", tkTemplate = "template", tkTry = "try",
|
|
tkTuple = "tuple", tkType = "type", tkUsing = "using", tkVar = "var",
|
|
tkWhen = "when", tkWhile = "while", tkXor = "xor", tkYield = "yield",
|
|
tkIntLit = "tkIntLit", tkInt8Lit = "tkInt8Lit", tkInt16Lit = "tkInt16Lit",
|
|
tkInt32Lit = "tkInt32Lit", tkInt64Lit = "tkInt64Lit", tkUIntLit = "tkUIntLit",
|
|
tkUInt8Lit = "tkUInt8Lit", tkUInt16Lit = "tkUInt16Lit",
|
|
tkUInt32Lit = "tkUInt32Lit", tkUInt64Lit = "tkUInt64Lit",
|
|
tkFloatLit = "tkFloatLit", tkFloat32Lit = "tkFloat32Lit",
|
|
tkFloat64Lit = "tkFloat64Lit", tkFloat128Lit = "tkFloat128Lit",
|
|
tkStrLit = "tkStrLit", tkRStrLit = "tkRStrLit",
|
|
tkTripleStrLit = "tkTripleStrLit", tkGStrLit = "tkGStrLit",
|
|
tkGTripleStrLit = "tkGTripleStrLit", tkCharLit = "tkCharLit",
|
|
tkCustomLit = "tkCustomLit", tkParLe = "(", tkParRi = ")", tkBracketLe = "[",
|
|
tkBracketRi = "]", tkCurlyLe = "{", tkCurlyRi = "}", tkBracketDotLe = "[.",
|
|
tkBracketDotRi = ".]", tkCurlyDotLe = "{.", tkCurlyDotRi = ".}",
|
|
tkParDotLe = "(.", tkParDotRi = ".)", tkComma = ",", tkSemiColon = ";",
|
|
tkColon = ":", tkColonColon = "::", tkEquals = "=", tkDot = ".",
|
|
tkDotDot = "..", tkBracketLeColon = "[:", tkOpr, tkComment, tkAccent = "`",
|
|
tkSpaces, tkInfixOpr, tkPrefixOpr, tkPostfixOpr, tkHideableStart,
|
|
tkHideableEnd">TokType</a></li>
|
|
<li><a class="reference" href="#TokTypes" title="TokTypes = set[TokType]">TokTypes</a></li>
|
|
|
|
</ul>
|
|
</details>
|
|
</li>
|
|
<li>
|
|
<details open>
|
|
<summary><a class="reference reference-toplevel" href="#10" id="60">Consts</a></summary>
|
|
<ul class="simple simple-toc-section">
|
|
<li><a class="reference" href="#numChars" title="numChars: set[char] = {'0'..'9', 'a'..'z', 'A'..'Z'}">numChars</a></li>
|
|
<li><a class="reference" href="#OpChars" title="OpChars: set[char] = {'+', '-', '*', '/', '\\', '<', '>', '!', '?', '^', '.',
|
|
'|', '=', '%', '&', '$', '@', '~', ':'}">OpChars</a></li>
|
|
<li><a class="reference" href="#SymChars" title="SymChars: set[char] = {'a'..'z', 'A'..'Z', '0'..'9', '\x80'..'\xFF'}">SymChars</a></li>
|
|
<li><a class="reference" href="#SymStartChars" title="SymStartChars: set[char] = {'a'..'z', 'A'..'Z', '\x80'..'\xFF'}">SymStartChars</a></li>
|
|
<li><a class="reference" href="#tokKeywordHigh" title="tokKeywordHigh = tkYield">tokKeywordHigh</a></li>
|
|
<li><a class="reference" href="#tokKeywordLow" title="tokKeywordLow = tkAddr">tokKeywordLow</a></li>
|
|
|
|
</ul>
|
|
</details>
|
|
</li>
|
|
<li>
|
|
<details open>
|
|
<summary><a class="reference reference-toplevel" href="#12" id="62">Procs</a></summary>
|
|
<ul class="simple simple-toc-section">
|
|
<ul class="simple nested-toc-section">$
|
|
<li><a class="reference" href="#%24%2CToken" title="`$`(tok: Token): string">`$`(tok: Token): string</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">closeLexer
|
|
<li><a class="reference" href="#closeLexer%2CLexer" title="closeLexer(lex: var Lexer)">closeLexer(lex: var Lexer)</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">getIndentWidth
|
|
<li><a class="reference" href="#getIndentWidth%2CFileIndex%2CPLLStream%2CIdentCache%2CConfigRef" title="getIndentWidth(fileIdx: FileIndex; inputstream: PLLStream; cache: IdentCache;
|
|
config: ConfigRef): int">getIndentWidth(fileIdx: FileIndex; inputstream: PLLStream; cache: IdentCache;
|
|
config: ConfigRef): int</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">getLineInfo
|
|
<li><a class="reference" href="#getLineInfo%2CLexer%2CToken" title="getLineInfo(L: Lexer; tok: Token): TLineInfo">getLineInfo(L: Lexer; tok: Token): TLineInfo</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">getPrecedence
|
|
<li><a class="reference" href="#getPrecedence%2CPIdent" title="getPrecedence(ident: PIdent): int">getPrecedence(ident: PIdent): int</a></li>
|
|
<li><a class="reference" href="#getPrecedence%2CToken" title="getPrecedence(tok: Token): int">getPrecedence(tok: Token): int</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">isKeyword
|
|
<li><a class="reference" href="#isKeyword%2CTokType" title="isKeyword(kind: TokType): bool">isKeyword(kind: TokType): bool</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">isNimIdentifier
|
|
<li><a class="reference" href="#isNimIdentifier%2Cstring" title="isNimIdentifier(s: string): bool">isNimIdentifier(s: string): bool</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">lexMessage
|
|
<li><a class="reference" href="#lexMessage%2CLexer%2CTMsgKind%2Cstring" title="lexMessage(L: Lexer; msg: TMsgKind; arg = "")">lexMessage(L: Lexer; msg: TMsgKind; arg = "")</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">lexMessageTok
|
|
<li><a class="reference" href="#lexMessageTok%2CLexer%2CTMsgKind%2CToken%2Cstring" title="lexMessageTok(L: Lexer; msg: TMsgKind; tok: Token; arg = "")">lexMessageTok(L: Lexer; msg: TMsgKind; tok: Token; arg = "")</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">openLexer
|
|
<li><a class="reference" href="#openLexer%2CLexer%2CFileIndex%2CPLLStream%2CIdentCache%2CConfigRef" title="openLexer(lex: var Lexer; fileIdx: FileIndex; inputstream: PLLStream;
|
|
cache: IdentCache; config: ConfigRef)">openLexer(lex: var Lexer; fileIdx: FileIndex; inputstream: PLLStream;
|
|
cache: IdentCache; config: ConfigRef)</a></li>
|
|
<li><a class="reference" href="#openLexer%2CLexer%2CAbsoluteFile%2CPLLStream%2CIdentCache%2CConfigRef" title="openLexer(lex: var Lexer; filename: AbsoluteFile; inputstream: PLLStream;
|
|
cache: IdentCache; config: ConfigRef)">openLexer(lex: var Lexer; filename: AbsoluteFile; inputstream: PLLStream;
|
|
cache: IdentCache; config: ConfigRef)</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">prettyTok
|
|
<li><a class="reference" href="#prettyTok%2CToken" title="prettyTok(tok: Token): string">prettyTok(tok: Token): string</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">printTok
|
|
<li><a class="reference" href="#printTok%2CConfigRef%2CToken" title="printTok(conf: ConfigRef; tok: Token)">printTok(conf: ConfigRef; tok: Token)</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">rawGetTok
|
|
<li><a class="reference" href="#rawGetTok%2CLexer%2CToken" title="rawGetTok(L: var Lexer; tok: var Token)">rawGetTok(L: var Lexer; tok: var Token)</a></li>
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
</details>
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
<div class="nine columns" id="content">
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L1" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L1" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
<div id="tocRoot"></div>
|
|
|
|
<p class="module-desc"></p>
|
|
<div class="section" id="6">
|
|
<h1><a class="toc-backref" href="#6">Imports</a></h1>
|
|
<dl class="item">
|
|
<a class="reference external" href="options.html">options</a>, <a class="reference external" href="msgs.html">msgs</a>, <a class="reference external" href="platform.html">platform</a>, <a class="reference external" href="idents.html">idents</a>, <a class="reference external" href="nimlexbase.html">nimlexbase</a>, <a class="reference external" href="llstream.html">llstream</a>, <a class="reference external" href="wordrecg.html">wordrecg</a>, <a class="reference external" href="lineinfos.html">lineinfos</a>, <a class="reference external" href="pathutils.html">pathutils</a>
|
|
</dl>
|
|
</div>
|
|
<div class="section" id="7">
|
|
<h1><a class="toc-backref" href="#7">Types</a></h1>
|
|
<dl class="item">
|
|
<div id="ErrorHandler">
|
|
<dt><pre><a href="lexer.html#ErrorHandler"><span class="Identifier">ErrorHandler</span></a> <span class="Other">=</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">conf</span><span class="Other">:</span> <a href="options.html#ConfigRef"><span class="Identifier">ConfigRef</span></a><span class="Other">;</span> <span class="Identifier">info</span><span class="Other">:</span> <a href="lineinfos.html#TLineInfo"><span class="Identifier">TLineInfo</span></a><span class="Other">;</span> <span class="Identifier">msg</span><span class="Other">:</span> <a href="lineinfos.html#TMsgKind"><span class="Identifier">TMsgKind</span></a><span class="Other">;</span>
|
|
<span class="Identifier">arg</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span></pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L118" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L118" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
<div id="Lexer">
|
|
<dt><pre><a href="lexer.html#Lexer"><span class="Identifier">Lexer</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="nimlexbase.html#TBaseLexer"><span class="Identifier">TBaseLexer</span></a>
|
|
<span class="Identifier">fileIdx</span><span class="Operator">*</span><span class="Other">:</span> <a href="lineinfos.html#FileIndex"><span class="Identifier">FileIndex</span></a>
|
|
<span class="Identifier">indentAhead</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">int</span>
|
|
<span class="Identifier">currLineIndent</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">int</span>
|
|
<span class="Identifier">errorHandler</span><span class="Operator">*</span><span class="Other">:</span> <a href="lexer.html#ErrorHandler"><span class="Identifier">ErrorHandler</span></a>
|
|
<span class="Identifier">cache</span><span class="Operator">*</span><span class="Other">:</span> <a href="idents.html#IdentCache"><span class="Identifier">IdentCache</span></a>
|
|
<span class="Keyword">when</span> <span class="Identifier">defined</span><span class="Other">(</span><span class="Identifier">nimsuggest</span><span class="Other">)</span><span class="Other">:</span>
|
|
<span class="Identifier">tokenEnd</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">TLineInfo</span>
|
|
<span class="Identifier">previousTokenEnd</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">TLineInfo</span>
|
|
<span class="Identifier">config</span><span class="Operator">*</span><span class="Other">:</span> <a href="options.html#ConfigRef"><span class="Identifier">ConfigRef</span></a></pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L119" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L119" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
<div id="NumericalBase">
|
|
<dt><pre><a href="lexer.html#NumericalBase"><span class="Identifier">NumericalBase</span></a> <span class="Other">=</span> <span class="Keyword">enum</span>
|
|
<span class="Identifier">base10</span><span class="Other">,</span> <span class="Identifier">base2</span><span class="Other">,</span> <span class="Identifier">base8</span><span class="Other">,</span> <span class="Identifier">base16</span></pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L92" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L92" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
<div id="Token">
|
|
<dt><pre><a href="lexer.html#Token"><span class="Identifier">Token</span></a> <span class="Other">=</span> <span class="Keyword">object</span>
|
|
<span class="Identifier">tokType</span><span class="Operator">*</span><span class="Other">:</span> <a href="lexer.html#TokType"><span class="Identifier">TokType</span></a>
|
|
<span class="Identifier">base</span><span class="Operator">*</span><span class="Other">:</span> <a href="lexer.html#NumericalBase"><span class="Identifier">NumericalBase</span></a>
|
|
<span class="Identifier">spacing</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">set</span><span class="Other">[</span><a href="lexer.html#TokenSpacing"><span class="Identifier">TokenSpacing</span></a><span class="Other">]</span>
|
|
<span class="Identifier">indent</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">int</span>
|
|
<span class="Identifier">ident</span><span class="Operator">*</span><span class="Other">:</span> <a href="idents.html#PIdent"><span class="Identifier">PIdent</span></a>
|
|
<span class="Identifier">iNumber</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">BiggestInt</span>
|
|
<span class="Identifier">fNumber</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">BiggestFloat</span>
|
|
<span class="Identifier">literal</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">string</span>
|
|
<span class="Identifier">line</span><span class="Operator">*</span><span class="Other">,</span> <span class="Identifier">col</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">int</span>
|
|
<span class="Keyword">when</span> <span class="Identifier">defined</span><span class="Other">(</span><span class="Identifier">nimpretty</span><span class="Other">)</span><span class="Other">:</span>
|
|
<span class="Identifier">offsetA</span><span class="Operator">*</span><span class="Other">,</span> <span class="Identifier">offsetB</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">int</span>
|
|
<span class="Identifier">commentOffsetA</span><span class="Operator">*</span><span class="Other">,</span> <span class="Identifier">commentOffsetB</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">int</span></pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L100" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L100" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
<div id="TokenSpacing">
|
|
<dt><pre><a href="lexer.html#TokenSpacing"><span class="Identifier">TokenSpacing</span></a> <span class="Other">=</span> <span class="Keyword">enum</span>
|
|
<span class="Identifier">tsLeading</span><span class="Other">,</span> <span class="Identifier">tsTrailing</span><span class="Other">,</span> <span class="Identifier">tsEof</span></pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L97" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L97" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
<div id="TokType">
|
|
<dt><pre><a href="lexer.html#TokType"><span class="Identifier">TokType</span></a> <span class="Other">=</span> <span class="Keyword">enum</span>
|
|
<span class="Identifier">tkInvalid</span> <span class="Other">=</span> <span class="StringLit">"tkInvalid"</span><span class="Other">,</span> <span class="Identifier">tkEof</span> <span class="Other">=</span> <span class="StringLit">"[EOF]"</span><span class="Other">,</span> <span class="Identifier">tkSymbol</span> <span class="Other">=</span> <span class="StringLit">"tkSymbol"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkAddr</span> <span class="Other">=</span> <span class="StringLit">"addr"</span><span class="Other">,</span> <span class="Identifier">tkAnd</span> <span class="Other">=</span> <span class="StringLit">"and"</span><span class="Other">,</span> <span class="Identifier">tkAs</span> <span class="Other">=</span> <span class="StringLit">"as"</span><span class="Other">,</span> <span class="Identifier">tkAsm</span> <span class="Other">=</span> <span class="StringLit">"asm"</span><span class="Other">,</span> <span class="Identifier">tkBind</span> <span class="Other">=</span> <span class="StringLit">"bind"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkBlock</span> <span class="Other">=</span> <span class="StringLit">"block"</span><span class="Other">,</span> <span class="Identifier">tkBreak</span> <span class="Other">=</span> <span class="StringLit">"break"</span><span class="Other">,</span> <span class="Identifier">tkCase</span> <span class="Other">=</span> <span class="StringLit">"case"</span><span class="Other">,</span> <span class="Identifier">tkCast</span> <span class="Other">=</span> <span class="StringLit">"cast"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkConcept</span> <span class="Other">=</span> <span class="StringLit">"concept"</span><span class="Other">,</span> <span class="Identifier">tkConst</span> <span class="Other">=</span> <span class="StringLit">"const"</span><span class="Other">,</span> <span class="Identifier">tkContinue</span> <span class="Other">=</span> <span class="StringLit">"continue"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkConverter</span> <span class="Other">=</span> <span class="StringLit">"converter"</span><span class="Other">,</span> <span class="Identifier">tkDefer</span> <span class="Other">=</span> <span class="StringLit">"defer"</span><span class="Other">,</span> <span class="Identifier">tkDiscard</span> <span class="Other">=</span> <span class="StringLit">"discard"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkDistinct</span> <span class="Other">=</span> <span class="StringLit">"distinct"</span><span class="Other">,</span> <span class="Identifier">tkDiv</span> <span class="Other">=</span> <span class="StringLit">"div"</span><span class="Other">,</span> <span class="Identifier">tkDo</span> <span class="Other">=</span> <span class="StringLit">"do"</span><span class="Other">,</span> <span class="Identifier">tkElif</span> <span class="Other">=</span> <span class="StringLit">"elif"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkElse</span> <span class="Other">=</span> <span class="StringLit">"else"</span><span class="Other">,</span> <span class="Identifier">tkEnd</span> <span class="Other">=</span> <span class="StringLit">"end"</span><span class="Other">,</span> <span class="Identifier">tkEnum</span> <span class="Other">=</span> <span class="StringLit">"enum"</span><span class="Other">,</span> <span class="Identifier">tkExcept</span> <span class="Other">=</span> <span class="StringLit">"except"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkExport</span> <span class="Other">=</span> <span class="StringLit">"export"</span><span class="Other">,</span> <span class="Identifier">tkFinally</span> <span class="Other">=</span> <span class="StringLit">"finally"</span><span class="Other">,</span> <span class="Identifier">tkFor</span> <span class="Other">=</span> <span class="StringLit">"for"</span><span class="Other">,</span> <span class="Identifier">tkFrom</span> <span class="Other">=</span> <span class="StringLit">"from"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkFunc</span> <span class="Other">=</span> <span class="StringLit">"func"</span><span class="Other">,</span> <span class="Identifier">tkIf</span> <span class="Other">=</span> <span class="StringLit">"if"</span><span class="Other">,</span> <span class="Identifier">tkImport</span> <span class="Other">=</span> <span class="StringLit">"import"</span><span class="Other">,</span> <span class="Identifier">tkIn</span> <span class="Other">=</span> <span class="StringLit">"in"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkInclude</span> <span class="Other">=</span> <span class="StringLit">"include"</span><span class="Other">,</span> <span class="Identifier">tkInterface</span> <span class="Other">=</span> <span class="StringLit">"interface"</span><span class="Other">,</span> <span class="Identifier">tkIs</span> <span class="Other">=</span> <span class="StringLit">"is"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkIsnot</span> <span class="Other">=</span> <span class="StringLit">"isnot"</span><span class="Other">,</span> <span class="Identifier">tkIterator</span> <span class="Other">=</span> <span class="StringLit">"iterator"</span><span class="Other">,</span> <span class="Identifier">tkLet</span> <span class="Other">=</span> <span class="StringLit">"let"</span><span class="Other">,</span> <span class="Identifier">tkMacro</span> <span class="Other">=</span> <span class="StringLit">"macro"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkMethod</span> <span class="Other">=</span> <span class="StringLit">"method"</span><span class="Other">,</span> <span class="Identifier">tkMixin</span> <span class="Other">=</span> <span class="StringLit">"mixin"</span><span class="Other">,</span> <span class="Identifier">tkMod</span> <span class="Other">=</span> <span class="StringLit">"mod"</span><span class="Other">,</span> <span class="Identifier">tkNil</span> <span class="Other">=</span> <span class="StringLit">"nil"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkNot</span> <span class="Other">=</span> <span class="StringLit">"not"</span><span class="Other">,</span> <span class="Identifier">tkNotin</span> <span class="Other">=</span> <span class="StringLit">"notin"</span><span class="Other">,</span> <span class="Identifier">tkObject</span> <span class="Other">=</span> <span class="StringLit">"object"</span><span class="Other">,</span> <span class="Identifier">tkOf</span> <span class="Other">=</span> <span class="StringLit">"of"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkOr</span> <span class="Other">=</span> <span class="StringLit">"or"</span><span class="Other">,</span> <span class="Identifier">tkOut</span> <span class="Other">=</span> <span class="StringLit">"out"</span><span class="Other">,</span> <span class="Identifier">tkProc</span> <span class="Other">=</span> <span class="StringLit">"proc"</span><span class="Other">,</span> <span class="Identifier">tkPtr</span> <span class="Other">=</span> <span class="StringLit">"ptr"</span><span class="Other">,</span> <span class="Identifier">tkRaise</span> <span class="Other">=</span> <span class="StringLit">"raise"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkRef</span> <span class="Other">=</span> <span class="StringLit">"ref"</span><span class="Other">,</span> <span class="Identifier">tkReturn</span> <span class="Other">=</span> <span class="StringLit">"return"</span><span class="Other">,</span> <span class="Identifier">tkShl</span> <span class="Other">=</span> <span class="StringLit">"shl"</span><span class="Other">,</span> <span class="Identifier">tkShr</span> <span class="Other">=</span> <span class="StringLit">"shr"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkStatic</span> <span class="Other">=</span> <span class="StringLit">"static"</span><span class="Other">,</span> <span class="Identifier">tkTemplate</span> <span class="Other">=</span> <span class="StringLit">"template"</span><span class="Other">,</span> <span class="Identifier">tkTry</span> <span class="Other">=</span> <span class="StringLit">"try"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkTuple</span> <span class="Other">=</span> <span class="StringLit">"tuple"</span><span class="Other">,</span> <span class="Identifier">tkType</span> <span class="Other">=</span> <span class="StringLit">"type"</span><span class="Other">,</span> <span class="Identifier">tkUsing</span> <span class="Other">=</span> <span class="StringLit">"using"</span><span class="Other">,</span> <span class="Identifier">tkVar</span> <span class="Other">=</span> <span class="StringLit">"var"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkWhen</span> <span class="Other">=</span> <span class="StringLit">"when"</span><span class="Other">,</span> <span class="Identifier">tkWhile</span> <span class="Other">=</span> <span class="StringLit">"while"</span><span class="Other">,</span> <span class="Identifier">tkXor</span> <span class="Other">=</span> <span class="StringLit">"xor"</span><span class="Other">,</span> <span class="Identifier">tkYield</span> <span class="Other">=</span> <span class="StringLit">"yield"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkIntLit</span> <span class="Other">=</span> <span class="StringLit">"tkIntLit"</span><span class="Other">,</span> <span class="Identifier">tkInt8Lit</span> <span class="Other">=</span> <span class="StringLit">"tkInt8Lit"</span><span class="Other">,</span> <span class="Identifier">tkInt16Lit</span> <span class="Other">=</span> <span class="StringLit">"tkInt16Lit"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkInt32Lit</span> <span class="Other">=</span> <span class="StringLit">"tkInt32Lit"</span><span class="Other">,</span> <span class="Identifier">tkInt64Lit</span> <span class="Other">=</span> <span class="StringLit">"tkInt64Lit"</span><span class="Other">,</span> <span class="Identifier">tkUIntLit</span> <span class="Other">=</span> <span class="StringLit">"tkUIntLit"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkUInt8Lit</span> <span class="Other">=</span> <span class="StringLit">"tkUInt8Lit"</span><span class="Other">,</span> <span class="Identifier">tkUInt16Lit</span> <span class="Other">=</span> <span class="StringLit">"tkUInt16Lit"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkUInt32Lit</span> <span class="Other">=</span> <span class="StringLit">"tkUInt32Lit"</span><span class="Other">,</span> <span class="Identifier">tkUInt64Lit</span> <span class="Other">=</span> <span class="StringLit">"tkUInt64Lit"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkFloatLit</span> <span class="Other">=</span> <span class="StringLit">"tkFloatLit"</span><span class="Other">,</span> <span class="Identifier">tkFloat32Lit</span> <span class="Other">=</span> <span class="StringLit">"tkFloat32Lit"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkFloat64Lit</span> <span class="Other">=</span> <span class="StringLit">"tkFloat64Lit"</span><span class="Other">,</span> <span class="Identifier">tkFloat128Lit</span> <span class="Other">=</span> <span class="StringLit">"tkFloat128Lit"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkStrLit</span> <span class="Other">=</span> <span class="StringLit">"tkStrLit"</span><span class="Other">,</span> <span class="Identifier">tkRStrLit</span> <span class="Other">=</span> <span class="StringLit">"tkRStrLit"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkTripleStrLit</span> <span class="Other">=</span> <span class="StringLit">"tkTripleStrLit"</span><span class="Other">,</span> <span class="Identifier">tkGStrLit</span> <span class="Other">=</span> <span class="StringLit">"tkGStrLit"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkGTripleStrLit</span> <span class="Other">=</span> <span class="StringLit">"tkGTripleStrLit"</span><span class="Other">,</span> <span class="Identifier">tkCharLit</span> <span class="Other">=</span> <span class="StringLit">"tkCharLit"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkCustomLit</span> <span class="Other">=</span> <span class="StringLit">"tkCustomLit"</span><span class="Other">,</span> <span class="Identifier">tkParLe</span> <span class="Other">=</span> <span class="StringLit">"("</span><span class="Other">,</span> <span class="Identifier">tkParRi</span> <span class="Other">=</span> <span class="StringLit">")"</span><span class="Other">,</span> <span class="Identifier">tkBracketLe</span> <span class="Other">=</span> <span class="StringLit">"["</span><span class="Other">,</span>
|
|
<span class="Identifier">tkBracketRi</span> <span class="Other">=</span> <span class="StringLit">"]"</span><span class="Other">,</span> <span class="Identifier">tkCurlyLe</span> <span class="Other">=</span> <span class="StringLit">"{"</span><span class="Other">,</span> <span class="Identifier">tkCurlyRi</span> <span class="Other">=</span> <span class="StringLit">"}"</span><span class="Other">,</span> <span class="Identifier">tkBracketDotLe</span> <span class="Other">=</span> <span class="StringLit">"[."</span><span class="Other">,</span>
|
|
<span class="Identifier">tkBracketDotRi</span> <span class="Other">=</span> <span class="StringLit">".]"</span><span class="Other">,</span> <span class="Identifier">tkCurlyDotLe</span> <span class="Other">=</span> <span class="StringLit">"{."</span><span class="Other">,</span> <span class="Identifier">tkCurlyDotRi</span> <span class="Other">=</span> <span class="StringLit">".}"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkParDotLe</span> <span class="Other">=</span> <span class="StringLit">"(."</span><span class="Other">,</span> <span class="Identifier">tkParDotRi</span> <span class="Other">=</span> <span class="StringLit">".)"</span><span class="Other">,</span> <span class="Identifier">tkComma</span> <span class="Other">=</span> <span class="StringLit">","</span><span class="Other">,</span> <span class="Identifier">tkSemiColon</span> <span class="Other">=</span> <span class="StringLit">";"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkColon</span> <span class="Other">=</span> <span class="StringLit">":"</span><span class="Other">,</span> <span class="Identifier">tkColonColon</span> <span class="Other">=</span> <span class="StringLit">"::"</span><span class="Other">,</span> <span class="Identifier">tkEquals</span> <span class="Other">=</span> <span class="StringLit">"="</span><span class="Other">,</span> <span class="Identifier">tkDot</span> <span class="Other">=</span> <span class="StringLit">"."</span><span class="Other">,</span>
|
|
<span class="Identifier">tkDotDot</span> <span class="Other">=</span> <span class="StringLit">".."</span><span class="Other">,</span> <span class="Identifier">tkBracketLeColon</span> <span class="Other">=</span> <span class="StringLit">"[:"</span><span class="Other">,</span> <span class="Identifier">tkOpr</span><span class="Other">,</span> <span class="Identifier">tkComment</span><span class="Other">,</span> <span class="Identifier">tkAccent</span> <span class="Other">=</span> <span class="StringLit">"`"</span><span class="Other">,</span>
|
|
<span class="Identifier">tkSpaces</span><span class="Other">,</span> <span class="Identifier">tkInfixOpr</span><span class="Other">,</span> <span class="Identifier">tkPrefixOpr</span><span class="Other">,</span> <span class="Identifier">tkPostfixOpr</span><span class="Other">,</span> <span class="Identifier">tkHideableStart</span><span class="Other">,</span>
|
|
<span class="Identifier">tkHideableEnd</span></pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L38" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L38" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
<div id="TokTypes">
|
|
<dt><pre><a href="lexer.html#TokTypes"><span class="Identifier">TokTypes</span></a> <span class="Other">=</span> <span class="Identifier">set</span><span class="Other">[</span><a href="lexer.html#TokType"><span class="Identifier">TokType</span></a><span class="Other">]</span></pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L81" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L81" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</dl>
|
|
</div>
|
|
<div class="section" id="10">
|
|
<h1><a class="toc-backref" href="#10">Consts</a></h1>
|
|
<dl class="item">
|
|
<div id="numChars">
|
|
<dt><pre><a href="lexer.html#numChars"><span class="Identifier">numChars</span></a><span class="Other">:</span> <span class="Identifier">set</span><span class="Other">[</span><span class="Identifier">char</span><span class="Other">]</span> <span class="Other">=</span> <span class="Other">{</span><span class="CharLit">'0'</span><span class="Other">..</span><span class="CharLit">'9'</span><span class="Other">,</span> <span class="CharLit">'a'</span><span class="Other">..</span><span class="CharLit">'z'</span><span class="Other">,</span> <span class="CharLit">'A'</span><span class="Other">..</span><span class="CharLit">'Z'</span><span class="Other">}</span></pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L28" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L28" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
<div id="OpChars">
|
|
<dt><pre><a href="lexer.html#OpChars"><span class="Identifier">OpChars</span></a><span class="Other">:</span> <span class="Identifier">set</span><span class="Other">[</span><span class="Identifier">char</span><span class="Other">]</span> <span class="Other">=</span> <span class="Other">{</span><span class="CharLit">'+'</span><span class="Other">,</span> <span class="CharLit">'-'</span><span class="Other">,</span> <span class="CharLit">'*'</span><span class="Other">,</span> <span class="CharLit">'/'</span><span class="Other">,</span> <span class="CharLit">'\\'</span><span class="Other">,</span> <span class="CharLit">'<'</span><span class="Other">,</span> <span class="CharLit">'>'</span><span class="Other">,</span> <span class="CharLit">'!'</span><span class="Other">,</span> <span class="CharLit">'?'</span><span class="Other">,</span> <span class="CharLit">'^'</span><span class="Other">,</span> <span class="CharLit">'.'</span><span class="Other">,</span>
|
|
<span class="CharLit">'|'</span><span class="Other">,</span> <span class="CharLit">'='</span><span class="Other">,</span> <span class="CharLit">'%'</span><span class="Other">,</span> <span class="CharLit">'&'</span><span class="Other">,</span> <span class="CharLit">'$'</span><span class="Other">,</span> <span class="CharLit">'@'</span><span class="Other">,</span> <span class="CharLit">'~'</span><span class="Other">,</span> <span class="CharLit">':'</span><span class="Other">}</span></pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L31" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L31" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
<div id="SymChars">
|
|
<dt><pre><a href="lexer.html#SymChars"><span class="Identifier">SymChars</span></a><span class="Other">:</span> <span class="Identifier">set</span><span class="Other">[</span><span class="Identifier">char</span><span class="Other">]</span> <span class="Other">=</span> <span class="Other">{</span><span class="CharLit">'a'</span><span class="Other">..</span><span class="CharLit">'z'</span><span class="Other">,</span> <span class="CharLit">'A'</span><span class="Other">..</span><span class="CharLit">'Z'</span><span class="Other">,</span> <span class="CharLit">'0'</span><span class="Other">..</span><span class="CharLit">'9'</span><span class="Other">,</span> <span class="CharLit">'\x80'</span><span class="Other">..</span><span class="CharLit">'\xFF'</span><span class="Other">}</span></pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L29" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L29" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
<div id="SymStartChars">
|
|
<dt><pre><a href="lexer.html#SymStartChars"><span class="Identifier">SymStartChars</span></a><span class="Other">:</span> <span class="Identifier">set</span><span class="Other">[</span><span class="Identifier">char</span><span class="Other">]</span> <span class="Other">=</span> <span class="Other">{</span><span class="CharLit">'a'</span><span class="Other">..</span><span class="CharLit">'z'</span><span class="Other">,</span> <span class="CharLit">'A'</span><span class="Other">..</span><span class="CharLit">'Z'</span><span class="Other">,</span> <span class="CharLit">'\x80'</span><span class="Other">..</span><span class="CharLit">'\xFF'</span><span class="Other">}</span></pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L30" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L30" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
<div id="tokKeywordHigh">
|
|
<dt><pre><a href="lexer.html#tokKeywordHigh"><span class="Identifier">tokKeywordHigh</span></a> <span class="Other">=</span> <span class="DecNumber">tkYield</span></pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L89" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L89" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
<div id="tokKeywordLow">
|
|
<dt><pre><a href="lexer.html#tokKeywordLow"><span class="Identifier">tokKeywordLow</span></a> <span class="Other">=</span> <span class="DecNumber">tkAddr</span></pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L88" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L88" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</dl>
|
|
</div>
|
|
<div class="section" id="12">
|
|
<h1><a class="toc-backref" href="#12">Procs</a></h1>
|
|
<dl class="item">
|
|
<div id="$-procs-all">
|
|
<div id="$,Token">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#%24%2CToken"><span class="Identifier">`$`</span></a><span class="Other">(</span><span class="Identifier">tok</span><span class="Other">:</span> <a href="lexer.html#Token"><span class="Identifier">Token</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L158" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L158" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="closeLexer-procs-all">
|
|
<div id="closeLexer,Lexer">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#closeLexer%2CLexer"><span class="Identifier">closeLexer</span></a><span class="Other">(</span><span class="Identifier">lex</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="lexer.html#Lexer"><span class="Identifier">Lexer</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L194" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L194" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="getIndentWidth-procs-all">
|
|
<div id="getIndentWidth,FileIndex,PLLStream,IdentCache,ConfigRef">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#getIndentWidth%2CFileIndex%2CPLLStream%2CIdentCache%2CConfigRef"><span class="Identifier">getIndentWidth</span></a><span class="Other">(</span><span class="Identifier">fileIdx</span><span class="Other">:</span> <a href="lineinfos.html#FileIndex"><span class="Identifier">FileIndex</span></a><span class="Other">;</span> <span class="Identifier">inputstream</span><span class="Other">:</span> <a href="llstream.html#PLLStream"><span class="Identifier">PLLStream</span></a><span class="Other">;</span>
|
|
<span class="Identifier">cache</span><span class="Other">:</span> <a href="idents.html#IdentCache"><span class="Identifier">IdentCache</span></a><span class="Other">;</span> <span class="Identifier">config</span><span class="Other">:</span> <a href="options.html#ConfigRef"><span class="Identifier">ConfigRef</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">int</span> {.
|
|
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">Exception</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">,</span> <span class="Identifier">KeyError</span><span class="Other">,</span> <span class="Identifier">ERecoverableError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span>
|
|
<span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">ReadDirEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadEnvEffect</span><span class="Other">]</span><span class="Other">,</span>
|
|
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L1353" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L1353" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="getLineInfo-procs-all">
|
|
<div id="getLineInfo,Lexer,Token">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#getLineInfo%2CLexer%2CToken"><span class="Identifier">getLineInfo</span></a><span class="Other">(</span><span class="Identifier">L</span><span class="Other">:</span> <a href="lexer.html#Lexer"><span class="Identifier">Lexer</span></a><span class="Other">;</span> <span class="Identifier">tok</span><span class="Other">:</span> <a href="lexer.html#Token"><span class="Identifier">Token</span></a><span class="Other">)</span><span class="Other">:</span> <a href="lineinfos.html#TLineInfo"><span class="Identifier">TLineInfo</span></a> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
|
|
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L133" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L133" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="getPrecedence-procs-all">
|
|
<div id="getPrecedence,PIdent">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#getPrecedence%2CPIdent"><span class="Identifier">getPrecedence</span></a><span class="Other">(</span><span class="Identifier">ident</span><span class="Other">:</span> <a href="idents.html#PIdent"><span class="Identifier">PIdent</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">int</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
assumes ident is binary operator already
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L1368" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L1368" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
<div id="getPrecedence,Token">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#getPrecedence%2CToken"><span class="Identifier">getPrecedence</span></a><span class="Other">(</span><span class="Identifier">tok</span><span class="Other">:</span> <a href="lexer.html#Token"><span class="Identifier">Token</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">int</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
Calculates the precedence of the given token.
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L943" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L943" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="isKeyword-procs-all">
|
|
<div id="isKeyword,TokType">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#isKeyword%2CTokType"><span class="Identifier">isKeyword</span></a><span class="Other">(</span><span class="Identifier">kind</span><span class="Other">:</span> <a href="lexer.html#TokType"><span class="Identifier">TokType</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L141" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L141" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="isNimIdentifier-procs-all">
|
|
<div id="isNimIdentifier,string">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#isNimIdentifier%2Cstring"><span class="Identifier">isNimIdentifier</span></a><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L146" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L146" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="lexMessage-procs-all">
|
|
<div id="lexMessage,Lexer,TMsgKind,string">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#lexMessage%2CLexer%2CTMsgKind%2Cstring"><span class="Identifier">lexMessage</span></a><span class="Other">(</span><span class="Identifier">L</span><span class="Other">:</span> <a href="lexer.html#Lexer"><span class="Identifier">Lexer</span></a><span class="Other">;</span> <span class="Identifier">msg</span><span class="Other">:</span> <a href="lineinfos.html#TMsgKind"><span class="Identifier">TMsgKind</span></a><span class="Other">;</span> <span class="Identifier">arg</span> <span class="Other">=</span> <span class="StringLit">""</span><span class="Other">)</span> {.
|
|
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">Exception</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">,</span> <span class="Identifier">KeyError</span><span class="Other">,</span> <span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">ERecoverableError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span>
|
|
<span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">ReadDirEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadEnvEffect</span><span class="Other">]</span><span class="Other">,</span>
|
|
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L208" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L208" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="lexMessageTok-procs-all">
|
|
<div id="lexMessageTok,Lexer,TMsgKind,Token,string">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#lexMessageTok%2CLexer%2CTMsgKind%2CToken%2Cstring"><span class="Identifier">lexMessageTok</span></a><span class="Other">(</span><span class="Identifier">L</span><span class="Other">:</span> <a href="lexer.html#Lexer"><span class="Identifier">Lexer</span></a><span class="Other">;</span> <span class="Identifier">msg</span><span class="Other">:</span> <a href="lineinfos.html#TMsgKind"><span class="Identifier">TMsgKind</span></a><span class="Other">;</span> <span class="Identifier">tok</span><span class="Other">:</span> <a href="lexer.html#Token"><span class="Identifier">Token</span></a><span class="Other">;</span> <span class="Identifier">arg</span> <span class="Other">=</span> <span class="StringLit">""</span><span class="Other">)</span> {.
|
|
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">Exception</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">,</span> <span class="Identifier">KeyError</span><span class="Other">,</span> <span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">ERecoverableError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span>
|
|
<span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">ReadDirEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadEnvEffect</span><span class="Other">]</span><span class="Other">,</span>
|
|
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L211" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L211" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="openLexer-procs-all">
|
|
<div id="openLexer,Lexer,FileIndex,PLLStream,IdentCache,ConfigRef">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#openLexer%2CLexer%2CFileIndex%2CPLLStream%2CIdentCache%2CConfigRef"><span class="Identifier">openLexer</span></a><span class="Other">(</span><span class="Identifier">lex</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="lexer.html#Lexer"><span class="Identifier">Lexer</span></a><span class="Other">;</span> <span class="Identifier">fileIdx</span><span class="Other">:</span> <a href="lineinfos.html#FileIndex"><span class="Identifier">FileIndex</span></a><span class="Other">;</span> <span class="Identifier">inputstream</span><span class="Other">:</span> <a href="llstream.html#PLLStream"><span class="Identifier">PLLStream</span></a><span class="Other">;</span>
|
|
<span class="Identifier">cache</span><span class="Other">:</span> <a href="idents.html#IdentCache"><span class="Identifier">IdentCache</span></a><span class="Other">;</span> <span class="Identifier">config</span><span class="Other">:</span> <a href="options.html#ConfigRef"><span class="Identifier">ConfigRef</span></a><span class="Other">)</span> {.
|
|
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">Exception</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">RootEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L178" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L178" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
<div id="openLexer,Lexer,AbsoluteFile,PLLStream,IdentCache,ConfigRef">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#openLexer%2CLexer%2CAbsoluteFile%2CPLLStream%2CIdentCache%2CConfigRef"><span class="Identifier">openLexer</span></a><span class="Other">(</span><span class="Identifier">lex</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="lexer.html#Lexer"><span class="Identifier">Lexer</span></a><span class="Other">;</span> <span class="Identifier">filename</span><span class="Other">:</span> <a href="pathutils.html#AbsoluteFile"><span class="Identifier">AbsoluteFile</span></a><span class="Other">;</span> <span class="Identifier">inputstream</span><span class="Other">:</span> <a href="llstream.html#PLLStream"><span class="Identifier">PLLStream</span></a><span class="Other">;</span>
|
|
<span class="Identifier">cache</span><span class="Other">:</span> <a href="idents.html#IdentCache"><span class="Identifier">IdentCache</span></a><span class="Other">;</span> <span class="Identifier">config</span><span class="Other">:</span> <a href="options.html#ConfigRef"><span class="Identifier">ConfigRef</span></a><span class="Other">)</span> {.
|
|
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">Exception</span><span class="Other">,</span> <span class="Identifier">KeyError</span><span class="Other">]</span><span class="Other">,</span>
|
|
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">ReadDirEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L190" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L190" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="prettyTok-procs-all">
|
|
<div id="prettyTok,Token">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#prettyTok%2CToken"><span class="Identifier">prettyTok</span></a><span class="Other">(</span><span class="Identifier">tok</span><span class="Other">:</span> <a href="lexer.html#Token"><span class="Identifier">Token</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L170" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L170" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="printTok-procs-all">
|
|
<div id="printTok,ConfigRef,Token">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#printTok%2CConfigRef%2CToken"><span class="Identifier">printTok</span></a><span class="Other">(</span><span class="Identifier">conf</span><span class="Other">:</span> <a href="options.html#ConfigRef"><span class="Identifier">ConfigRef</span></a><span class="Other">;</span> <span class="Identifier">tok</span><span class="Other">:</span> <a href="lexer.html#Token"><span class="Identifier">Token</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">Exception</span><span class="Other">,</span> <span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span>
|
|
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L174" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L174" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="rawGetTok-procs-all">
|
|
<div id="rawGetTok,Lexer,Token">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#rawGetTok%2CLexer%2CToken"><span class="Identifier">rawGetTok</span></a><span class="Other">(</span><span class="Identifier">L</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="lexer.html#Lexer"><span class="Identifier">Lexer</span></a><span class="Other">;</span> <span class="Identifier">tok</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="lexer.html#Token"><span class="Identifier">Token</span></a><span class="Other">)</span> {.
|
|
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">Exception</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">,</span> <span class="Identifier">KeyError</span><span class="Other">,</span> <span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">ERecoverableError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span>
|
|
<span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">ReadDirEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadEnvEffect</span><span class="Other">]</span><span class="Other">,</span>
|
|
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/lexer.nim#L1175" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L1175" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</dl>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="twelve-columns footer">
|
|
<span class="nim-sprite"></span>
|
|
<br>
|
|
<small style="color: var(--hint);">Made with Nim. Generated: 2025-12-28 15:55:43 UTC</small>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script defer data-domain="nim-lang.org" src="https://plausible.io/js/plausible.js"></script>
|
|
|
|
</body>
|
|
</html>
|