add more test (#189)
* new test * import bug when with quotation * new test * add test condition * rpc template command use -o param Co-authored-by: kim <xutao@xiaoheiban.cn>
This commit is contained in:
@@ -39,6 +39,8 @@ func NewParser(filename string) (*Parser, error) {
|
||||
if len(ip) > 0 {
|
||||
item := strings.TrimPrefix(item, "import")
|
||||
item = strings.TrimSpace(item)
|
||||
item = strings.TrimPrefix(item, `"`)
|
||||
item = strings.TrimSuffix(item, `"`)
|
||||
var path = item
|
||||
if !util.FileExists(item) {
|
||||
path = filepath.Join(filepath.Dir(apiAbsPath), item)
|
||||
|
||||
@@ -125,7 +125,7 @@ func ParseApi(api string) (*ApiStruct, error) {
|
||||
}
|
||||
|
||||
func isImportBeginLine(line string) bool {
|
||||
return strings.HasPrefix(line, "import") && strings.HasSuffix(line, ".api")
|
||||
return strings.HasPrefix(line, "import") && (strings.HasSuffix(line, ".api") || strings.HasSuffix(line, `.api"`))
|
||||
}
|
||||
|
||||
func isTypeBeginLine(line string) bool {
|
||||
|
||||
Reference in New Issue
Block a user