Changeset 3518:7cf4b7b1911c in livinglogic.python.xist

Show
Ignore:
Timestamp:
07/16/08 22:24:26 (11 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Add a capitalize method to strings in UL4.

Files:
4 modified

Legend:

Unmodified
Added
Removed
  • NEWS.rst

    r3516 r3518  
     1Changes in 3.3.3 (released ??/??/2008) 
     2-------------------------------------- 
     3 
     4*   Strings in UL4 have gained a new method ``capitalize`` method. 
     5 
     6 
    17Changes in 3.3.2 (released 07/15/2008) 
    28-------------------------------------- 
  • docs/UL4.rst

    r3505 r3518  
    638638 
    639639 
     640``capitalize`` 
     641:::::::::::::: 
     642 
     643The ``capitalize`` method of strings returns a copy of the string for with its 
     644first letter capitalized. 
     645 
     646 
    640647``startswith`` 
    641648:::::::::::::: 
  • src/ll/ul4c.py

    r3514 r3518  
    976976                        raise UnknownFunctionError(opcode.arg) 
    977977                elif opcode.code == "callmeth0": 
    978                     if opcode.arg in ("split", "rsplit", "strip", "lstrip", "rstrip", "upper", "lower", "isoformat"): 
     978                    if opcode.arg in ("split", "rsplit", "strip", "lstrip", "rstrip", "upper", "lower", "capitalize", "isoformat"): 
    979979                        _code("reg%d = reg%d.%s()" % (opcode.r1, opcode.r2, opcode.arg)) 
    980980                    elif opcode.arg == "items": 
  • test/test_ul4.py

    r3513 r3518  
    807807 
    808808 
     809def test_method_capitalize(): 
     810    check("Gurk", "<?print 'gURK'.capitalize()?>") 
     811 
     812 
    809813def test_method_startswith(): 
    810814    check("True", "<?print 'gurkhurz'.startswith('gurk')?>")