vue-sfc 0.1.0

A parser for Vue SFC.
Documentation
vue-sfc-0.1.0 has been yanked.

vue-sfc

vue-sfc provides a parser and data structures needed to represent a Vue SFC.

Design

A Vue SFC is represented as a [Vec<Section>], a [Section] can either be:

  • a [Block], e.g:
<template>
<!-- content -->
</template>
<script lang="ts" setup>
/* --snip-- */
</script>
  • or something else, stored as a [Section::Raw].

Parsing

See [parse].

Printing

[Block] and [Section] implement [std::fmt::Display]. Note that, when printing, [Section::Raw] are end-trimmed.