示例#1
0
def test_tokenizer():
    t=tokenizer('void* my_fn(void)')
    assert not t.empty()
    assert next(t) == 'void'
    assert next(t) == '*'
    assert next(t) == 'my_fn'
    assert next(t) == '('
    assert next(t) == 'void'
    assert next(t) == ')'
    assert t.empty()
示例#2
0
def test_tokenizer():
    t = tokenizer('void* my_fn(void)')
    assert not t.empty()
    assert next(t) == 'void'
    assert next(t) == '*'
    assert next(t) == 'my_fn'
    assert next(t) == '('
    assert next(t) == 'void'
    assert next(t) == ')'
    assert t.empty()
示例#3
0
def test_tokenizer_keywords():
    define('long long', ctypes.c_longlong)
    t = tokenizer('void* my_fn(long long)')
    assert not t.empty()
    assert next(t) == 'void'
    assert next(t) == '*'
    assert next(t) == 'my_fn'
    assert next(t) == '('
    assert next(t) == 'long long'
    assert next(t) == ')'
    assert t.empty()
示例#4
0
def test_tokenizer_keywords():
    define('long long', ctypes.c_longlong)
    t=tokenizer('void* my_fn(long long)')
    assert not t.empty()
    assert next(t) == 'void'
    assert next(t) == '*'
    assert next(t) == 'my_fn'
    assert next(t) == '('
    assert next(t) == 'long long'
    assert next(t) == ')'
    assert t.empty()