| Copyright | (C) CSIRO 2017-2019 |
|---|---|
| License | BSD3 |
| Maintainer | Isaac Elliott <isaace71295@gmail.com> |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Language.Python.Syntax.Ident
Contents
Description
Synopsis
- data Ident (v :: [*]) a = MkIdent {
- _identAnn :: a
- _identValue :: String
- _identWhitespace :: [Whitespace]
- identAnn :: Lens (Ident v a) (Ident v a) a a
- identValue :: Lens (Ident v a) (Ident '[] a) String String
- identWhitespace :: Lens (Ident v a) (Ident v a) [Whitespace] [Whitespace]
- isIdentifierStart :: Char -> Bool
- isIdentifierChar :: Char -> Bool
Documentation
data Ident (v :: [*]) a Source #
An identifier. Like many types in hpython, it has an optional annotation and tracks its trailing whitespace.
Raw Idents have an IsString instance.
See https://docs.python.org/3.5/reference/lexical_analysis.html#identifiers
Constructors
| MkIdent | |
Fields
| |
Instances
Lenses
identWhitespace :: Lens (Ident v a) (Ident v a) [Whitespace] [Whitespace] Source #
Extra functions
isIdentifierStart :: Char -> Bool Source #
Determine whether this character could start a valid identifier
isIdentifierChar :: Char -> Bool Source #
Determine whether this character could be part of a valid identifier