Documentation
¶
Index ¶
- Constants
- func DecodeEscape(in *bytes.Buffer, byteMode bool) (out *bytes.Buffer, err error)
- func NewLex(r io.Reader, filename string, mode string) (*yyLex, error)
- func Parse(in io.Reader, filename string, mode string) (mod ast.Mod, err error)
- func ParseString(in string, mode string) (ast.Ast, error)
- func SetDebug(level int)
- type LexToken
- type LexTokens
Constants ¶
const AND = 57379
const ANDEQ = 57355
const AS = 57380
const ASSERT = 57381
const BREAK = 57382
const CLASS = 57383
const CONTINUE = 57384
const DEDENT = 57350
const DEF = 57385
const DEL = 57386
const DIVDIV = 57363
const DIVDIVEQ = 57364
const DIVEQ = 57365
const ELIF = 57387
const ELIPSIS = 57362
const ELSE = 57388
const ENDMARKER = 57347
const EQEQ = 57370
const EVAL_INPUT = 57411
const EXCEPT = 57389
const FALSE = 57376
const FILE_INPUT = 57410
const FINALLY = 57390
const FOR = 57391
const FROM = 57392
const GLOBAL = 57393
const GTEQ = 57371
const GTGT = 57372
const GTGTEQ = 57373
const HATEQ = 57374
const IF = 57394
const IMPORT = 57395
const IN = 57396
const INDENT = 57349
const IS = 57397
const LAMBDA = 57398
const LTEQ = 57368
const LTGT = 57369
const LTLT = 57366
const LTLTEQ = 57367
const MINUSEQ = 57360
const MINUSGT = 57361
const NAME = 57348
const NEWLINE = 57346
const NONE = 57377
const NONLOCAL = 57399
const NOT = 57400
const NUMBER = 57352
const OR = 57401
const PASS = 57402
const PERCEQ = 57354
const PIPEEQ = 57375
const PLINGEQ = 57353
const PLUSEQ = 57359
const RAISE = 57403
const RETURN = 57404
const SINGLE_INPUT = 57409
const STAREQ = 57358
const STARSTAR = 57356
const STARSTAREQ = 57357
const STRING = 57351
const TRUE = 57378
const TRY = 57405
const WHILE = 57406
const WITH = 57407
const YIELD = 57408
Variables ¶
This section is empty.
Functions ¶
func DecodeEscape ¶
DecodeEscape unescapes a backslash-escaped buffer
byteMode indicates whether we are creating a unicode string or a bytes output
func NewLex ¶
Create a new lexer
The mode argument specifies what kind of code must be compiled; it can be 'exec' if source consists of a sequence of statements, 'eval' if it consists of a single expression, or 'single' if it consists of a single interactive statement
Types ¶
type LexToken ¶
type LexToken struct {
// contains filtered or unexported fields
}
A Token with value