wxml-parser icon indicating copy to clipboard operation
wxml-parser copied to clipboard

[Bug]: cross file parse

Open ryouaki opened this issue 4 years ago • 4 comments

To reproduce:

// file1.wxml
<template>
  <import src="./file1.wxml"/>
  <block wx:if="{{ thing }}">
    <import src="./file2.wxml"/>
 </block>
</template>

Current behavior: I can not get the file2 from ast

  • @wxml/parser version: 0.3.0
  • nodejs version: 16.x

I want to get file2 from ast.

ryouaki avatar Jan 14 '22 09:01 ryouaki

Parser only work for single file. Did you mean that you want get file2.wxml ast to inject to current AST tree ? That's impossible.

iChenLei avatar Jan 14 '22 09:01 iChenLei

yes,get file2.wxml ast to inject to current AST tree。Current can include file1 into ast tree。but file2 is not。。。。

So i think it is a bug。just because the tag with "if"。。。。

ryouaki avatar Jan 17 '22 01:01 ryouaki

2022-01-17 12 47 42

iChenLei avatar Jan 17 '22 04:01 iChenLei

Yes this is I want。

ryouaki avatar Jan 21 '22 01:01 ryouaki