Esempio n. 1
0
def end_element(name):
    whitespace()
    string("</")
    commit()
    if name != xml_name():
        fail()
    whitespace()
    close_angle()
Esempio n. 2
0
def end_element(name):
    whitespace()
    string("</")
    commit()
    if name != xml_name():
        fail()
    whitespace()
    close_angle()
Esempio n. 3
0
def processing(parser=False):
    parser = parser or compose(build_string, partial(many, partial(not_one_of, "?")))

    string("<?")
    commit()
    result = parser()
    whitespace()

    string("?>")
    return result
Esempio n. 4
0
def processing(parser = False):
    parser = parser or compose(build_string, partial(many, partial(not_one_of, '?')))

    string('<?')
    commit()
    result = parser()
    whitespace()
    
    string('?>')
    return result
Esempio n. 5
0
def caseless_string(s):
    """Attempts to match input to the letters in the string, without regard for case.
    """
    return string(zip(s.lower(), s.upper()))
Esempio n. 6
0
def closed_element():
    string("/>")
    return []
Esempio n. 7
0
def doctype():
    string("<!DOCTYPE")
    commit()
    many_until(any_token, close_angle)
Esempio n. 8
0
def comment():
    string("<!--")
    commit()
    result, _ = many_until(any_token, tri(partial(string, "-->")))
    return "COMMENT", build_string(result)
Esempio n. 9
0
def xmldecl_attr(name, parser):
    string(name)
    lexeme(equals)
    value = quoted(version_num)
    return value
Esempio n. 10
0
def special(name):
  whitespace()
  string(name)
  return name
Esempio n. 11
0
def closed_element():
    string('/>')
    return []
Esempio n. 12
0
def doctype():
    string('<!DOCTYPE')
    commit()
    many_until(any_token, close_angle)
Esempio n. 13
0
def comment():
    string("<!--")
    commit()
    result, _ = many_until(any_token, tri(partial(string, "-->")))
    return "COMMENT", build_string(result)
Esempio n. 14
0
def version_num():
    string('1.')
    return "1." + build_string(many1(decimal_digit))
Esempio n. 15
0
def caseless_string(s):
    """Attempts to match input to the letters in the string, without regard for case.
    """
    return string(zip(s.lower(), s.upper()))
Esempio n. 16
0
def reserved_op(name):
  assert name in reserved_operators
  whitespace()
  string(name)
  not_followed_by(operator_char)
  return name
Esempio n. 17
0
def xmldecl_attr(name, parser):
    string(name)
    lexeme(equals)
    value = quoted(version_num)
    return value
Esempio n. 18
0
def reserved(name):
  assert name in reserved_words
  whitespace()
  string(name)
  not_followed_by(identifier_char)
  return name
Esempio n. 19
0
def version_num():
    string("1.")
    return "1." + build_string(many1(decimal_digit))