public override IAst Parse(Token raw) { var re = new DecStmt(); //dec txt : str = "Hello world" re.Name = raw.Raw.Split(' ')[1]; if(raw.Raw.Split('=')[0].Contains(':')) { re.Type = raw.Raw.Split('=')[0].Split(':').Last().Trim(); } if (raw.Raw.Contains('=')) { re.Value = IAst.ParseToken(raw.Raw.Split('=').Last().Trim())[0]; } return re; }
public override IAst Parse(Token raw) { var re = new DecStmt(); //dec txt : str = "Hello world" re.Name = raw.Raw.Split(' ')[1]; if (raw.Raw.Split('=')[0].Contains(':')) { re.Type = raw.Raw.Split('=')[0].Split(':').Last().Trim(); } if (raw.Raw.Contains('=')) { re.Value = IAst.ParseToken(raw.Raw.Split('=').Last().Trim())[0]; } return(re); }