Skip to content

Instantly share code, notes, and snippets.

@michaelwu
Created June 15, 2015 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelwu/a889fae11dc67b8c5165 to your computer and use it in GitHub Desktop.
Save michaelwu/a889fae11dc67b8c5165 to your computer and use it in GitHub Desktop.
webidl.rs
// Generated by rust-peg. Do not edit.
#![allow(non_snake_case, unused)]
use self::RuleResult::{Matched, Failed};
fn escape_default(s: &str) -> String {
s.chars().flat_map(|c| c.escape_default()).collect()
}
fn char_range_at(s: &str, pos: usize) -> (char, usize) {
let c = &s[pos..].chars().next().unwrap();
let next_pos = pos + c.len_utf8();
(*c, next_pos)
}
#[derive(Clone)]
enum RuleResult<T> { Matched(usize, T), Failed, }
#[derive(PartialEq, Eq, Debug, Clone)]
pub struct ParseError {
pub line: usize,
pub column: usize,
pub offset: usize,
pub expected: ::std::collections::HashSet<&'static str>,
}
pub type ParseResult<T> = Result<T, ParseError>;
impl ::std::fmt::Display for ParseError {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter)
-> ::std::result::Result<(), ::std::fmt::Error> {
try!(write ! (
fmt , "error at {}:{}: expected " , self . line , self . column
));
if self.expected.len() == 1 {
try!(write ! (
fmt , "`{}`" , escape_default (
self . expected . iter ( ) . next ( ) . unwrap ( ) ) ));
} else {
let mut iter = self.expected.iter();
try!(write ! (
fmt , "one of `{}`" , escape_default (
iter . next ( ) . unwrap ( ) ) ));
for elem in iter {
try!(write ! ( fmt , ", `{}`" , escape_default ( elem ) ));
}
}
Ok(())
}
}
impl ::std::error::Error for ParseError {
fn description(&self) -> &str { "parse error" }
}
fn slice_eq(input: &str, state: &mut ParseState, pos: usize, m: &'static str)
-> RuleResult<()> {
#![inline]
#![allow(dead_code)]
let l = m.len();
if input.len() >= pos + l &&
&input.as_bytes()[pos..pos + l] == m.as_bytes() {
Matched(pos + l, ())
} else { state.mark_failure(pos, m) }
}
fn slice_eq_case_insensitive(input: &str, state: &mut ParseState, pos: usize,
m: &'static str) -> RuleResult<()> {
#![inline]
#![allow(dead_code)]
let mut used = 0usize;
let mut input_iter = input[pos..].chars().flat_map(|x| x.to_uppercase());
for m_char_upper in m.chars().flat_map(|x| x.to_uppercase()) {
used += m_char_upper.len_utf8();
let input_char_result = input_iter.next();
if input_char_result.is_none() ||
input_char_result.unwrap() != m_char_upper {
return state.mark_failure(pos, m);
}
}
Matched(pos + used, ())
}
fn any_char(input: &str, state: &mut ParseState, pos: usize)
-> RuleResult<()> {
#![inline]
#![allow(dead_code)]
if input.len() > pos {
let (_, next) = char_range_at(input, pos);
Matched(next, ())
} else { state.mark_failure(pos, "<character>") }
}
fn pos_to_line(input: &str, pos: usize) -> (usize, usize) {
let mut remaining = pos;
let mut lineno: usize = 1;
for line in input.lines() {
let line_length = line.len() + 1;
if remaining < line_length { return (lineno, remaining + 1); }
remaining -= line_length;
lineno += 1;
}
return (lineno, remaining + 1);
}
struct ParseState {
max_err_pos: usize,
expected: ::std::collections::HashSet<&'static str>,
}
impl ParseState {
fn new() -> ParseState {
ParseState{max_err_pos: 0,
expected: ::std::collections::HashSet::new(),}
}
fn mark_failure(&mut self, pos: usize, expected: &'static str)
-> RuleResult<()> {
if pos > self.max_err_pos {
self.max_err_pos = pos;
self.expected.clear();
}
if pos == self.max_err_pos { self.expected.insert(expected); }
Failed
}
}
fn parse_integer<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res =
{
let seq_res =
match slice_eq(input, state, pos, "-") {
Matched(newpos, value) => {
Matched(newpos, Some(value))
}
Failed => { Matched(pos, None) }
};
match seq_res {
Matched(pos, _) => {
{
let seq_res =
if input.len() > pos {
let (ch, next) =
char_range_at(input, pos);
match ch {
'1' ...'9' => Matched(next, ()),
_ => state.mark_failure(pos, "[1-9]"),
}
} else { state.mark_failure(pos, "[1-9]") };
match seq_res {
Matched(pos, _) => {
{
let mut repeat_pos = pos;
loop {
let pos = repeat_pos;
let step_res =
if input.len() > pos {
let (ch, next) =
char_range_at(input,
pos);
match ch {
'0' ...'9' =>
Matched(next, ()),
_ =>
state.mark_failure(pos,
"[0-9]"),
}
} else {
state.mark_failure(pos,
"[0-9]")
};
match step_res {
Matched(newpos, value) => {
repeat_pos = newpos;
}
Failed => { break ; }
}
}
Matched(repeat_pos, ())
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
{
let seq_res =
match slice_eq(input, state, pos, "-") {
Matched(newpos, value) => {
Matched(newpos, Some(value))
}
Failed => { Matched(pos, None) }
};
match seq_res {
Matched(pos, _) => {
{
let seq_res =
slice_eq(input, state, pos, "0");
match seq_res {
Matched(pos, _) => {
{
let seq_res =
if input.len() > pos {
let (ch, next) =
char_range_at(input,
pos);
match ch {
'X' | 'x' =>
Matched(next, ()),
_ =>
state.mark_failure(pos,
"[Xx]"),
}
} else {
state.mark_failure(pos,
"[Xx]")
};
match seq_res {
Matched(pos, _) => {
{
let mut repeat_pos =
pos;
let mut repeat_value =
vec!();
loop {
let pos =
repeat_pos;
let step_res =
if input.len()
>
pos
{
let (ch,
next) =
char_range_at(input,
pos);
match ch
{
'0'
...'9'
|
'A'
...'F'
|
'a'
...'f'
=>
Matched(next,
()),
_
=>
state.mark_failure(pos,
"[0-9A-Fa-f]"),
}
} else {
state.mark_failure(pos,
"[0-9A-Fa-f]")
};
match step_res
{
Matched(newpos,
value)
=> {
repeat_pos
=
newpos;
repeat_value.push(value);
}
Failed =>
{
break
;
}
}
}
if repeat_value.len()
>= 1usize {
Matched(repeat_pos,
())
} else { Failed }
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let seq_res =
match slice_eq(input, state, pos, "-") {
Matched(newpos, value) => {
Matched(newpos, Some(value))
}
Failed => { Matched(pos, None) }
};
match seq_res {
Matched(pos, _) => {
{
let seq_res =
slice_eq(input, state, pos, "0");
match seq_res {
Matched(pos, _) => {
{
let mut repeat_pos = pos;
loop {
let pos = repeat_pos;
let step_res =
if input.len() > pos {
let (ch, next) =
char_range_at(input,
pos);
match ch {
'0' ...'7' =>
Matched(next,
()),
_ =>
state.mark_failure(pos,
"[0-7]"),
}
} else {
state.mark_failure(pos,
"[0-7]")
};
match step_res {
Matched(newpos, value)
=> {
repeat_pos =
newpos;
}
Failed => { break ; }
}
}
Matched(repeat_pos, ())
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
}
}
}
}
fn parse_float<'input>(input: &'input str, state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let choice_res =
{
let seq_res =
match slice_eq(input, state, pos, "-") {
Matched(newpos, value) => {
Matched(newpos, Some(value))
}
Failed => { Matched(pos, None) }
};
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_significand(input, state, pos);
match seq_res {
Matched(pos, _) => {
match parse_exponent(input, state, pos) {
Matched(newpos, value) => {
Matched(newpos, Some(value))
}
Failed => { Matched(pos, None) }
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, ()),
Failed => {
let seq_res =
match slice_eq(input, state, pos, "-") {
Matched(newpos, value) => {
Matched(newpos, Some(value))
}
Failed => { Matched(pos, None) }
};
match seq_res {
Matched(pos, _) => {
{
let seq_res =
{
let mut repeat_pos = pos;
let mut repeat_value = vec!();
loop {
let pos = repeat_pos;
let step_res =
if input.len() > pos {
let (ch, next) =
char_range_at(input, pos);
match ch {
'0' ...'9' =>
Matched(next, ()),
_ =>
state.mark_failure(pos,
"[0-9]"),
}
} else {
state.mark_failure(pos,
"[0-9]")
};
match step_res {
Matched(newpos, value) => {
repeat_pos = newpos;
repeat_value.push(value);
}
Failed => { break ; }
}
}
if repeat_value.len() >= 1usize {
Matched(repeat_pos, ())
} else { Failed }
};
match seq_res {
Matched(pos, _) => {
parse_exponent(input, state, pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
}
}
fn parse_significand<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res =
{
let seq_res =
{
let mut repeat_pos = pos;
let mut repeat_value = vec!();
loop {
let pos = repeat_pos;
let step_res =
if input.len() > pos {
let (ch, next) =
char_range_at(input, pos);
match ch {
'0' ...'9' => Matched(next, ()),
_ => state.mark_failure(pos, "[0-9]"),
}
} else { state.mark_failure(pos, "[0-9]") };
match step_res {
Matched(newpos, value) => {
repeat_pos = newpos;
repeat_value.push(value);
}
Failed => { break ; }
}
}
if repeat_value.len() >= 1usize {
Matched(repeat_pos, ())
} else { Failed }
};
match seq_res {
Matched(pos, _) => {
{
let seq_res = slice_eq(input, state, pos, ".");
match seq_res {
Matched(pos, _) => {
{
let mut repeat_pos = pos;
loop {
let pos = repeat_pos;
let step_res =
if input.len() > pos {
let (ch, next) =
char_range_at(input,
pos);
match ch {
'0' ...'9' =>
Matched(next, ()),
_ =>
state.mark_failure(pos,
"[0-9]"),
}
} else {
state.mark_failure(pos,
"[0-9]")
};
match step_res {
Matched(newpos, value) => {
repeat_pos = newpos;
}
Failed => { break ; }
}
}
Matched(repeat_pos, ())
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let seq_res =
{
let mut repeat_pos = pos;
loop {
let pos = repeat_pos;
let step_res =
if input.len() > pos {
let (ch, next) =
char_range_at(input, pos);
match ch {
'0' ...'9' => Matched(next, ()),
_ => state.mark_failure(pos, "[0-9]"),
}
} else { state.mark_failure(pos, "[0-9]") };
match step_res {
Matched(newpos, value) => {
repeat_pos = newpos;
}
Failed => { break ; }
}
}
Matched(repeat_pos, ())
};
match seq_res {
Matched(pos, _) => {
{
let seq_res = slice_eq(input, state, pos, ".");
match seq_res {
Matched(pos, _) => {
{
let mut repeat_pos = pos;
let mut repeat_value = vec!();
loop {
let pos = repeat_pos;
let step_res =
if input.len() > pos {
let (ch, next) =
char_range_at(input,
pos);
match ch {
'0' ...'9' =>
Matched(next, ()),
_ =>
state.mark_failure(pos,
"[0-9]"),
}
} else {
state.mark_failure(pos,
"[0-9]")
};
match step_res {
Matched(newpos, value) => {
repeat_pos = newpos;
repeat_value.push(value);
}
Failed => { break ; }
}
}
if repeat_value.len() >= 1usize {
Matched(repeat_pos, ())
} else { Failed }
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
}
}
fn parse_exponent<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let seq_res =
if input.len() > pos {
let (ch, next) = char_range_at(input, pos);
match ch {
'E' | 'e' => Matched(next, ()),
_ => state.mark_failure(pos, "[Ee]"),
}
} else { state.mark_failure(pos, "[Ee]") };
match seq_res {
Matched(pos, _) => {
{
let seq_res =
match if input.len() > pos {
let (ch, next) = char_range_at(input, pos);
match ch {
'+' | '-' => Matched(next, ()),
_ => state.mark_failure(pos, "[+-]"),
}
} else { state.mark_failure(pos, "[+-]") } {
Matched(newpos, value) => {
Matched(newpos, Some(value))
}
Failed => { Matched(pos, None) }
};
match seq_res {
Matched(pos, _) => {
{
let mut repeat_pos = pos;
let mut repeat_value = vec!();
loop {
let pos = repeat_pos;
let step_res =
if input.len() > pos {
let (ch, next) =
char_range_at(input, pos);
match ch {
'0' ...'9' =>
Matched(next, ()),
_ =>
state.mark_failure(pos,
"[0-9]"),
}
} else {
state.mark_failure(pos, "[0-9]")
};
match step_res {
Matched(newpos, value) => {
repeat_pos = newpos;
repeat_value.push(value);
}
Failed => { break ; }
}
}
if repeat_value.len() >= 1usize {
Matched(repeat_pos, ())
} else { Failed }
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_identifier<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let seq_res =
match slice_eq(input, state, pos, "_") {
Matched(newpos, value) => { Matched(newpos, Some(value)) }
Failed => { Matched(pos, None) }
};
match seq_res {
Matched(pos, _) => {
{
let seq_res =
if input.len() > pos {
let (ch, next) = char_range_at(input, pos);
match ch {
'A' ...'Z' | 'a' ...'z' => Matched(next, ()),
_ => state.mark_failure(pos, "[A-Za-z]"),
}
} else { state.mark_failure(pos, "[A-Za-z]") };
match seq_res {
Matched(pos, _) => {
{
let mut repeat_pos = pos;
loop {
let pos = repeat_pos;
let step_res =
if input.len() > pos {
let (ch, next) =
char_range_at(input, pos);
match ch {
'0' ...'9' | 'A' ...'Z' | '_'
| 'a' ...'z' | '-' =>
Matched(next, ()),
_ =>
state.mark_failure(pos,
"[0-9A-Z_a-z-]"),
}
} else {
state.mark_failure(pos,
"[0-9A-Z_a-z-]")
};
match step_res {
Matched(newpos, value) => {
repeat_pos = newpos;
}
Failed => { break ; }
}
}
Matched(repeat_pos, ())
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_string<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let seq_res = slice_eq(input, state, pos, "\"");
match seq_res {
Matched(pos, _) => {
{
let seq_res =
{
let mut repeat_pos = pos;
loop {
let pos = repeat_pos;
let step_res =
if input.len() > pos {
let (ch, next) =
char_range_at(input, pos);
match ch {
'\"' =>
state.mark_failure(pos, "[^\"]"),
_ => Matched(next, ()),
}
} else {
state.mark_failure(pos, "[^\"]")
};
match step_res {
Matched(newpos, value) => {
repeat_pos = newpos;
}
Failed => { break ; }
}
}
Matched(repeat_pos, ())
};
match seq_res {
Matched(pos, _) => {
slice_eq(input, state, pos, "\"")
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_whitespace<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let mut repeat_pos = pos;
let mut repeat_value = vec!();
loop {
let pos = repeat_pos;
let step_res =
if input.len() > pos {
let (ch, next) = char_range_at(input, pos);
match ch {
'\t' | '\n' | '\\' | 'e' | ' ' => Matched(next, ()),
_ => state.mark_failure(pos, "[\t\n\\e ]"),
}
} else { state.mark_failure(pos, "[\t\n\\e ]") };
match step_res {
Matched(newpos, value) => {
repeat_pos = newpos;
repeat_value.push(value);
}
Failed => { break ; }
}
}
if repeat_value.len() >= 1usize {
Matched(repeat_pos, ())
} else { Failed }
}
}
fn parse_comment<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res =
{
let seq_res = slice_eq(input, state, pos, "//");
match seq_res {
Matched(pos, _) => {
{
let seq_res =
{
let mut repeat_pos = pos;
loop {
let pos = repeat_pos;
let step_res =
if input.len() > pos {
let (ch, next) =
char_range_at(input, pos);
match ch {
'\n' =>
state.mark_failure(pos,
"[^\n]"),
_ => Matched(next, ()),
}
} else {
state.mark_failure(pos,
"[^\n]")
};
match step_res {
Matched(newpos, value) => {
repeat_pos = newpos;
}
Failed => { break ; }
}
}
Matched(repeat_pos, ())
};
match seq_res {
Matched(pos, _) => {
if input.len() > pos {
let (ch, next) =
char_range_at(input, pos);
match ch {
'\n' => Matched(next, ()),
_ =>
state.mark_failure(pos, "[\n]"),
}
} else { state.mark_failure(pos, "[\n]") }
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let seq_res = slice_eq(input, state, pos, "/*");
match seq_res {
Matched(pos, _) => {
parse_comment_content(input, state, pos)
}
Failed => Failed,
}
}
}
}
}
fn parse_comment_content<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res = slice_eq(input, state, pos, "*/");
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let seq_res = any_char(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_comment_content(input, state, pos)
}
Failed => Failed,
}
}
}
}
}
fn parse_ws<'input>(input: &'input str, state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let choice_res =
{
let seq_res = parse_whitespace(input, state, pos);
match seq_res {
Matched(pos, _) => { parse_ws(input, state, pos) }
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
{
let seq_res = parse_comment(input, state, pos);
match seq_res {
Matched(pos, _) => { parse_ws(input, state, pos) }
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
}
}
fn parse_other_<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
if input.len() > pos {
let (ch, next) = char_range_at(input, pos);
match ch {
'\t' | '\n' | '\r' | ' ' | '0' ...'9' | 'A' ...'Z' | 'a' ...'z' =>
state.mark_failure(pos, "[^\t\n\r 0-9A-Za-z]"),
_ => Matched(next, ()),
}
} else { state.mark_failure(pos, "[^\t\n\r 0-9A-Za-z]") }
}
fn parse_definitions<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res =
{
let seq_res =
parse_extended_attribute_list(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_definition(input, state,
pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state,
pos);
match seq_res {
Matched(pos, _) => {
parse_definitions(input,
state,
pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
fn parse_definition<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res = parse_callback_or_interface(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res = parse_partial(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res = parse_dictionary(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
parse_enum(input, state, pos);
match choice_res {
Matched(pos, value) =>
Matched(pos, value),
Failed => {
let choice_res =
parse_typedef(input, state, pos);
match choice_res {
Matched(pos, value) =>
Matched(pos, value),
Failed =>
parse_implements_statement(input,
state,
pos),
}
}
}
}
}
}
}
}
}
}
}
fn parse_callback_or_interface<'input>(input: &'input str,
state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let choice_res =
{
let seq_res = slice_eq(input, state, pos, "callback");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_callback_rest_or_interface(input,
state,
pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => parse_interface(input, state, pos),
}
}
}
fn parse_callback_rest_or_interface<'input>(input: &'input str,
state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res = parse_callback_rest(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => parse_interface(input, state, pos),
}
}
}
fn parse_interface<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let seq_res = slice_eq(input, state, pos, "interface");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_identifier(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_inheritance(input,
state,
pos);
match seq_res {
Matched(pos, _) =>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=> {
{
let seq_res =
slice_eq(input,
state,
pos,
"{");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_interface_members(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
slice_eq(input,
state,
pos,
"}");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
slice_eq(input,
state,
pos,
";")
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_partial<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let seq_res = slice_eq(input, state, pos, "partial");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_partial_definition(input, state, pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_partial_definition<'input>(input: &'input str,
state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let choice_res = parse_partial_interface(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => parse_partial_dictionary(input, state, pos),
}
}
}
fn parse_partial_interface<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let seq_res = slice_eq(input, state, pos, "interface");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_identifier(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
slice_eq(input,
state,
pos,
"{");
match seq_res {
Matched(pos, _) =>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=> {
{
let seq_res =
parse_interface_members(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
slice_eq(input,
state,
pos,
"}");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
slice_eq(input,
state,
pos,
";")
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_interface_members<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res =
{
let seq_res =
parse_extended_attribute_list(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_interface_member(input,
state,
pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state,
pos);
match seq_res {
Matched(pos, _) => {
parse_interface_members(input,
state,
pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
fn parse_interface_member<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res = parse_const(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res = parse_operation(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res = parse_serializer(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
parse_stringifier(input, state, pos);
match choice_res {
Matched(pos, value) =>
Matched(pos, value),
Failed => {
let choice_res =
parse_static_member(input, state,
pos);
match choice_res {
Matched(pos, value) =>
Matched(pos, value),
Failed => {
let choice_res =
parse_iterable(input,
state,
pos);
match choice_res {
Matched(pos, value) =>
Matched(pos, value),
Failed => {
let choice_res =
parse_readonly_member(input,
state,
pos);
match choice_res {
Matched(pos,
value) =>
Matched(pos,
value),
Failed => {
let choice_res =
parse_read_write_attribute(input,
state,
pos);
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed =>
{
let choice_res =
parse_read_write_maplike(input,
state,
pos);
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
parse_read_write_setlike(input,
state,
pos),
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
fn parse_dictionary<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let seq_res = slice_eq(input, state, pos, "dictionary");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_identifier(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_inheritance(input,
state,
pos);
match seq_res {
Matched(pos, _) =>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=> {
{
let seq_res =
slice_eq(input,
state,
pos,
"{");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_dictionary_members(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
slice_eq(input,
state,
pos,
"}");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
slice_eq(input,
state,
pos,
";")
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_dictionary_members<'input>(input: &'input str,
state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let choice_res =
{
let seq_res =
parse_extended_attribute_list(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_dictionary_member(input,
state,
pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state,
pos);
match seq_res {
Matched(pos, _) => {
parse_dictionary_members(input,
state,
pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
fn parse_dictionary_member<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let seq_res = parse_required(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_type(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_identifier(input,
state,
pos);
match seq_res {
Matched(pos, _) =>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=> {
{
let seq_res =
parse_default(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
slice_eq(input,
state,
pos,
";")
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_required<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res = slice_eq(input, state, pos, "required");
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
fn parse_partial_dictionary<'input>(input: &'input str,
state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let seq_res = slice_eq(input, state, pos, "dictionary");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_identifier(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
slice_eq(input,
state,
pos,
"{");
match seq_res {
Matched(pos, _) =>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=> {
{
let seq_res =
parse_dictionary_members(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
slice_eq(input,
state,
pos,
"}");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
slice_eq(input,
state,
pos,
";")
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_default<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res =
{
let seq_res = slice_eq(input, state, pos, "=");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_default_value(input, state, pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
fn parse_default_value<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res = parse_const_value(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res = parse_string(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let seq_res = slice_eq(input, state, pos, "[");
match seq_res {
Matched(pos, _) => {
slice_eq(input, state, pos, "]")
}
Failed => Failed,
}
}
}
}
}
}
}
fn parse_inheritance<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res =
{
let seq_res = slice_eq(input, state, pos, ":");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_identifier(input, state, pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
fn parse_enum<'input>(input: &'input str, state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let seq_res = slice_eq(input, state, pos, "enum");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_identifier(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
slice_eq(input,
state,
pos,
"{");
match seq_res {
Matched(pos, _) =>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=> {
{
let seq_res =
parse_enum_value_list(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
slice_eq(input,
state,
pos,
"}");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
slice_eq(input,
state,
pos,
";")
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_enum_value_list<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let seq_res = parse_string(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_enum_value_list_comma(input, state, pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_enum_value_list_comma<'input>(input: &'input str,
state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let choice_res =
{
let seq_res = slice_eq(input, state, pos, ",");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_enum_value_list_string(input, state,
pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
fn parse_enum_value_list_string<'input>(input: &'input str,
state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let choice_res =
{
let seq_res = parse_string(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_enum_value_list_comma(input, state,
pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
fn parse_callback_rest<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let seq_res = parse_identifier(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
slice_eq(input, state, pos, "=");
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_return_type(input,
state,
pos);
match seq_res {
Matched(pos, _) =>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=> {
{
let seq_res =
slice_eq(input,
state,
pos,
"(");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_argument_list(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
slice_eq(input,
state,
pos,
")");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
slice_eq(input,
state,
pos,
";")
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_typedef<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let seq_res = slice_eq(input, state, pos, "typedef");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_type(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_identifier(input,
state,
pos);
match seq_res {
Matched(pos, _) =>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=> {
slice_eq(input,
state,
pos,
";")
}
Failed
=>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_implements_statement<'input>(input: &'input str,
state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let seq_res = parse_identifier(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
slice_eq(input, state, pos, "implements");
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_identifier(input,
state,
pos);
match seq_res {
Matched(pos, _) =>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=> {
slice_eq(input,
state,
pos,
";")
}
Failed
=>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_const<'input>(input: &'input str, state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let seq_res = slice_eq(input, state, pos, "const");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_const_type(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_identifier(input,
state,
pos);
match seq_res {
Matched(pos, _) =>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=> {
{
let seq_res =
slice_eq(input,
state,
pos,
"=");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_const_value(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
slice_eq(input,
state,
pos,
";")
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_const_value<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res = parse_boolean_literal(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res = parse_float_literal(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res = parse_integer(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, "null"),
}
}
}
}
}
}
}
fn parse_boolean_literal<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res = slice_eq(input, state, pos, "true");
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, "false"),
}
}
}
fn parse_float_literal<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res = parse_float(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res = slice_eq(input, state, pos, "-Infinity");
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
slice_eq(input, state, pos, "Infinity");
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, "NaN"),
}
}
}
}
}
}
}
fn parse_serializer<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let seq_res = slice_eq(input, state, pos, "serializer");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_serializer_rest(input, state, pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_serializer_rest<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res = parse_operation_rest(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
{
let seq_res = slice_eq(input, state, pos, "=");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_serialization_pattern(input,
state,
pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
}
}
fn parse_serialization_pattern<'input>(input: &'input str,
state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let choice_res =
{
let seq_res = slice_eq(input, state, pos, "{");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_serialization_pattern_map(input,
state,
pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state,
pos);
match seq_res {
Matched(pos, _) => {
slice_eq(input,
state,
pos, "}")
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
{
let seq_res = slice_eq(input, state, pos, "[");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_serialization_pattern_list(input,
state,
pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res {
Matched(pos,
_) =>
{
slice_eq(input,
state,
pos,
"]")
}
Failed =>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => parse_identifier(input, state, pos),
}
}
}
}
}
fn parse_serialization_pattern_map<'input>(input: &'input str,
state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let choice_res = slice_eq(input, state, pos, "getter");
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
{
let seq_res = slice_eq(input, state, pos, "inherit");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_identifiers(input, state,
pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
{
let seq_res =
parse_identifier(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_identifiers(input,
state,
pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
}
}
}
}
fn parse_serialization_pattern_list<'input>(input: &'input str,
state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res = slice_eq(input, state, pos, "getter");
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
{
let seq_res = parse_identifier(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_identifiers(input, state,
pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
}
}
fn parse_stringifier<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let seq_res = slice_eq(input, state, pos, "stringifier");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_stringifier_rest(input, state, pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_stringifier_rest<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res =
{
let seq_res = parse_readonly(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_attribute_rest(input, state, pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
{
let seq_res = parse_return_type(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_operation_rest(input, state,
pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ";"),
}
}
}
}
}
fn parse_static_member<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let seq_res = slice_eq(input, state, pos, "static");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_static_member_rest(input, state, pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_static_member_rest<'input>(input: &'input str,
state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let choice_res =
{
let seq_res = parse_readonly(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_attribute_rest(input, state, pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let seq_res = parse_return_type(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_operation_rest(input, state, pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
}
}
fn parse_readonly_member<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let seq_res = slice_eq(input, state, pos, "readonly");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_readonly_member_rest(input, state, pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_readonly_member_rest<'input>(input: &'input str,
state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let choice_res = parse_attribute_rest(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res = parse_read_write_maplike(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => parse_read_write_setlike(input, state, pos),
}
}
}
}
}
fn parse_read_write_attribute<'input>(input: &'input str,
state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let choice_res =
{
let seq_res = slice_eq(input, state, pos, "inherit");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_readonly(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state,
pos);
match seq_res {
Matched(pos, _) => {
parse_attribute_rest(input,
state,
pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => parse_attribute_rest(input, state, pos),
}
}
}
fn parse_attribute_rest<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let seq_res = slice_eq(input, state, pos, "attribute");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_type(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_attribute_name(input,
state,
pos);
match seq_res {
Matched(pos, _) =>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=> {
slice_eq(input,
state,
pos,
";")
}
Failed
=>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_attribute_name<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res = parse_attribute_name_keyword(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => parse_identifier(input, state, pos),
}
}
}
fn parse_attribute_name_keyword<'input>(input: &'input str,
state: &mut ParseState, pos: usize)
-> RuleResult<()> {
slice_eq(input, state, pos, "required")
}
fn parse_inherit<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res = slice_eq(input, state, pos, "inherit");
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
fn parse_readonly<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res = slice_eq(input, state, pos, "readonly");
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
fn parse_operation<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res =
{
let seq_res = parse_return_type(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_operation_rest(input, state, pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => parse_special_operation(input, state, pos),
}
}
}
fn parse_special_operation<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let seq_res = parse_special(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_specials(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_return_type(input,
state,
pos);
match seq_res {
Matched(pos, _) =>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=> {
parse_operation_rest(input,
state,
pos)
}
Failed
=>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_specials<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res =
{
let seq_res = parse_special(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_specials(input, state, pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
fn parse_special<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res = slice_eq(input, state, pos, "getter");
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res = slice_eq(input, state, pos, "setter");
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
slice_eq(input, state, pos, "deleter");
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed =>
slice_eq(input, state, pos, "legacycaller"),
}
}
}
}
}
}
}
fn parse_operation_rest<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let seq_res = parse_optional_identifier(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
slice_eq(input, state, pos, "(");
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_argument_list(input,
state,
pos);
match seq_res {
Matched(pos, _) =>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=> {
{
let seq_res =
slice_eq(input,
state,
pos,
")");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
slice_eq(input,
state,
pos,
";")
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_optional_identifier<'input>(input: &'input str,
state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let choice_res = parse_identifier(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
fn parse_argument_list<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res =
{
let seq_res = parse_argument(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_arguments(input, state, pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
fn parse_arguments<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res =
{
let seq_res = slice_eq(input, state, pos, ",");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_argument(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state,
pos);
match seq_res {
Matched(pos, _) => {
parse_arguments(input,
state,
pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
fn parse_argument<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let seq_res = parse_extended_attribute_list(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_optional_or_required_argument(input, state,
pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_optional_or_required_argument<'input>(input: &'input str,
state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res =
{
let seq_res = slice_eq(input, state, pos, "optional");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_type(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state,
pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_argument_name(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=> {
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
parse_default(input,
state,
pos)
}
Failed
=>
Failed,
}
}
}
Failed =>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let seq_res = parse_type(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ellipsis(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state,
pos);
match seq_res {
Matched(pos, _) => {
parse_argument_name(input,
state,
pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
}
}
fn parse_argument_name<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res = parse_argument_name_keyword(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => parse_identifier(input, state, pos),
}
}
}
fn parse_ellipsis<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res = slice_eq(input, state, pos, "...");
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
fn parse_iterable<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res =
{
let seq_res = slice_eq(input, state, pos, "iterable");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
slice_eq(input, state, pos, "<");
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state,
pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_type(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=> {
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_optional_type(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
slice_eq(input,
state,
pos,
">");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
slice_eq(input,
state,
pos,
";")
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed =>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let seq_res = slice_eq(input, state, pos, "legacyiterable");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
slice_eq(input, state, pos, "<");
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state,
pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_type(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=> {
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
slice_eq(input,
state,
pos,
">");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
slice_eq(input,
state,
pos,
";")
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed =>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
}
}
fn parse_optional_type<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res =
{
let seq_res = slice_eq(input, state, pos, ",");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_type(input, state, pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
fn parse_read_write_maplike<'input>(input: &'input str,
state: &mut ParseState, pos: usize)
-> RuleResult<()> {
parse_maplike_rest(input, state, pos)
}
fn parse_read_write_setlike<'input>(input: &'input str,
state: &mut ParseState, pos: usize)
-> RuleResult<()> {
parse_setlike_rest(input, state, pos)
}
fn parse_maplike_rest<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let seq_res = slice_eq(input, state, pos, "maplike");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
slice_eq(input, state, pos, "<");
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_type(input,
state,
pos);
match seq_res {
Matched(pos, _) =>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=> {
{
let seq_res =
slice_eq(input,
state,
pos,
",");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_type(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
slice_eq(input,
state,
pos,
">");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
slice_eq(input,
state,
pos,
";")
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_setlike_rest<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let seq_res = slice_eq(input, state, pos, "setlike");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
slice_eq(input, state, pos, "<");
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_type(input,
state,
pos);
match seq_res {
Matched(pos, _) =>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=> {
{
let seq_res =
slice_eq(input,
state,
pos,
">");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
slice_eq(input,
state,
pos,
";")
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_extended_attribute_list<'input>(input: &'input str,
state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let choice_res =
{
let seq_res = slice_eq(input, state, pos, "[");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_extended_attribute(input,
state,
pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state,
pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_extended_attributes(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=> {
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
slice_eq(input,
state,
pos,
"]")
}
Failed
=>
Failed,
}
}
}
Failed =>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
fn parse_extended_attributes<'input>(input: &'input str,
state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let choice_res =
{
let seq_res = slice_eq(input, state, pos, ",");
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_extended_attribute(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_extended_attributes(input, state,
pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
fn parse_extended_attribute<'input>(input: &'input str,
state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let choice_res =
{
let seq_res = slice_eq(input, state, pos, "(");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_extended_attribute_inner(input,
state,
pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state,
pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
slice_eq(input,
state,
pos,
")");
match seq_res
{
Matched(pos,
_)
=> {
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
parse_extended_attribute_rest(input,
state,
pos)
}
Failed
=>
Failed,
}
}
}
Failed =>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
{
let seq_res = slice_eq(input, state, pos, "[");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_extended_attribute_inner(input,
state,
pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res {
Matched(pos,
_) =>
{
{
let seq_res =
slice_eq(input,
state,
pos,
"]");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
parse_extended_attribute_rest(input,
state,
pos)
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed =>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
{
let seq_res =
slice_eq(input, state, pos, "{");
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_extended_attribute_inner(input,
state,
pos);
match seq_res {
Matched(pos, _) =>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=> {
{
let seq_res =
slice_eq(input,
state,
pos,
"}");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
parse_extended_attribute_rest(input,
state,
pos)
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let seq_res = parse_other(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_extended_attribute_rest(input,
state,
pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
}
}
}
}
}
}
fn parse_extended_attribute_rest<'input>(input: &'input str,
state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let choice_res = parse_extended_attribute(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
fn parse_extended_attribute_inner<'input>(input: &'input str,
state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let choice_res =
{
let seq_res = slice_eq(input, state, pos, "(");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_extended_attribute_inner(input,
state,
pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state,
pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
slice_eq(input,
state,
pos,
")");
match seq_res
{
Matched(pos,
_)
=> {
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
parse_extended_attribute_inner(input,
state,
pos)
}
Failed
=>
Failed,
}
}
}
Failed =>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
{
let seq_res = slice_eq(input, state, pos, "[");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_extended_attribute_inner(input,
state,
pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res {
Matched(pos,
_) =>
{
{
let seq_res =
slice_eq(input,
state,
pos,
"]");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
parse_extended_attribute_inner(input,
state,
pos)
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed =>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
{
let seq_res =
slice_eq(input, state, pos, "{");
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_extended_attribute_inner(input,
state,
pos);
match seq_res {
Matched(pos, _) =>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=> {
{
let seq_res =
slice_eq(input,
state,
pos,
"}");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
parse_extended_attribute_inner(input,
state,
pos)
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
{
let seq_res =
parse_other_or_comma(input, state,
pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state,
pos);
match seq_res {
Matched(pos, _) => {
parse_extended_attribute_inner(input,
state,
pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) =>
Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
}
}
}
}
}
}
fn parse_other<'input>(input: &'input str, state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let choice_res = parse_integer(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res = parse_float(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res = parse_identifier(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
parse_string(input, state, pos);
match choice_res {
Matched(pos, value) =>
Matched(pos, value),
Failed => {
let choice_res =
parse_other_(input, state, pos);
match choice_res {
Matched(pos, value) =>
Matched(pos, value),
Failed => {
let choice_res =
slice_eq(input, state,
pos, "-");
match choice_res {
Matched(pos, value) =>
Matched(pos, value),
Failed => {
let choice_res =
slice_eq(input,
state,
pos,
"-Infinity");
match choice_res {
Matched(pos,
value) =>
Matched(pos,
value),
Failed => {
let choice_res =
slice_eq(input,
state,
pos,
".");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed =>
{
let choice_res =
slice_eq(input,
state,
pos,
"...");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
":");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
";");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"<");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"=");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
">");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"?");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"ByteString");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"Date");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"DOMString");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"Infinity");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"NaN");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"RegExp");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"USVString");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"any");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"boolean");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"byte");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"double");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"false");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"float");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"long");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"null");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"object");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"octet");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"or");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"optional");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"sequence");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"short");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"true");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"unsigned");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"void");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
parse_argument_name_keyword(input,
state,
pos);
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
parse_buffer_related_type(input,
state,
pos),
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
fn parse_argument_name_keyword<'input>(input: &'input str,
state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let choice_res = slice_eq(input, state, pos, "attribute");
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res = slice_eq(input, state, pos, "callback");
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res = slice_eq(input, state, pos, "const");
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
slice_eq(input, state, pos, "deleter");
match choice_res {
Matched(pos, value) =>
Matched(pos, value),
Failed => {
let choice_res =
slice_eq(input, state, pos,
"dictionary");
match choice_res {
Matched(pos, value) =>
Matched(pos, value),
Failed => {
let choice_res =
slice_eq(input, state,
pos, "enum");
match choice_res {
Matched(pos, value) =>
Matched(pos, value),
Failed => {
let choice_res =
slice_eq(input,
state,
pos,
"getter");
match choice_res {
Matched(pos,
value) =>
Matched(pos,
value),
Failed => {
let choice_res =
slice_eq(input,
state,
pos,
"implements");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed =>
{
let choice_res =
slice_eq(input,
state,
pos,
"inherit");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"interface");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"iterable");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"legacycaller");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"legacyiterable");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"maplike");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"partial");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"required");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"serializer");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"setlike");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"setter");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"static");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"stringifier");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"typedef");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
slice_eq(input,
state,
pos,
"unrestricted"),
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
fn parse_other_or_comma<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res = parse_other(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ","),
}
}
}
fn parse_type<'input>(input: &'input str, state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let choice_res = parse_single_type(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let seq_res = parse_union_type(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_type_suffix(input, state, pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
}
}
fn parse_single_type<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res = parse_non_any_type(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let seq_res = slice_eq(input, state, pos, "any");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_type_suffix_starting_with_array(input,
state,
pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
}
}
fn parse_union_type<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let seq_res = slice_eq(input, state, pos, "(");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_union_member_type(input, state,
pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
slice_eq(input,
state,
pos,
"or");
match seq_res {
Matched(pos, _) =>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=> {
{
let seq_res =
parse_union_member_type(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_union_member_types(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
slice_eq(input,
state,
pos,
")")
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_union_member_type<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res = parse_non_any_type(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
{
let seq_res = parse_union_type(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_type_suffix(input, state,
pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let seq_res = slice_eq(input, state, pos, "any");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
slice_eq(input, state,
pos, "[");
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res {
Matched(pos,
_) =>
{
{
let seq_res =
slice_eq(input,
state,
pos,
"]");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
parse_type_suffix(input,
state,
pos)
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed =>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
}
}
}
}
fn parse_union_member_types<'input>(input: &'input str,
state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let choice_res =
{
let seq_res = slice_eq(input, state, pos, "or");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_union_member_type(input,
state,
pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state,
pos);
match seq_res {
Matched(pos, _) => {
parse_union_member_types(input,
state,
pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
fn parse_non_any_type<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res =
{
let seq_res = parse_primitive_type(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_type_suffix(input, state, pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
{
let seq_res = parse_promise_type(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_null(input, state, pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
{
let seq_res =
slice_eq(input, state, pos, "ByteString");
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_type_suffix(input,
state,
pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
{
let seq_res =
slice_eq(input, state, pos,
"DOMString");
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state,
pos);
match seq_res {
Matched(pos, _) => {
parse_type_suffix(input,
state,
pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) =>
Matched(pos, value),
Failed => {
let choice_res =
{
let seq_res =
slice_eq(input, state,
pos,
"USVString");
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res {
Matched(pos,
_) =>
{
parse_type_suffix(input,
state,
pos)
}
Failed =>
Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) =>
Matched(pos, value),
Failed => {
let choice_res =
{
let seq_res =
parse_identifier(input,
state,
pos);
match seq_res {
Matched(pos, _) =>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=> {
parse_type_suffix(input,
state,
pos)
}
Failed
=>
Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) =>
Matched(pos, value),
Failed => {
let choice_res =
{
let seq_res =
slice_eq(input,
state,
pos,
"sequence");
match seq_res
{
Matched(pos,
_)
=> {
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
slice_eq(input,
state,
pos,
"<");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_type(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
slice_eq(input,
state,
pos,
">");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
parse_null(input,
state,
pos)
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed =>
Failed,
}
};
match choice_res {
Matched(pos,
value) =>
Matched(pos,
value),
Failed => {
let choice_res =
{
let seq_res =
slice_eq(input,
state,
pos,
"object");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
parse_type_suffix(input,
state,
pos)
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
};
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed =>
{
let choice_res =
{
let seq_res =
slice_eq(input,
state,
pos,
"Date");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
parse_type_suffix(input,
state,
pos)
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
};
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
{
let seq_res =
slice_eq(input,
state,
pos,
"RegExp");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
parse_type_suffix(input,
state,
pos)
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
};
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
{
let seq_res =
slice_eq(input,
state,
pos,
"Error");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
parse_type_suffix(input,
state,
pos)
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
};
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
{
let seq_res =
slice_eq(input,
state,
pos,
"DOMException");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
parse_type_suffix(input,
state,
pos)
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
};
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let seq_res =
parse_buffer_related_type(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
parse_type_suffix(input,
state,
pos)
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
fn parse_buffer_related_type<'input>(input: &'input str,
state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let choice_res = slice_eq(input, state, pos, "ArrayBuffer");
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res = slice_eq(input, state, pos, "DataView");
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
slice_eq(input, state, pos, "Int8Array");
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
slice_eq(input, state, pos, "Int16Array");
match choice_res {
Matched(pos, value) =>
Matched(pos, value),
Failed => {
let choice_res =
slice_eq(input, state, pos,
"Int32Array");
match choice_res {
Matched(pos, value) =>
Matched(pos, value),
Failed => {
let choice_res =
slice_eq(input, state,
pos,
"Uint8Array");
match choice_res {
Matched(pos, value) =>
Matched(pos, value),
Failed => {
let choice_res =
slice_eq(input,
state,
pos,
"Uint16Array");
match choice_res {
Matched(pos,
value) =>
Matched(pos,
value),
Failed => {
let choice_res =
slice_eq(input,
state,
pos,
"Uint32Array");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed =>
{
let choice_res =
slice_eq(input,
state,
pos,
"Uint8ClampedArray");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
{
let choice_res =
slice_eq(input,
state,
pos,
"Float32Array");
match choice_res
{
Matched(pos,
value)
=>
Matched(pos,
value),
Failed
=>
slice_eq(input,
state,
pos,
"Float64Array"),
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
fn parse_const_type<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res =
{
let seq_res = parse_primitive_type(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_null(input, state, pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let seq_res = parse_identifier(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_null(input, state, pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
}
}
fn parse_primitive_type<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res = parse_unsigned_integer_type(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
parse_unrestricted_float_type(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
slice_eq(input, state, pos, "boolean");
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
slice_eq(input, state, pos, "byte");
match choice_res {
Matched(pos, value) =>
Matched(pos, value),
Failed =>
slice_eq(input, state, pos, "octet"),
}
}
}
}
}
}
}
}
}
fn parse_unrestricted_float_type<'input>(input: &'input str,
state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let choice_res =
{
let seq_res = slice_eq(input, state, pos, "unrestricted");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_float_type(input, state, pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => parse_float_type(input, state, pos),
}
}
}
fn parse_float_type<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res = slice_eq(input, state, pos, "float");
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, "double"),
}
}
}
fn parse_unsigned_integer_type<'input>(input: &'input str,
state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let choice_res =
{
let seq_res = slice_eq(input, state, pos, "unsigned");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_integer_type(input, state, pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => parse_integer_type(input, state, pos),
}
}
}
fn parse_integer_type<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res = slice_eq(input, state, pos, "short");
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let seq_res = slice_eq(input, state, pos, "long");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_optional_long(input, state, pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
}
}
fn parse_optional_long<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res = slice_eq(input, state, pos, "long");
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
fn parse_promise_type<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let seq_res = slice_eq(input, state, pos, "Promise");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
slice_eq(input, state, pos, "<");
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_return_type(input,
state,
pos);
match seq_res {
Matched(pos, _) =>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=> {
slice_eq(input,
state,
pos,
">")
}
Failed
=>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_type_suffix<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res =
{
let seq_res = slice_eq(input, state, pos, "[");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
slice_eq(input, state, pos, "]");
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state,
pos);
match seq_res {
Matched(pos, _) => {
parse_type_suffix(input,
state,
pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => {
let choice_res =
{
let seq_res = slice_eq(input, state, pos, "?");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_type_suffix_starting_with_array(input,
state,
pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
}
}
fn parse_type_suffix_starting_with_array<'input>(input: &'input str,
state: &mut ParseState,
pos: usize)
-> RuleResult<()> {
{
let choice_res =
{
let seq_res = slice_eq(input, state, pos, "[");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
slice_eq(input, state, pos, "]");
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state,
pos);
match seq_res {
Matched(pos, _) => {
parse_type_suffix(input,
state,
pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
fn parse_null<'input>(input: &'input str, state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let choice_res = slice_eq(input, state, pos, "?");
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
fn parse_return_type<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res = parse_type(input, state, pos);
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, "void"),
}
}
}
fn parse_identifier_list<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let seq_res = parse_identifier(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_identifiers(input, state, pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_identifiers<'input>(input: &'input str, state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let choice_res =
{
let seq_res = slice_eq(input, state, pos, ",");
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_identifier(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_identifiers(input,
state, pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
};
match choice_res {
Matched(pos, value) => Matched(pos, value),
Failed => slice_eq(input, state, pos, ""),
}
}
}
fn parse_extended_attribute_no_args<'input>(input: &'input str,
state: &mut ParseState,
pos: usize) -> RuleResult<()> {
parse_identifier(input, state, pos)
}
fn parse_extended_attribute_arg_list<'input>(input: &'input str,
state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let seq_res = parse_identifier(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
slice_eq(input, state, pos, "(");
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_argument_list(input,
state,
pos);
match seq_res {
Matched(pos, _) =>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=> {
slice_eq(input,
state,
pos,
")")
}
Failed
=>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_extended_attribute_ident<'input>(input: &'input str,
state: &mut ParseState, pos: usize)
-> RuleResult<()> {
{
let seq_res = parse_identifier(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
slice_eq(input, state, pos, "=");
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
parse_identifier(input,
state,
pos)
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_extended_attribute_ident_list<'input>(input: &'input str,
state: &mut ParseState,
pos: usize) -> RuleResult<()> {
{
let seq_res = parse_identifier(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
slice_eq(input, state, pos, "=");
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
slice_eq(input,
state,
pos,
"(");
match seq_res {
Matched(pos, _) =>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=> {
{
let seq_res =
parse_identifier_list(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
slice_eq(input,
state,
pos,
")")
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
fn parse_extended_attribute_named_arg_list<'input>(input: &'input str,
state: &mut ParseState,
pos: usize)
-> RuleResult<()> {
{
let seq_res = parse_identifier(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res = parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
slice_eq(input, state, pos, "=");
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_ws(input, state, pos);
match seq_res {
Matched(pos, _) => {
{
let seq_res =
parse_identifier(input,
state,
pos);
match seq_res {
Matched(pos, _) =>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=> {
{
let seq_res =
slice_eq(input,
state,
pos,
"(");
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_argument_list(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
{
let seq_res =
parse_ws(input,
state,
pos);
match seq_res
{
Matched(pos,
_)
=>
{
slice_eq(input,
state,
pos,
")")
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed
=>
Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
Failed => Failed,
}
}
}
pub fn definitions<'input>(input: &'input str) -> ParseResult<()> {
let mut state = ParseState::new();
match parse_definitions(input, &mut state, 0) {
Matched(pos, value) => { if pos == input.len() { return Ok(value) } }
_ => { }
}
let (line, col) = pos_to_line(input, state.max_err_pos);
Err(ParseError{line: line,
column: col,
offset: state.max_err_pos,
expected: state.expected,})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment