Skip to content

TODO: combine tag_action of start state into initializations of tag variables #40

Description

@hackwaly

NOTE: We should prove that there's no other states can reach start state.

fn interp_handle(lexbuf : Lexbuf, env~ : LexEnv) -> Int  {
  // The matched pattern id
  let mut matched = @int.max_value
  let mut _end_pos = -1
  let mut _start_pos = lexbuf.curr_pos()
  let mut _capture_0_start = -1
  let mut _capture_0_end = -1
  let mut _capture_1_start = -1
  let mut _capture_1_end = -1
  let mut _tag_0 = -1
  let mut _tag_1 = -1
  let mut _tag_2 = -1
  let mut _tag_3 = -1
  let mut _tag_4 = -1
  let mut _tag_5 = -1
  let mut _tag_6 = -1
  let mut _tag_7 = -1
  let mut _tag_8 = -1
  let mut _tag_9 = -1
  let mut _tag_10 = -1
  let mut _tag_11 = -1
  loop 0 {
    0 => {
      _tag_0 = lexbuf.curr_pos()
      _tag_2 = lexbuf.curr_pos()
      _tag_4 = lexbuf.curr_pos()
      _tag_6 = lexbuf.curr_pos()
      _tag_8 = lexbuf.curr_pos()
      _tag_10 = lexbuf.curr_pos()
      continue match lexbuf.next_as_int() {
...

===>

fn interp_handle(lexbuf : Lexbuf, env~ : LexEnv) -> Int  {
  // The matched pattern id
  let mut matched = @int.max_value
  let mut _end_pos = -1
  let mut _start_pos = lexbuf.curr_pos()
  let mut _capture_0_start = -1
  let mut _capture_0_end = -1
  let mut _capture_1_start = -1
  let mut _capture_1_end = -1
  let mut _tag_0 = _start_pos
  let mut _tag_1 = -1
  let mut _tag_2 = _start_pos
  let mut _tag_3 = -1
  let mut _tag_4 = _start_pos
  let mut _tag_5 = -1
  let mut _tag_6 = _start_pos
  let mut _tag_7 = -1
  let mut _tag_8 = _start_pos
  let mut _tag_9 = -1
  let mut _tag_10 = _start_pos
  let mut _tag_11 = -1
  loop 0 {
    0 => {
      continue match lexbuf.next_as_int() {
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions