[Python-Dev] PEP 498: Literal String Interpolation is ready for pronouncement (original) (raw)
Eric V. Smith eric at trueblade.com
Sat Sep 5 20:31:21 CEST 2015
- Previous message (by thread): [Python-Dev] PEP 498: Literal String Interpolation is ready for pronouncement
- Next message (by thread): [Python-Dev] PEP 498: Literal String Interpolation is ready for pronouncement
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Actually, my current implementation doesn't use the lexer, although I suppose it could. I'm currently manually scanning the string, keeping track of strings and parens. To find the end of an expression, it looks for a '!', ':', or non-doubled '}', not inside of a string or (), [], or {}. There's a special case for '!=' so the bang isn't seen as ending the expression.
Ignore the part about non-doubled '}'. The actual description is:
To find the end of an expression, it looks for a '!', ':', or '}', not inside of a string or (), [], or {}. There's a special case for '!=' so the bang isn't seen as ending the expression.
Eric.
- Previous message (by thread): [Python-Dev] PEP 498: Literal String Interpolation is ready for pronouncement
- Next message (by thread): [Python-Dev] PEP 498: Literal String Interpolation is ready for pronouncement
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]