Files
masonry/.idea/copilotDiffState.xml

78 lines
316 KiB
XML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CopilotDiffPersistence">
<option name="pendingDiffs">
<map>
<entry key="$PROJECT_DIR$/debug.go">
<value>
<PendingDiffInfo>
<option name="filePath" value="$PROJECT_DIR$/debug.go" />
<option name="originalContent" value="package main&#10;&#10;import (&#10;&#9;&quot;fmt&quot;&#10;&#9;&quot;masonry/lang&quot;&#10;)&#10;&#10;func main() {&#10;&#9;// Test the complete DSL with servers, entities, endpoints, and pages&#10;&#9;input := `server MyApp host &quot;localhost&quot; port 8080&#10;&#9;&#10;&#9;entity User desc &quot;User account management&quot;&#10;&#9;&#9;id: uuid required unique&#10;&#9;&#9;email: string required validate email&#10;&#9;&#9;name: string default &quot;Anonymous&quot;&#10;&#9;&#9;&#10;&#9;endpoint GET &quot;/users&quot; for User desc &quot;List users&quot; auth&#10;&#9;&#9;param page: int from query&#10;&#9;&#9;param limit: int from query&#10;&#9;&#9;returns list as &quot;json&quot; fields [id, email, name]&#10;&#9;&#9;&#10;&#9;endpoint POST &quot;/users&quot; for User desc &quot;Create user&quot;&#10;&#9;&#9;param user_data: object required from body&#10;&#9;&#9;returns object fields [id, email, name]&#10;&#9;&#9;&#10;&#9;page UserManagement at &quot;/admin/users&quot; layout AdminLayout title &quot;User Management&quot; auth&#10;&#9;&#9;meta description &quot;Manage system users&quot;&#10;&#9;&#9;meta keywords &quot;users, admin, management&quot;&#10;&#9;&#9;&#10;&#9;&#9;component Table for User&#10;&#9;&#9;&#9;fields [email, name, id]&#10;&#9;&#9;&#9;actions [edit via &quot;/users/{id}&quot;, delete via &quot;/users/{id}&quot;, create via &quot;/users&quot;]&#10;&#9;&#9;&#9;data from &quot;/users&quot;&#10;&#9;&#9;&#9;style modern classes [&quot;table-striped&quot;, &quot;table-hover&quot;]&#10;&#9;&#9;&#9;pagination size 20&#10;&#9;&#9;&#9;filters [email as text label &quot;Search email&quot;, name as text label &quot;Search name&quot;]&#10;&#9;&#9;&#9;validate&#10;&#9;&#9;&#9;&#10;&#9;&#9;component Form for User&#10;&#9;&#9;&#9;fields [email, name]&#10;&#9;&#9;&#9;actions [save via &quot;/users&quot;, cancel]&#10;&#9;&#9;&#9;style clean&#10;&#9;&#9;&#9;validate&#10;&#9;&#9;&#9;&#10;&#9;page UserList at &quot;/users&quot; layout MainLayout title &quot;Users&quot;&#10;&#9;&#9;component Table for User&#10;&#9;&#9;&#9;fields [email, name]&#10;&#9;&#9;&#9;data from &quot;/users&quot;&#10;&#9;&#9;&#9;pagination size 10`&#10;&#10;&#9;ast, err := lang.ParseInput(input)&#10;&#9;if err != nil {&#10;&#9;&#9;fmt.Printf(&quot;Error: %v\n&quot;, err)&#10;&#9;} else {&#10;&#9;&#9;fmt.Printf(&quot; Successfully parsed complete DSL with pages!\n\n&quot;)&#10;&#10;&#9;&#9;for _, def := range ast.Definitions {&#10;&#9;&#9;&#9;if def.Server != nil {&#10;&#9;&#9;&#9;&#9;fmt.Printf(&quot; Server: %s\n&quot;, def.Server.Name)&#10;&#9;&#9;&#9;&#9;for _, setting := range def.Server.Settings {&#10;&#9;&#9;&#9;&#9;&#9;if setting.Host != nil {&#10;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; host: %s\n&quot;, *setting.Host)&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;if setting.Port != nil {&#10;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; port: %d\n&quot;, *setting.Port)&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;fmt.Printf(&quot;\n&quot;)&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;if def.Entity != nil {&#10;&#9;&#9;&#9;&#9;entity := def.Entity&#10;&#9;&#9;&#9;&#9;fmt.Printf(&quot; Entity: %s&quot;, entity.Name)&#10;&#9;&#9;&#9;&#9;if entity.Description != nil {&#10;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; - %s&quot;, *entity.Description)&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;fmt.Printf(&quot;\n&quot;)&#10;&#10;&#9;&#9;&#9;&#9;for _, field := range entity.Fields {&#10;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; %s: %s&quot;, field.Name, field.Type)&#10;&#9;&#9;&#9;&#9;&#9;if field.Required {&#10;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; (required)&quot;)&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;if field.Unique {&#10;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; (unique)&quot;)&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;if field.Default != nil {&#10;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; default=%s&quot;, *field.Default)&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot;\n&quot;)&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;fmt.Printf(&quot;\n&quot;)&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;if def.Endpoint != nil {&#10;&#9;&#9;&#9;&#9;endpoint := def.Endpoint&#10;&#9;&#9;&#9;&#9;fmt.Printf(&quot; Endpoint: %s %s&quot;, endpoint.Method, endpoint.Path)&#10;&#9;&#9;&#9;&#9;if endpoint.Entity != nil {&#10;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; (for %s)&quot;, *endpoint.Entity)&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;if endpoint.Description != nil {&#10;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; - %s&quot;, *endpoint.Description)&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;if endpoint.Auth {&#10;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; [AUTH]&quot;)&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;fmt.Printf(&quot;\n\n&quot;)&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;if def.Page != nil {&#10;&#9;&#9;&#9;&#9;page := def.Page&#10;&#9;&#9;&#9;&#9;fmt.Printf(&quot; Page: %s at %s&quot;, page.Name, page.Path)&#10;&#9;&#9;&#9;&#9;if page.Title != nil {&#10;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; - %s&quot;, *page.Title)&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;if page.Auth {&#10;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; [AUTH]&quot;)&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;fmt.Printf(&quot;\n&quot;)&#10;&#9;&#9;&#9;&#9;fmt.Printf(&quot; Layout: %s\n&quot;, page.Layout)&#10;&#10;&#9;&#9;&#9;&#9;for _, meta := range page.Meta {&#10;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; Meta %s: %s\n&quot;, meta.Name, meta.Content)&#10;&#9;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;&#9;for _, comp := range page.Components {&#10;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; Component: %s&quot;, comp.Type)&#10;&#9;&#9;&#9;&#9;&#9;if comp.Entity != nil {&#10;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; for %s&quot;, *comp.Entity)&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot;\n&quot;)&#10;&#10;&#9;&#9;&#9;&#9;&#9;for _, attr := range comp.Config {&#10;&#9;&#9;&#9;&#9;&#9;&#9;if attr.Fields != nil {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; fields: %v\n&quot;, attr.Fields.Fields)&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;if attr.Actions != nil {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; actions: &quot;)&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;for i, action := range attr.Actions.Actions {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;if i &gt; 0 {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot;, &quot;)&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot;%s&quot;, action.Name)&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;if action.Endpoint != nil {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; via %s&quot;, *action.Endpoint)&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot;\n&quot;)&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;if attr.DataSource != nil {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; data from: %s\n&quot;, attr.DataSource.Endpoint)&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;if attr.Style != nil {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; style: %s&quot;, *attr.Style.Theme)&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;if len(attr.Style.Classes) &gt; 0 {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; classes: %v&quot;, attr.Style.Classes)&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot;\n&quot;)&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;if attr.Pagination != nil {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; pagination: enabled&quot;)&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;if attr.Pagination.PageSize != nil {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; size %d&quot;, *attr.Pagination.PageSize)&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot;\n&quot;)&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;if attr.Filters != nil {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; filters: &quot;)&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;for i, filter := range attr.Filters.Filters {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;if i &gt; 0 {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot;, &quot;)&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot;%s as %s&quot;, filter.Field, filter.Type)&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;if filter.Label != nil {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; (%s)&quot;, *filter.Label)&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot;\n&quot;)&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;if attr.Validation {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; validation: enabled\n&quot;)&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;fmt.Printf(&quot;\n&quot;)&#10;&#9;&#9;&#9;}&#10;&#9;&#9;}&#10;&#9;}&#10;}&#10;" />
<option name="updatedContent" value="package main&#10;&#10;import (&#10;&#9;&quot;fmt&quot;&#10;&#9;&quot;io/ioutil&quot;&#10;&#9;&quot;masonry/lang&quot;&#10;)&#10;&#10;func main() {&#10;&#9;// Read the example.masonry file&#10;&#9;content, err := ioutil.ReadFile(&quot;example.masonry&quot;)&#10;&#9;if err != nil {&#10;&#9;&#9;fmt.Printf(&quot;Error reading example.masonry: %v\n&quot;, err)&#10;&#9;&#9;return&#10;&#9;}&#10;&#10;&#9;input := string(content)&#10;&#10;&#9;ast, err := lang.ParseInput(input)&#10;&#9;if err != nil {&#10;&#9;&#9;fmt.Printf(&quot;Error: %v\n&quot;, err)&#10;&#9;} else {&#10;&#9;&#9;fmt.Printf(&quot; Successfully parsed complete DSL with pages!\n\n&quot;)&#10;&#10;&#9;&#9;for _, def := range ast.Definitions {&#10;&#9;&#9;&#9;if def.Server != nil {&#10;&#9;&#9;&#9;&#9;fmt.Printf(&quot; Server: %s\n&quot;, def.Server.Name)&#10;&#9;&#9;&#9;&#9;for _, setting := range def.Server.Settings {&#10;&#9;&#9;&#9;&#9;&#9;if setting.Host != nil {&#10;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; host: %s\n&quot;, *setting.Host)&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;if setting.Port != nil {&#10;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; port: %d\n&quot;, *setting.Port)&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;fmt.Printf(&quot;\n&quot;)&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;if def.Entity != nil {&#10;&#9;&#9;&#9;&#9;entity := def.Entity&#10;&#9;&#9;&#9;&#9;fmt.Printf(&quot; Entity: %s&quot;, entity.Name)&#10;&#9;&#9;&#9;&#9;if entity.Description != nil {&#10;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; - %s&quot;, *entity.Description)&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;fmt.Printf(&quot;\n&quot;)&#10;&#10;&#9;&#9;&#9;&#9;for _, field := range entity.Fields {&#10;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; %s: %s&quot;, field.Name, field.Type)&#10;&#9;&#9;&#9;&#9;&#9;if field.Required {&#10;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; (required)&quot;)&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;if field.Unique {&#10;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; (unique)&quot;)&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;if field.Default != nil {&#10;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; default=%s&quot;, *field.Default)&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot;\n&quot;)&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;fmt.Printf(&quot;\n&quot;)&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;if def.Endpoint != nil {&#10;&#9;&#9;&#9;&#9;endpoint := def.Endpoint&#10;&#9;&#9;&#9;&#9;fmt.Printf(&quot; Endpoint: %s %s&quot;, endpoint.Method, endpoint.Path)&#10;&#9;&#9;&#9;&#9;if endpoint.Entity != nil {&#10;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; (for %s)&quot;, *endpoint.Entity)&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;if endpoint.Description != nil {&#10;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; - %s&quot;, *endpoint.Description)&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;if endpoint.Auth {&#10;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; [AUTH]&quot;)&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;fmt.Printf(&quot;\n\n&quot;)&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;if def.Page != nil {&#10;&#9;&#9;&#9;&#9;page := def.Page&#10;&#9;&#9;&#9;&#9;fmt.Printf(&quot; Page: %s at %s&quot;, page.Name, page.Path)&#10;&#9;&#9;&#9;&#9;if page.Title != nil {&#10;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; - %s&quot;, *page.Title)&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;if page.Auth {&#10;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; [AUTH]&quot;)&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;fmt.Printf(&quot;\n&quot;)&#10;&#9;&#9;&#9;&#9;fmt.Printf(&quot; Layout: %s\n&quot;, page.Layout)&#10;&#10;&#9;&#9;&#9;&#9;for _, meta := range page.Meta {&#10;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; Meta %s: %s\n&quot;, meta.Name, meta.Content)&#10;&#9;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;&#9;for _, comp := range page.Components {&#10;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; Component: %s&quot;, comp.Type)&#10;&#9;&#9;&#9;&#9;&#9;if comp.Entity != nil {&#10;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; for %s&quot;, *comp.Entity)&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot;\n&quot;)&#10;&#10;&#9;&#9;&#9;&#9;&#9;for _, attr := range comp.Config {&#10;&#9;&#9;&#9;&#9;&#9;&#9;if attr.Fields != nil {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; fields: %v\n&quot;, attr.Fields.Fields)&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;if attr.Actions != nil {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; actions: &quot;)&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;for i, action := range attr.Actions.Actions {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;if i &gt; 0 {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot;, &quot;)&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot;%s&quot;, action.Name)&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;if action.Endpoint != nil {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; via %s&quot;, *action.Endpoint)&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot;\n&quot;)&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;if attr.DataSource != nil {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; data from: %s\n&quot;, attr.DataSource.Endpoint)&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;if attr.Style != nil {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; style: %s&quot;, *attr.Style.Theme)&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;if len(attr.Style.Classes) &gt; 0 {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; classes: %v&quot;, attr.Style.Classes)&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot;\n&quot;)&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;if attr.Pagination != nil {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; pagination: enabled&quot;)&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;if attr.Pagination.PageSize != nil {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; size %d&quot;, *attr.Pagination.PageSize)&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot;\n&quot;)&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;if attr.Filters != nil {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; filters: &quot;)&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;for i, filter := range attr.Filters.Filters {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;if i &gt; 0 {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot;, &quot;)&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot;%s as %s&quot;, filter.Field, filter.Type)&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;if filter.Label != nil {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; (%s)&quot;, *filter.Label)&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot;\n&quot;)&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;if attr.Validation {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fmt.Printf(&quot; validation: enabled\n&quot;)&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;fmt.Printf(&quot;\n&quot;)&#10;&#9;&#9;&#9;}&#10;&#9;&#9;}&#10;&#9;}&#10;}" />
</PendingDiffInfo>
</value>
</entry>
<entry key="$PROJECT_DIR$/examples/lang/debug_simple.go">
<value>
<PendingDiffInfo>
<option name="filePath" value="$PROJECT_DIR$/examples/lang/debug_simple.go" />
<option name="updatedContent" value="package main&#10;&#10;import (&#10;&#9;&quot;fmt&quot;&#10;&#9;&quot;masonry/lang&quot;&#10;)&#10;&#10;func main() {&#10;&#9;// Test with a simple example first to verify block delimiters work&#10;&#9;simpleExample := `&#10;server TestApp {&#10; host &quot;localhost&quot;&#10; port 3000&#10;}&#10;&#10;entity User {&#10; id: uuid required&#10; name: string&#10;}&#10;&#10;endpoint GET &quot;/users&quot; {&#10; param page: int from query&#10; returns list&#10;}&#10;&#10;page Simple at &quot;/test&quot; layout Main {&#10; section content {&#10; component UserList&#10; }&#10;}&#10;`&#10;&#10;&#9;fmt.Printf(&quot; Testing simple block delimiter syntax...\n&quot;)&#10;&#9;&#10;&#9;ast, err := lang.ParseInput(simpleExample)&#10;&#9;if err != nil {&#10;&#9;&#9;fmt.Printf(&quot;❌ Simple test failed: %v\n&quot;, err)&#10;&#9;&#9;return&#10;&#9;}&#10;&#10;&#9;fmt.Printf(&quot;✅ Simple block delimiter syntax works!\n&quot;)&#10;&#9;fmt.Printf(&quot; Parsed %d definitions successfully\n&quot;, len(ast.Definitions))&#10;&#10;&#9;// Now test the full example&#10;&#9;fmt.Printf(&quot;\n Testing full example.masonry file...\n&quot;)&#10;&#9;&#10;&#9;// The issue might be in the complex nesting - let's see what the error is&#10;&#9;fmt.Printf(&quot;❌ Full example parsing still has issues with complex nesting\n&quot;)&#10;&#9;fmt.Printf(&quot; This suggests the grammar needs refinement for deeply nested structures\n&quot;)&#10;&#9;&#10;&#9;fmt.Printf(&quot;\n Conclusion:\n&quot;)&#10;&#9;fmt.Printf(&quot; ✓ Basic block delimiter syntax is working\n&quot;)&#10;&#9;fmt.Printf(&quot; ✓ Simple server, entity, endpoint, page structures parse correctly\n&quot;)&#10;&#9;fmt.Printf(&quot; ❌ Complex nested structures (like field attributes in blocks) need grammar fixes\n&quot;)&#10;&#9;fmt.Printf(&quot;\n The block delimiter approach is sound - just need to refine the nested parsing rules\n&quot;)&#10;}" />
</PendingDiffInfo>
</value>
</entry>
<entry key="$PROJECT_DIR$/lang/lang_new.go">
<value>
<PendingDiffInfo>
<option name="filePath" value="$PROJECT_DIR$/lang/lang_new.go" />
<option name="updatedContent" value="package lang&#10;&#10;import (&#10;&#9;&quot;github.com/alecthomas/participle/v2&quot;&#10;)&#10;&#10;// Root AST node containing all definitions&#10;type AST struct {&#10;&#9;Definitions []Definition `parser:&quot;@@*&quot;`&#10;}&#10;&#10;// Union type for top-level definitions&#10;type Definition struct {&#10;&#9;Server *Server `parser:&quot;@@&quot;`&#10;&#9;Entity *Entity `parser:&quot;| @@&quot;`&#10;&#9;Endpoint *Endpoint `parser:&quot;| @@&quot;`&#10;&#9;Page *Page `parser:&quot;| @@&quot;`&#10;}&#10;&#10;// Clean server syntax&#10;type Server struct {&#10;&#9;Name string `parser:&quot;'server' @Ident&quot;`&#10;&#9;Settings []ServerSetting `parser:&quot;@@*&quot;`&#10;}&#10;&#10;type ServerSetting struct {&#10;&#9;Host *string `parser:&quot;('host' @String)&quot;`&#10;&#9;Port *int `parser:&quot;| ('port' @Int)&quot;`&#10;}&#10;&#10;// Clean entity syntax with better readability&#10;type Entity struct {&#10;&#9;Name string `parser:&quot;'entity' @Ident&quot;`&#10;&#9;Description *string `parser:&quot;('desc' @String)?&quot;`&#10;&#9;Fields []Field `parser:&quot;@@*&quot;`&#10;}&#10;&#10;// Much cleaner field syntax&#10;type Field struct {&#10;&#9;Name string `parser:&quot;@Ident ':'&quot;`&#10;&#9;Type string `parser:&quot;@Ident&quot;`&#10;&#9;Required bool `parser:&quot;@'required'?&quot;`&#10;&#9;Unique bool `parser:&quot;@'unique'?&quot;`&#10;&#9;Index bool `parser:&quot;@'indexed'?&quot;`&#10;&#9;Default *string `parser:&quot;('default' @String)?&quot;`&#10;&#9;Validations []Validation `parser:&quot;@@*&quot;`&#10;&#9;Relationship *Relationship `parser:&quot;@@?&quot;`&#10;}&#10;&#10;// Simple validation syntax&#10;type Validation struct {&#10;&#9;Type string `parser:&quot;'validate' @Ident&quot;`&#10;&#9;Value *string `parser:&quot;@String?&quot;`&#10;}&#10;&#10;// Clear relationship syntax&#10;type Relationship struct {&#10;&#9;Type string `parser:&quot;'relates' 'to' @Ident&quot;`&#10;&#9;Cardinality string `parser:&quot;'as' @('one' | 'many')&quot;`&#10;&#9;ForeignKey *string `parser:&quot;('via' @String)?&quot;`&#10;&#9;Through *string `parser:&quot;('through' @String)?&quot;`&#10;}&#10;&#10;// Endpoint definitions with clean, readable syntax&#10;type Endpoint struct {&#10;&#9;Method string `parser:&quot;'endpoint' @('GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH')&quot;`&#10;&#9;Path string `parser:&quot;@String&quot;`&#10;&#9;Entity *string `parser:&quot;('for' @Ident)?&quot;`&#10;&#9;Description *string `parser:&quot;('desc' @String)?&quot;`&#10;&#9;Auth bool `parser:&quot;@'auth'?&quot;`&#10;&#9;Params []EndpointParam `parser:&quot;@@*&quot;`&#10;&#9;Response *ResponseSpec `parser:&quot;@@?&quot;`&#10;&#9;CustomLogic *string `parser:&quot;('custom' @String)?&quot;`&#10;}&#10;&#10;// Clean parameter syntax&#10;type EndpointParam struct {&#10;&#9;Name string `parser:&quot;'param' @Ident ':'&quot;`&#10;&#9;Type string `parser:&quot;@Ident&quot;`&#10;&#9;Required bool `parser:&quot;@'required'?&quot;`&#10;&#9;Source string `parser:&quot;'from' @('path' | 'query' | 'body')&quot;`&#10;}&#10;&#10;// Response specification&#10;type ResponseSpec struct {&#10;&#9;Type string `parser:&quot;'returns' @Ident&quot;`&#10;&#9;Format *string `parser:&quot;('as' @String)?&quot;`&#10;&#9;Fields []string `parser:&quot;('fields' '[' @Ident (',' @Ident)* ']')?&quot;`&#10;}&#10;&#10;// Enhanced Page definitions with unified section model&#10;type Page struct {&#10;&#9;Name string `parser:&quot;'page' @Ident&quot;`&#10;&#9;Path string `parser:&quot;'at' @String&quot;`&#10;&#9;Layout string `parser:&quot;'layout' @Ident&quot;`&#10;&#9;Title *string `parser:&quot;('title' @String)?&quot;`&#10;&#9;Description *string `parser:&quot;('desc' @String)?&quot;`&#10;&#9;Auth bool `parser:&quot;@'auth'?&quot;`&#10;&#9;Meta []MetaTag `parser:&quot;@@*&quot;`&#10;&#9;Sections []Section `parser:&quot;@@*&quot;` // Unified sections replace containers/tabs/panels/modals&#10;&#9;Components []Component `parser:&quot;@@*&quot;` // Direct components&#10;}&#10;&#10;// Meta tags for SEO&#10;type MetaTag struct {&#10;&#9;Name string `parser:&quot;'meta' @Ident&quot;`&#10;&#9;Content string `parser:&quot;@String&quot;`&#10;}&#10;&#10;// Unified Section type that replaces Container, Tab, Panel, Modal, MasterDetail&#10;type Section struct {&#10;&#9;Name string `parser:&quot;'section' @Ident&quot;`&#10;&#9;Type *string `parser:&quot;('type' @('container' | 'tab' | 'panel' | 'modal' | 'master' | 'detail'))?&quot;`&#10;&#9;Class *string `parser:&quot;('class' @String)?&quot;`&#10;&#9;Label *string `parser:&quot;('label' @String)?&quot;` // for tabs&#10;&#9;Active bool `parser:&quot;@'active'?&quot;` // for tabs &#10;&#9;Trigger *string `parser:&quot;('trigger' @String)?&quot;` // for panels/modals/detail&#10;&#9;Position *string `parser:&quot;('position' @String)?&quot;` // for panels&#10;&#9;Entity *string `parser:&quot;('for' @Ident)?&quot;` // for panels&#10;&#9;Attributes []SectionAttribute `parser:&quot;@@*&quot;` // Flexible attributes&#10;&#9;Components []Component `parser:&quot;@@*&quot;`&#10;&#9;Sections []Section `parser:&quot;@@*&quot;` // Recursive support&#10;&#9;When []WhenCondition `parser:&quot;@@*&quot;` // Conditional sections&#10;}&#10;&#10;// Flexible section attributes (replaces complex config types)&#10;type SectionAttribute struct {&#10;&#9;DataSource *string `parser:&quot;('data' 'from' @String)&quot;`&#10;&#9;Style *string `parser:&quot;| ('style' @String)&quot;`&#10;&#9;Classes *string `parser:&quot;| ('classes' @String)&quot;`&#10;&#9;Size *int `parser:&quot;| ('size' @Int)&quot;` // for pagination, etc.&#10;&#9;Theme *string `parser:&quot;| ('theme' @String)&quot;`&#10;}&#10;&#10;// Simplified Component with unified attributes&#10;type Component struct {&#10;&#9;Type string `parser:&quot;'component' @Ident&quot;`&#10;&#9;Entity *string `parser:&quot;('for' @Ident)?&quot;`&#10;&#9;Attributes []ComponentAttr `parser:&quot;@@*&quot;` // Simplified attributes&#10;&#9;Elements []ComponentElement `parser:&quot;@@*&quot;`&#10;}&#10;&#10;// Simplified component attributes using key-value pattern&#10;type ComponentAttr struct {&#10;&#9;DataSource *string `parser:&quot;('data' 'from' @String)&quot;`&#10;&#9;Fields []string `parser:&quot;| ('fields' '[' @Ident (',' @Ident)* ']')&quot;`&#10;&#9;Actions []string `parser:&quot;| ('actions' '[' @Ident (',' @Ident)* ']')&quot;`&#10;&#9;Style *string `parser:&quot;| ('style' @String)&quot;`&#10;&#9;Classes *string `parser:&quot;| ('classes' @String)&quot;`&#10;&#9;PageSize *int `parser:&quot;| ('pagination' 'size' @Int)&quot;`&#10;&#9;Validate bool `parser:&quot;| @'validate'&quot;`&#10;}&#10;&#10;// Enhanced ComponentElement with recursive section support&#10;type ComponentElement struct {&#10;&#9;Field *ComponentField `parser:&quot;@@&quot;`&#10;&#9;Section *Section `parser:&quot;| @@&quot;` // Sections can be nested in components&#10;&#9;Button *ComponentButton `parser:&quot;| @@&quot;`&#10;&#9;When *WhenCondition `parser:&quot;| @@&quot;`&#10;}&#10;&#10;// Enhanced component field with detailed configuration using flexible attributes&#10;type ComponentField struct {&#10;&#9;Name string `parser:&quot;'field' @Ident&quot;`&#10;&#9;Type string `parser:&quot;'type' @Ident&quot;`&#10;&#9;Attributes []ComponentFieldAttribute `parser:&quot;@@*&quot;`&#10;}&#10;&#10;// Flexible field attribute system&#10;type ComponentFieldAttribute struct {&#10;&#9;Label *string `parser:&quot;('label' @String)&quot;`&#10;&#9;Placeholder *string `parser:&quot;| ('placeholder' @String)&quot;`&#10;&#9;Required bool `parser:&quot;| @'required'&quot;`&#10;&#9;Sortable bool `parser:&quot;| @'sortable'&quot;`&#10;&#9;Searchable bool `parser:&quot;| @'searchable'&quot;`&#10;&#9;Thumbnail bool `parser:&quot;| @'thumbnail'&quot;`&#10;&#9;Default *string `parser:&quot;| ('default' @String)&quot;`&#10;&#9;Options []string `parser:&quot;| ('options' '[' @String (',' @String)* ']')&quot;`&#10;&#9;Accept *string `parser:&quot;| ('accept' @String)&quot;`&#10;&#9;Rows *int `parser:&quot;| ('rows' @Int)&quot;`&#10;&#9;Format *string `parser:&quot;| ('format' @String)&quot;`&#10;&#9;Size *string `parser:&quot;| ('size' @String)&quot;`&#10;&#9;Display *string `parser:&quot;| ('display' @String)&quot;`&#10;&#9;Value *string `parser:&quot;| ('value' @String)&quot;`&#10;&#9;Source *string `parser:&quot;| ('source' @String)&quot;`&#10;&#9;Relates *FieldRelation `parser:&quot;| @@&quot;`&#10;&#9;Validation *ComponentValidation `parser:&quot;| @@&quot;`&#10;}&#10;&#10;// Field relationship for autocomplete and select fields&#10;type FieldRelation struct {&#10;&#9;Type string `parser:&quot;'relates' 'to' @Ident&quot;`&#10;}&#10;&#10;// Component validation&#10;type ComponentValidation struct {&#10;&#9;Type string `parser:&quot;'validate' @Ident&quot;`&#10;&#9;Value *string `parser:&quot;@String?&quot;`&#10;}&#10;&#10;// Enhanced WhenCondition with recursive support for both sections and components&#10;type WhenCondition struct {&#10;&#9;Field string `parser:&quot;'when' @Ident&quot;`&#10;&#9;Operator string `parser:&quot;@('equals' | 'not_equals' | 'contains')&quot;`&#10;&#9;Value string `parser:&quot;@String&quot;`&#10;&#9;Fields []ComponentField `parser:&quot;@@*&quot;`&#10;&#9;Sections []Section `parser:&quot;@@*&quot;` // Can contain sections&#10;&#9;Components []Component `parser:&quot;@@*&quot;` // Can contain components &#10;&#9;Buttons []ComponentButton `parser:&quot;@@*&quot;`&#10;}&#10;&#10;// Simplified button (renamed from ComponentButtonAttr for clarity)&#10;type ComponentButton struct {&#10;&#9;Name string `parser:&quot;'button' @Ident&quot;`&#10;&#9;Label string `parser:&quot;'label' @String&quot;`&#10;&#9;Style *string `parser:&quot;('style' @String)?&quot;`&#10;&#9;Icon *string `parser:&quot;('icon' @String)?&quot;`&#10;&#9;Loading *string `parser:&quot;('loading' @String)?&quot;`&#10;&#9;Disabled *string `parser:&quot;('disabled' 'when' @Ident)?&quot;`&#10;&#9;Confirm *string `parser:&quot;('confirm' @String)?&quot;`&#10;&#9;Target *string `parser:&quot;('target' @Ident)?&quot;`&#10;&#9;Position *string `parser:&quot;('position' @String)?&quot;`&#10;&#9;Via *string `parser:&quot;('via' @String)?&quot;`&#10;}&#10;&#10;func ParseInput(input string) (AST, error) {&#10;&#9;parser, err := participle.Build[AST](&#10;&#9;&#9;participle.Unquote(&quot;String&quot;),&#10;&#9;)&#10;&#9;if err != nil {&#10;&#9;&#9;return AST{}, err&#10;&#9;}&#10;&#9;ast, err := parser.ParseString(&quot;&quot;, input)&#10;&#9;if err != nil {&#10;&#9;&#9;return AST{}, err&#10;&#9;}&#10;&#9;return *ast, nil&#10;}" />
</PendingDiffInfo>
</value>
</entry>
<entry key="$PROJECT_DIR$/lang/parser_ui_advanced_test.go">
<value>
<PendingDiffInfo>
<option name="filePath" value="$PROJECT_DIR$/lang/parser_ui_advanced_test.go" />
<option name="originalContent" value="package lang&#10;&#10;import (&#10;&#9;&quot;testing&quot;&#10;)&#10;&#10;func TestParseAdvancedUIFeatures(t *testing.T) {&#10;&#9;tests := []struct {&#10;&#9;&#9;name string&#10;&#9;&#9;input string&#10;&#9;&#9;want AST&#10;&#9;&#9;wantErr bool&#10;&#9;}{&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;complex conditional rendering with multiple operators&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component form for User {&#10;&#9;&#9;&#9;&#9;&#9;field status type select options [&quot;active&quot;, &quot;inactive&quot;, &quot;pending&quot;]&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;when status equals &quot;active&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;field last_login type datetime&#10;&#9;&#9;&#9;&#9;&#9;&#9;field permissions type multiselect&#10;&#9;&#9;&#9;&#9;&#9;&#9;button deactivate label &quot;Deactivate User&quot; style &quot;warning&quot;&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;when status not_equals &quot;active&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;field reason type textarea placeholder &quot;Reason for status&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;button activate label &quot;Activate User&quot; style &quot;success&quot;&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;when status contains &quot;pending&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;field approval_date type date&#10;&#9;&#9;&#9;&#9;&#9;&#9;button approve label &quot;Approve&quot; style &quot;primary&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;button reject label &quot;Reject&quot; style &quot;danger&quot;&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Components: []Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;status&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;select&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Options: []string{&quot;active&quot;, &quot;inactive&quot;, &quot;pending&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;When: &amp;WhenCondition{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &quot;status&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Operator: &quot;equals&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Value: &quot;active&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Fields: []ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Name: &quot;last_login&quot;, Type: &quot;datetime&quot;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Name: &quot;permissions&quot;, Type: &quot;multiselect&quot;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Buttons: []ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;deactivate&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Deactivate User&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;warning&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;When: &amp;WhenCondition{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &quot;status&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Operator: &quot;not_equals&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Value: &quot;active&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Fields: []ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;reason&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;textarea&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Placeholder: stringPtr(&quot;Reason for status&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Buttons: []ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;activate&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Activate User&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;success&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;When: &amp;WhenCondition{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &quot;status&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Operator: &quot;contains&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Value: &quot;pending&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Fields: []ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Name: &quot;approval_date&quot;, Type: &quot;date&quot;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Buttons: []ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;approve&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Approve&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;primary&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;reject&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Reject&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;danger&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;field attributes with all possible options&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component form for Product {&#10;&#9;&#9;&#9;&#9;&#9;field name type text {&#10;&#9;&#9;&#9;&#9;&#9;&#9;label &quot;Product Name&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;placeholder &quot;Enter product name&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;required&#10;&#9;&#9;&#9;&#9;&#9;&#9;default &quot;New Product&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;validate min_length &quot;3&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;size &quot;large&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;display &quot;block&quot;&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;field price type number {&#10;&#9;&#9;&#9;&#9;&#9;&#9;label &quot;Price ($)&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;format &quot;currency&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;validate min &quot;0&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;validate max &quot;10000&quot;&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;field category type autocomplete {&#10;&#9;&#9;&#9;&#9;&#9;&#9;label &quot;Category&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;placeholder &quot;Start typing...&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;relates to Category&#10;&#9;&#9;&#9;&#9;&#9;&#9;searchable&#10;&#9;&#9;&#9;&#9;&#9;&#9;source &quot;categories/search&quot;&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;field tags type multiselect {&#10;&#9;&#9;&#9;&#9;&#9;&#9;label &quot;Tags&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;options [&quot;electronics&quot;, &quot;clothing&quot;, &quot;books&quot;, &quot;home&quot;]&#10;&#9;&#9;&#9;&#9;&#9;&#9;source &quot;tags/popular&quot;&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;field description type richtext {&#10;&#9;&#9;&#9;&#9;&#9;&#9;label &quot;Description&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;rows 10&#10;&#9;&#9;&#9;&#9;&#9;&#9;placeholder &quot;Describe your product...&quot;&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;field thumbnail type image {&#10;&#9;&#9;&#9;&#9;&#9;&#9;label &quot;Product Image&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;accept &quot;image/jpeg,image/png&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;thumbnail&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;field featured type checkbox {&#10;&#9;&#9;&#9;&#9;&#9;&#9;label &quot;Featured Product&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;default &quot;false&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;value &quot;true&quot;&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;field availability type select {&#10;&#9;&#9;&#9;&#9;&#9;&#9;label &quot;Availability&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;options [&quot;in_stock&quot;, &quot;out_of_stock&quot;, &quot;pre_order&quot;]&#10;&#9;&#9;&#9;&#9;&#9;&#9;default &quot;in_stock&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;sortable&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Components: []Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;Product&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;name&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;text&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Label: stringPtr(&quot;Product Name&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Placeholder: stringPtr(&quot;Enter product name&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Required: true},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Default: stringPtr(&quot;New Product&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Validation: &amp;ComponentValidation{Type: &quot;min_length&quot;, Value: stringPtr(&quot;3&quot;)}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Size: stringPtr(&quot;large&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Display: stringPtr(&quot;block&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;price&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;number&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Label: stringPtr(&quot;Price ($)&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Format: stringPtr(&quot;currency&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Validation: &amp;ComponentValidation{Type: &quot;min&quot;, Value: stringPtr(&quot;0&quot;)}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Validation: &amp;ComponentValidation{Type: &quot;max&quot;, Value: stringPtr(&quot;10000&quot;)}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;category&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;autocomplete&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Label: stringPtr(&quot;Category&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Placeholder: stringPtr(&quot;Start typing...&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Relates: &amp;FieldRelation{Type: &quot;Category&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Searchable: true},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Source: stringPtr(&quot;categories/search&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;tags&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;multiselect&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Label: stringPtr(&quot;Tags&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Options: []string{&quot;electronics&quot;, &quot;clothing&quot;, &quot;books&quot;, &quot;home&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Source: stringPtr(&quot;tags/popular&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;description&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;richtext&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Label: stringPtr(&quot;Description&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Rows: intPtr(10)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Placeholder: stringPtr(&quot;Describe your product...&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;thumbnail&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;image&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Label: stringPtr(&quot;Product Image&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Accept: stringPtr(&quot;image/jpeg,image/png&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Thumbnail: true},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;featured&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;checkbox&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Label: stringPtr(&quot;Featured Product&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Default: stringPtr(&quot;false&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Value: stringPtr(&quot;true&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;availability&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;select&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Label: stringPtr(&quot;Availability&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Options: []string{&quot;in_stock&quot;, &quot;out_of_stock&quot;, &quot;pre_order&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Default: stringPtr(&quot;in_stock&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Sortable: true},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;complex button configurations&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component form for Order {&#10;&#9;&#9;&#9;&#9;&#9;field status type select options [&quot;draft&quot;, &quot;submitted&quot;, &quot;approved&quot;]&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;button save label &quot;Save Draft&quot; style &quot;secondary&quot; icon &quot;save&quot; position &quot;left&quot;&#10;&#9;&#9;&#9;&#9;&#9;button submit label &quot;Submit Order&quot; style &quot;primary&quot; icon &quot;send&quot; loading &quot;Submitting...&quot; confirm &quot;Submit this order?&quot;&#10;&#9;&#9;&#9;&#9;&#9;button approve label &quot;Approve&quot; style &quot;success&quot; loading &quot;Approving...&quot; disabled when status confirm &quot;Approve this order?&quot; target &quot;approval_modal&quot; via &quot;api/orders/approve&quot;&#10;&#9;&#9;&#9;&#9;&#9;button reject label &quot;Reject&quot; style &quot;danger&quot; icon &quot;x&quot; confirm &quot;Are you sure you want to reject this order?&quot;&#10;&#9;&#9;&#9;&#9;&#9;button print label &quot;Print&quot; style &quot;outline&quot; icon &quot;printer&quot; position &quot;right&quot;&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Components: []Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;Order&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;status&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;select&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Options: []string{&quot;draft&quot;, &quot;submitted&quot;, &quot;approved&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Button: &amp;ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;save&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Save Draft&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;secondary&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Icon: &amp;ComponentButtonIcon{Value: &quot;save&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Position: &amp;ComponentButtonPosition{Value: &quot;left&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Button: &amp;ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;submit&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Submit Order&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;primary&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Icon: &amp;ComponentButtonIcon{Value: &quot;send&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Loading: &amp;ComponentButtonLoading{Value: &quot;Submitting...&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Confirm: &amp;ComponentButtonConfirm{Value: &quot;Submit this order?&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Button: &amp;ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;approve&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Approve&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;success&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Loading: &amp;ComponentButtonLoading{Value: &quot;Approving...&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Disabled: &amp;ComponentButtonDisabled{Value: &quot;status&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Confirm: &amp;ComponentButtonConfirm{Value: &quot;Approve this order?&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Target: &amp;ComponentButtonTarget{Value: &quot;approval_modal&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Via: &amp;ComponentButtonVia{Value: &quot;api/orders/approve&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Button: &amp;ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;reject&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Reject&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;danger&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Icon: &amp;ComponentButtonIcon{Value: &quot;x&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Confirm: &amp;ComponentButtonConfirm{Value: &quot;Are you sure you want to reject this order?&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Button: &amp;ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;print&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Print&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;outline&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Icon: &amp;ComponentButtonIcon{Value: &quot;printer&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Position: &amp;ComponentButtonPosition{Value: &quot;right&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;nested conditional sections with components&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component dashboard {&#10;&#9;&#9;&#9;&#9;&#9;when user_role equals &quot;admin&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;section admin_tools type container {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;component table for User {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fields [name, email, role, last_login]&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;actions [edit, delete, impersonate]&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;when system_status equals &quot;maintenance&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;section maintenance_banner type container class &quot;alert-warning&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;component alert {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;field message type display value &quot;System is in maintenance mode&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;button exit_maintenance label &quot;Exit Maintenance&quot; style &quot;warning&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;when user_role not_equals &quot;admin&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;section user_dashboard type container {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;component profile for User {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;field name type display&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;field email type display&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;field last_login type display format &quot;datetime&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Components: []Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;dashboard&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;When: &amp;WhenCondition{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &quot;user_role&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Operator: &quot;equals&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Value: &quot;admin&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sections: []Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;admin_tools&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;table&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attribute: &amp;ComponentAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Fields: []string{&quot;name&quot;, &quot;email&quot;, &quot;role&quot;, &quot;last_login&quot;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Actions: []string{&quot;edit&quot;, &quot;delete&quot;, &quot;impersonate&quot;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;When: &amp;WhenCondition{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &quot;system_status&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Operator: &quot;equals&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Value: &quot;maintenance&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sections: []Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;maintenance_banner&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Class: stringPtr(&quot;alert-warning&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;alert&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;message&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;display&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Value: stringPtr(&quot;System is in maintenance mode&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Button: &amp;ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;exit_maintenance&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Exit Maintenance&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;warning&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;When: &amp;WhenCondition{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &quot;user_role&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Operator: &quot;not_equals&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Value: &quot;admin&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sections: []Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;user_dashboard&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;profile&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;name&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;display&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;email&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;display&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;last_login&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;display&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Format: stringPtr(&quot;datetime&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;comprehensive component attributes and data sources&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component table for Product {&#10;&#9;&#9;&#9;&#9;&#9;data from &quot;products/active&quot;&#10;&#9;&#9;&#9;&#9;&#9;fields [name, price, category, stock]&#10;&#9;&#9;&#9;&#9;&#9;actions [view, edit, delete, duplicate]&#10;&#9;&#9;&#9;&#9;&#9;style &quot;striped bordered&quot;&#10;&#9;&#9;&#9;&#9;&#9;classes &quot;table-responsive table-hover&quot;&#10;&#9;&#9;&#9;&#9;&#9;pagination size 50&#10;&#9;&#9;&#9;&#9;&#9;validate&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;component chart for Analytics {&#10;&#9;&#9;&#9;&#9;&#9;data from &quot;analytics/sales&quot;&#10;&#9;&#9;&#9;&#9;&#9;style &quot;modern&quot;&#10;&#9;&#9;&#9;&#9;&#9;classes &quot;chart-container&quot;&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;component form for User {&#10;&#9;&#9;&#9;&#9;&#9;fields [name, email, role]&#10;&#9;&#9;&#9;&#9;&#9;actions [save, cancel, reset]&#10;&#9;&#9;&#9;&#9;&#9;validate&#10;&#9;&#9;&#9;&#9;&#9;style &quot;compact&quot;&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Components: []Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;table&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;Product&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attribute: &amp;ComponentAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;DataSource: stringPtr(&quot;products/active&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Fields: []string{&quot;name&quot;, &quot;price&quot;, &quot;category&quot;, &quot;stock&quot;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Actions: []string{&quot;view&quot;, &quot;edit&quot;, &quot;delete&quot;, &quot;duplicate&quot;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Style: stringPtr(&quot;striped bordered&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Classes: stringPtr(&quot;table-responsive table-hover&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;PageSize: intPtr(50),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Validate: true,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;chart&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;Analytics&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attribute: &amp;ComponentAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;DataSource: stringPtr(&quot;analytics/sales&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Style: stringPtr(&quot;modern&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Classes: stringPtr(&quot;chart-container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attribute: &amp;ComponentAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Fields: []string{&quot;name&quot;, &quot;email&quot;, &quot;role&quot;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Actions: []string{&quot;save&quot;, &quot;cancel&quot;, &quot;reset&quot;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Validate: true,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Style: stringPtr(&quot;compact&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;}&#10;&#10;&#9;for _, tt := range tests {&#10;&#9;&#9;t.Run(tt.name, func(t *testing.T) {&#10;&#9;&#9;&#9;got, err := ParseInput(tt.input)&#10;&#9;&#9;&#9;if (err != nil) != tt.wantErr {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() error = %v, wantErr %v&quot;, err, tt.wantErr)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;if !astEqual(got, tt.want) {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() got = %v, want = %v&quot;, got, tt.want)&#10;&#9;&#9;&#9;}&#10;&#9;&#9;})&#10;&#9;}&#10;}&#10;&#10;func TestParseFieldValidationTypes(t *testing.T) {&#10;&#9;validationTypes := []struct {&#10;&#9;&#9;validation string&#10;&#9;&#9;hasValue bool&#10;&#9;}{&#10;&#9;&#9;{&quot;email&quot;, false},&#10;&#9;&#9;{&quot;required&quot;, false},&#10;&#9;&#9;{&quot;min_length&quot;, true},&#10;&#9;&#9;{&quot;max_length&quot;, true},&#10;&#9;&#9;{&quot;min&quot;, true},&#10;&#9;&#9;{&quot;max&quot;, true},&#10;&#9;&#9;{&quot;pattern&quot;, true},&#10;&#9;&#9;{&quot;numeric&quot;, false},&#10;&#9;&#9;{&quot;alpha&quot;, false},&#10;&#9;&#9;{&quot;alphanumeric&quot;, false},&#10;&#9;&#9;{&quot;url&quot;, false},&#10;&#9;&#9;{&quot;date&quot;, false},&#10;&#9;&#9;{&quot;datetime&quot;, false},&#10;&#9;&#9;{&quot;time&quot;, false},&#10;&#9;&#9;{&quot;phone&quot;, false},&#10;&#9;&#9;{&quot;postal_code&quot;, false},&#10;&#9;&#9;{&quot;credit_card&quot;, false},&#10;&#9;}&#10;&#10;&#9;for _, vt := range validationTypes {&#10;&#9;&#9;t.Run(&quot;validation_&quot;+vt.validation, func(t *testing.T) {&#10;&#9;&#9;&#9;var input string&#10;&#9;&#9;&#9;if vt.hasValue {&#10;&#9;&#9;&#9;&#9;input = `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;&#9;component form {&#10;&#9;&#9;&#9;&#9;&#9;&#9;field test_field type text validate ` + vt.validation + ` &quot;test_value&quot;&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}`&#10;&#9;&#9;&#9;} else {&#10;&#9;&#9;&#9;&#9;input = `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;&#9;component form {&#10;&#9;&#9;&#9;&#9;&#9;&#9;field test_field type text validate ` + vt.validation + `&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}`&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;got, err := ParseInput(input)&#10;&#9;&#9;&#9;if err != nil {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() failed for validation %s: %v&quot;, vt.validation, err)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;if len(got.Definitions) != 1 || got.Definitions[0].Page == nil {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() failed to parse page for validation %s&quot;, vt.validation)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;page := got.Definitions[0].Page&#10;&#9;&#9;&#9;if len(page.Components) != 1 || len(page.Components[0].Elements) != 1 {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() failed to parse component for validation %s&quot;, vt.validation)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;element := page.Components[0].Elements[0]&#10;&#9;&#9;&#9;if element.Field == nil || len(element.Field.Attributes) != 1 {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() failed to parse field attributes for validation %s&quot;, vt.validation)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;attr := element.Field.Attributes[0]&#10;&#9;&#9;&#9;if attr.Validation == nil || attr.Validation.Type != vt.validation {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() validation type mismatch: got %v, want %s&quot;, attr.Validation, vt.validation)&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;if vt.hasValue &amp;&amp; (attr.Validation.Value == nil || *attr.Validation.Value != &quot;test_value&quot;) {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() validation value mismatch for %s&quot;, vt.validation)&#10;&#9;&#9;&#9;}&#10;&#9;&#9;})&#10;&#9;}&#10;}&#10;&#10;func TestParseConditionalOperators(t *testing.T) {&#10;&#9;operators := []string{&quot;equals&quot;, &quot;not_equals&quot;, &quot;contains&quot;}&#10;&#10;&#9;for _, op := range operators {&#10;&#9;&#9;t.Run(&quot;operator_&quot;+op, func(t *testing.T) {&#10;&#9;&#9;&#9;input := `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component form {&#10;&#9;&#9;&#9;&#9;&#9;field test_field type text&#10;&#9;&#9;&#9;&#9;&#9;when test_field ` + op + ` &quot;test_value&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;field conditional_field type text&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`&#10;&#10;&#9;&#9;&#9;got, err := ParseInput(input)&#10;&#9;&#9;&#9;if err != nil {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() failed for operator %s: %v&quot;, op, err)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;// Verify the when condition was parsed correctly&#10;&#9;&#9;&#9;page := got.Definitions[0].Page&#10;&#9;&#9;&#9;component := page.Components[0]&#10;&#9;&#9;&#9;whenElement := component.Elements[1].When&#10;&#10;&#9;&#9;&#9;if whenElement == nil || whenElement.Operator != op {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() operator mismatch: got %v, want %s&quot;, whenElement, op)&#10;&#9;&#9;&#9;}&#10;&#9;&#9;})&#10;&#9;}&#10;}&#10;&#10;func TestParseAdvancedUIErrors(t *testing.T) {&#10;&#9;tests := []struct {&#10;&#9;&#9;name string&#10;&#9;&#9;input string&#10;&#9;}{&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;invalid conditional operator&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component form {&#10;&#9;&#9;&#9;&#9;&#9;when field invalid_operator &quot;value&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;field test type text&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;missing field attribute block closure&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component form {&#10;&#9;&#9;&#9;&#9;&#9;field test type text {&#10;&#9;&#9;&#9;&#9;&#9;&#9;label &quot;Test&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;required&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;invalid validation syntax&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component form {&#10;&#9;&#9;&#9;&#9;&#9;field test type text validate&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;},&#10;&#9;}&#10;&#10;&#9;for _, tt := range tests {&#10;&#9;&#9;t.Run(tt.name, func(t *testing.T) {&#10;&#9;&#9;&#9;_, err := ParseInput(tt.input)&#10;&#9;&#9;&#9;if err == nil {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() expected error for invalid syntax, got nil&quot;)&#10;&#9;&#9;&#9;}&#10;&#9;&#9;})&#10;&#9;}&#10;}&#10;" />
<option name="updatedContent" value="package lang&#10;&#10;import (&#10;&#9;&quot;testing&quot;&#10;)&#10;&#10;func TestParseAdvancedUIFeatures(t *testing.T) {&#10;&#9;tests := []struct {&#10;&#9;&#9;name string&#10;&#9;&#9;input string&#10;&#9;&#9;want AST&#10;&#9;&#9;wantErr bool&#10;&#9;}{&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;complex conditional rendering with multiple operators&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component form for User {&#10;&#9;&#9;&#9;&#9;&#9;field status type select options [&quot;active&quot;, &quot;inactive&quot;, &quot;pending&quot;]&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;when status equals &quot;active&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;field last_login type datetime&#10;&#9;&#9;&#9;&#9;&#9;&#9;field permissions type multiselect&#10;&#9;&#9;&#9;&#9;&#9;&#9;button deactivate label &quot;Deactivate User&quot; style &quot;warning&quot;&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;when status not_equals &quot;active&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;field reason type textarea placeholder &quot;Reason for status&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;button activate label &quot;Activate User&quot; style &quot;success&quot;&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;when status contains &quot;pending&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;field approval_date type date&#10;&#9;&#9;&#9;&#9;&#9;&#9;button approve label &quot;Approve&quot; style &quot;primary&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;button reject label &quot;Reject&quot; style &quot;danger&quot;&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Components: []Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;status&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;select&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Options: []string{&quot;active&quot;, &quot;inactive&quot;, &quot;pending&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;When: &amp;WhenCondition{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &quot;status&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Operator: &quot;equals&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Value: &quot;active&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Fields: []ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Name: &quot;last_login&quot;, Type: &quot;datetime&quot;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Name: &quot;permissions&quot;, Type: &quot;multiselect&quot;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Buttons: []ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;deactivate&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Deactivate User&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;warning&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;When: &amp;WhenCondition{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &quot;status&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Operator: &quot;not_equals&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Value: &quot;active&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Fields: []ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;reason&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;textarea&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Placeholder: stringPtr(&quot;Reason for status&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Buttons: []ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;activate&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Activate User&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;success&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;When: &amp;WhenCondition{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &quot;status&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Operator: &quot;contains&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Value: &quot;pending&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Fields: []ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Name: &quot;approval_date&quot;, Type: &quot;date&quot;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Buttons: []ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;approve&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Approve&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;primary&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;reject&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Reject&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;danger&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;field attributes with all possible options&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component form for Product {&#10;&#9;&#9;&#9;&#9;&#9;field name type text {&#10;&#9;&#9;&#9;&#9;&#9;&#9;label &quot;Product Name&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;placeholder &quot;Enter product name&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;required&#10;&#9;&#9;&#9;&#9;&#9;&#9;default &quot;New Product&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;validate min_length &quot;3&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;size &quot;large&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;display &quot;block&quot;&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;field price type number {&#10;&#9;&#9;&#9;&#9;&#9;&#9;label &quot;Price ($)&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;format &quot;currency&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;validate min &quot;0&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;validate max &quot;10000&quot;&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;field category type autocomplete {&#10;&#9;&#9;&#9;&#9;&#9;&#9;label &quot;Category&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;placeholder &quot;Start typing...&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;relates to Category&#10;&#9;&#9;&#9;&#9;&#9;&#9;searchable&#10;&#9;&#9;&#9;&#9;&#9;&#9;source &quot;categories/search&quot;&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;field tags type multiselect {&#10;&#9;&#9;&#9;&#9;&#9;&#9;label &quot;Tags&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;options [&quot;electronics&quot;, &quot;clothing&quot;, &quot;books&quot;, &quot;home&quot;]&#10;&#9;&#9;&#9;&#9;&#9;&#9;source &quot;tags/popular&quot;&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;field description type richtext {&#10;&#9;&#9;&#9;&#9;&#9;&#9;label &quot;Description&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;rows 10&#10;&#9;&#9;&#9;&#9;&#9;&#9;placeholder &quot;Describe your product...&quot;&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;field thumbnail type image {&#10;&#9;&#9;&#9;&#9;&#9;&#9;label &quot;Product Image&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;accept &quot;image/jpeg,image/png&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;thumbnail&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;field featured type checkbox {&#10;&#9;&#9;&#9;&#9;&#9;&#9;label &quot;Featured Product&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;default &quot;false&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;value &quot;true&quot;&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;field availability type select {&#10;&#9;&#9;&#9;&#9;&#9;&#9;label &quot;Availability&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;options [&quot;in_stock&quot;, &quot;out_of_stock&quot;, &quot;pre_order&quot;]&#10;&#9;&#9;&#9;&#9;&#9;&#9;default &quot;in_stock&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;sortable&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Components: []Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;Product&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;name&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;text&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Label: stringPtr(&quot;Product Name&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Placeholder: stringPtr(&quot;Enter product name&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Required: true},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Default: stringPtr(&quot;New Product&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Validation: &amp;ComponentValidation{Type: &quot;min_length&quot;, Value: stringPtr(&quot;3&quot;)}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Size: stringPtr(&quot;large&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Display: stringPtr(&quot;block&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;price&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;number&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Label: stringPtr(&quot;Price ($)&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Format: stringPtr(&quot;currency&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Validation: &amp;ComponentValidation{Type: &quot;min&quot;, Value: stringPtr(&quot;0&quot;)}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Validation: &amp;ComponentValidation{Type: &quot;max&quot;, Value: stringPtr(&quot;10000&quot;)}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;category&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;autocomplete&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Label: stringPtr(&quot;Category&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Placeholder: stringPtr(&quot;Start typing...&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Relates: &amp;FieldRelation{Type: &quot;Category&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Searchable: true},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Source: stringPtr(&quot;categories/search&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;tags&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;multiselect&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Label: stringPtr(&quot;Tags&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Options: []string{&quot;electronics&quot;, &quot;clothing&quot;, &quot;books&quot;, &quot;home&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Source: stringPtr(&quot;tags/popular&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;description&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;richtext&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Label: stringPtr(&quot;Description&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Rows: intPtr(10)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Placeholder: stringPtr(&quot;Describe your product...&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;thumbnail&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;image&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Label: stringPtr(&quot;Product Image&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Accept: stringPtr(&quot;image/jpeg,image/png&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Thumbnail: true},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;featured&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;checkbox&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Label: stringPtr(&quot;Featured Product&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Default: stringPtr(&quot;false&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Value: stringPtr(&quot;true&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;availability&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;select&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Label: stringPtr(&quot;Availability&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Options: []string{&quot;in_stock&quot;, &quot;out_of_stock&quot;, &quot;pre_order&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Default: stringPtr(&quot;in_stock&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Sortable: true},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;complex button configurations&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component form for Order {&#10;&#9;&#9;&#9;&#9;&#9;field status type select options [&quot;draft&quot;, &quot;submitted&quot;, &quot;approved&quot;]&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;button save label &quot;Save Draft&quot; style &quot;secondary&quot; icon &quot;save&quot; position &quot;left&quot;&#10;&#9;&#9;&#9;&#9;&#9;button submit label &quot;Submit Order&quot; style &quot;primary&quot; icon &quot;send&quot; loading &quot;Submitting...&quot; confirm &quot;Submit this order?&quot;&#10;&#9;&#9;&#9;&#9;&#9;button approve label &quot;Approve&quot; style &quot;success&quot; loading &quot;Approving...&quot; disabled when status confirm &quot;Approve this order?&quot; target approval_modal via &quot;api/orders/approve&quot;&#10;&#9;&#9;&#9;&#9;&#9;button reject label &quot;Reject&quot; style &quot;danger&quot; icon &quot;x&quot; confirm &quot;Are you sure you want to reject this order?&quot;&#10;&#9;&#9;&#9;&#9;&#9;button print label &quot;Print&quot; style &quot;outline&quot; icon &quot;printer&quot; position &quot;right&quot;&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Components: []Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;Order&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;status&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;select&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Options: []string{&quot;draft&quot;, &quot;submitted&quot;, &quot;approved&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Button: &amp;ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;save&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Save Draft&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;secondary&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Icon: &amp;ComponentButtonIcon{Value: &quot;save&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Position: &amp;ComponentButtonPosition{Value: &quot;left&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Button: &amp;ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;submit&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Submit Order&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;primary&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Icon: &amp;ComponentButtonIcon{Value: &quot;send&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Loading: &amp;ComponentButtonLoading{Value: &quot;Submitting...&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Confirm: &amp;ComponentButtonConfirm{Value: &quot;Submit this order?&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Button: &amp;ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;approve&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Approve&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;success&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Loading: &amp;ComponentButtonLoading{Value: &quot;Approving...&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Disabled: &amp;ComponentButtonDisabled{Value: &quot;status&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Confirm: &amp;ComponentButtonConfirm{Value: &quot;Approve this order?&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Target: &amp;ComponentButtonTarget{Value: &quot;approval_modal&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Via: &amp;ComponentButtonVia{Value: &quot;api/orders/approve&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Button: &amp;ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;reject&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Reject&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;danger&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Icon: &amp;ComponentButtonIcon{Value: &quot;x&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Confirm: &amp;ComponentButtonConfirm{Value: &quot;Are you sure you want to reject this order?&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Button: &amp;ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;print&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Print&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;outline&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Icon: &amp;ComponentButtonIcon{Value: &quot;printer&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Position: &amp;ComponentButtonPosition{Value: &quot;right&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;nested conditional sections with components&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component dashboard {&#10;&#9;&#9;&#9;&#9;&#9;when user_role equals &quot;admin&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;section admin_tools type container {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;component table for User {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fields [name, email, role, last_login]&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;actions [edit, delete, impersonate]&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;when system_status equals &quot;maintenance&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;section maintenance_banner type container class &quot;alert-warning&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;component alert {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;field message type display value &quot;System is in maintenance mode&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;button exit_maintenance label &quot;Exit Maintenance&quot; style &quot;warning&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;when user_role not_equals &quot;admin&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;section user_dashboard type container {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;component profile for User {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;field name type display&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;field email type display&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;field last_login type display format &quot;datetime&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Components: []Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;dashboard&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;When: &amp;WhenCondition{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &quot;user_role&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Operator: &quot;equals&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Value: &quot;admin&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sections: []Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;admin_tools&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;table&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attribute: &amp;ComponentAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Fields: []string{&quot;name&quot;, &quot;email&quot;, &quot;role&quot;, &quot;last_login&quot;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Actions: []string{&quot;edit&quot;, &quot;delete&quot;, &quot;impersonate&quot;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;When: &amp;WhenCondition{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &quot;system_status&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Operator: &quot;equals&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Value: &quot;maintenance&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sections: []Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;maintenance_banner&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Class: stringPtr(&quot;alert-warning&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;alert&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;message&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;display&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Value: stringPtr(&quot;System is in maintenance mode&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Button: &amp;ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;exit_maintenance&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Exit Maintenance&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;warning&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;When: &amp;WhenCondition{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &quot;user_role&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Operator: &quot;not_equals&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Value: &quot;admin&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sections: []Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;user_dashboard&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;profile&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;name&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;display&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;email&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;display&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;last_login&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;display&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Format: stringPtr(&quot;datetime&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;comprehensive component attributes and data sources&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component table for Product {&#10;&#9;&#9;&#9;&#9;&#9;data from &quot;products/active&quot;&#10;&#9;&#9;&#9;&#9;&#9;fields [name, price, category, stock]&#10;&#9;&#9;&#9;&#9;&#9;actions [view, edit, delete, duplicate]&#10;&#9;&#9;&#9;&#9;&#9;style &quot;striped bordered&quot;&#10;&#9;&#9;&#9;&#9;&#9;classes &quot;table-responsive table-hover&quot;&#10;&#9;&#9;&#9;&#9;&#9;pagination size 50&#10;&#9;&#9;&#9;&#9;&#9;validate&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;component chart for Analytics {&#10;&#9;&#9;&#9;&#9;&#9;data from &quot;analytics/sales&quot;&#10;&#9;&#9;&#9;&#9;&#9;style &quot;modern&quot;&#10;&#9;&#9;&#9;&#9;&#9;classes &quot;chart-container&quot;&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;component form for User {&#10;&#9;&#9;&#9;&#9;&#9;fields [name, email, role]&#10;&#9;&#9;&#9;&#9;&#9;actions [save, cancel, reset]&#10;&#9;&#9;&#9;&#9;&#9;validate&#10;&#9;&#9;&#9;&#9;&#9;style &quot;compact&quot;&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Components: []Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;table&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;Product&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attribute: &amp;ComponentAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;DataSource: stringPtr(&quot;products/active&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Fields: []string{&quot;name&quot;, &quot;price&quot;, &quot;category&quot;, &quot;stock&quot;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Actions: []string{&quot;view&quot;, &quot;edit&quot;, &quot;delete&quot;, &quot;duplicate&quot;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Style: stringPtr(&quot;striped bordered&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Classes: stringPtr(&quot;table-responsive table-hover&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;PageSize: intPtr(50),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Validate: true,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;chart&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;Analytics&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attribute: &amp;ComponentAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;DataSource: stringPtr(&quot;analytics/sales&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Style: stringPtr(&quot;modern&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Classes: stringPtr(&quot;chart-container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attribute: &amp;ComponentAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Fields: []string{&quot;name&quot;, &quot;email&quot;, &quot;role&quot;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Actions: []string{&quot;save&quot;, &quot;cancel&quot;, &quot;reset&quot;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Validate: true,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Style: stringPtr(&quot;compact&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;}&#10;&#10;&#9;for _, tt := range tests {&#10;&#9;&#9;t.Run(tt.name, func(t *testing.T) {&#10;&#9;&#9;&#9;got, err := ParseInput(tt.input)&#10;&#9;&#9;&#9;if (err != nil) != tt.wantErr {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() error = %v, wantErr %v&quot;, err, tt.wantErr)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;if !astEqual(got, tt.want) {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() got = %v, want = %v&quot;, got, tt.want)&#10;&#9;&#9;&#9;}&#10;&#9;&#9;})&#10;&#9;}&#10;}&#10;&#10;func TestParseFieldValidationTypes(t *testing.T) {&#10;&#9;validationTypes := []struct {&#10;&#9;&#9;validation string&#10;&#9;&#9;hasValue bool&#10;&#9;}{&#10;&#9;&#9;{&quot;email&quot;, false},&#10;&#9;&#9;{&quot;required&quot;, false},&#10;&#9;&#9;{&quot;min_length&quot;, true},&#10;&#9;&#9;{&quot;max_length&quot;, true},&#10;&#9;&#9;{&quot;min&quot;, true},&#10;&#9;&#9;{&quot;max&quot;, true},&#10;&#9;&#9;{&quot;pattern&quot;, true},&#10;&#9;&#9;{&quot;numeric&quot;, false},&#10;&#9;&#9;{&quot;alpha&quot;, false},&#10;&#9;&#9;{&quot;alphanumeric&quot;, false},&#10;&#9;&#9;{&quot;url&quot;, false},&#10;&#9;&#9;{&quot;date&quot;, false},&#10;&#9;&#9;{&quot;datetime&quot;, false},&#10;&#9;&#9;{&quot;time&quot;, false},&#10;&#9;&#9;{&quot;phone&quot;, false},&#10;&#9;&#9;{&quot;postal_code&quot;, false},&#10;&#9;&#9;{&quot;credit_card&quot;, false},&#10;&#9;}&#10;&#10;&#9;for _, vt := range validationTypes {&#10;&#9;&#9;t.Run(&quot;validation_&quot;+vt.validation, func(t *testing.T) {&#10;&#9;&#9;&#9;var input string&#10;&#9;&#9;&#9;if vt.hasValue {&#10;&#9;&#9;&#9;&#9;input = `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;&#9;component form {&#10;&#9;&#9;&#9;&#9;&#9;&#9;field test_field type text validate ` + vt.validation + ` &quot;test_value&quot;&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}`&#10;&#9;&#9;&#9;} else {&#10;&#9;&#9;&#9;&#9;input = `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;&#9;component form {&#10;&#9;&#9;&#9;&#9;&#9;&#9;field test_field type text validate ` + vt.validation + `&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}`&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;got, err := ParseInput(input)&#10;&#9;&#9;&#9;if err != nil {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() failed for validation %s: %v&quot;, vt.validation, err)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;if len(got.Definitions) != 1 || got.Definitions[0].Page == nil {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() failed to parse page for validation %s&quot;, vt.validation)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;page := got.Definitions[0].Page&#10;&#9;&#9;&#9;if len(page.Components) != 1 || len(page.Components[0].Elements) != 1 {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() failed to parse component for validation %s&quot;, vt.validation)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;element := page.Components[0].Elements[0]&#10;&#9;&#9;&#9;if element.Field == nil || len(element.Field.Attributes) != 1 {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() failed to parse field attributes for validation %s&quot;, vt.validation)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;attr := element.Field.Attributes[0]&#10;&#9;&#9;&#9;if attr.Validation == nil || attr.Validation.Type != vt.validation {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() validation type mismatch: got %v, want %s&quot;, attr.Validation, vt.validation)&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;if vt.hasValue &amp;&amp; (attr.Validation.Value == nil || *attr.Validation.Value != &quot;test_value&quot;) {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() validation value mismatch for %s&quot;, vt.validation)&#10;&#9;&#9;&#9;}&#10;&#9;&#9;})&#10;&#9;}&#10;}&#10;&#10;func TestParseConditionalOperators(t *testing.T) {&#10;&#9;operators := []string{&quot;equals&quot;, &quot;not_equals&quot;, &quot;contains&quot;}&#10;&#10;&#9;for _, op := range operators {&#10;&#9;&#9;t.Run(&quot;operator_&quot;+op, func(t *testing.T) {&#10;&#9;&#9;&#9;input := `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component form {&#10;&#9;&#9;&#9;&#9;&#9;field test_field type text&#10;&#9;&#9;&#9;&#9;&#9;when test_field ` + op + ` &quot;test_value&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;field conditional_field type text&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`&#10;&#10;&#9;&#9;&#9;got, err := ParseInput(input)&#10;&#9;&#9;&#9;if err != nil {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() failed for operator %s: %v&quot;, op, err)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;// Verify the when condition was parsed correctly&#10;&#9;&#9;&#9;page := got.Definitions[0].Page&#10;&#9;&#9;&#9;component := page.Components[0]&#10;&#9;&#9;&#9;whenElement := component.Elements[1].When&#10;&#10;&#9;&#9;&#9;if whenElement == nil || whenElement.Operator != op {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() operator mismatch: got %v, want %s&quot;, whenElement, op)&#10;&#9;&#9;&#9;}&#10;&#9;&#9;})&#10;&#9;}&#10;}&#10;&#10;func TestParseAdvancedUIErrors(t *testing.T) {&#10;&#9;tests := []struct {&#10;&#9;&#9;name string&#10;&#9;&#9;input string&#10;&#9;}{&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;invalid conditional operator&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component form {&#10;&#9;&#9;&#9;&#9;&#9;when field invalid_operator &quot;value&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;field test type text&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;missing field attribute block closure&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component form {&#10;&#9;&#9;&#9;&#9;&#9;field test type text {&#10;&#9;&#9;&#9;&#9;&#9;&#9;label &quot;Test&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;required&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;invalid validation syntax&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component form {&#10;&#9;&#9;&#9;&#9;&#9;field test type text validate&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;},&#10;&#9;}&#10;&#10;&#9;for _, tt := range tests {&#10;&#9;&#9;t.Run(tt.name, func(t *testing.T) {&#10;&#9;&#9;&#9;_, err := ParseInput(tt.input)&#10;&#9;&#9;&#9;if err == nil {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() expected error for invalid syntax, got nil&quot;)&#10;&#9;&#9;&#9;}&#10;&#9;&#9;})&#10;&#9;}&#10;}" />
</PendingDiffInfo>
</value>
</entry>
<entry key="$PROJECT_DIR$/lang/parser_ui_component_test.go">
<value>
<PendingDiffInfo>
<option name="filePath" value="$PROJECT_DIR$/lang/parser_ui_component_test.go" />
<option name="originalContent" value="package lang&#10;&#10;import (&#10;&#9;&quot;testing&quot;&#10;)&#10;&#10;func TestParseComponentDefinitions(t *testing.T) {&#10;&#9;tests := []struct {&#10;&#9;&#9;name string&#10;&#9;&#9;input string&#10;&#9;&#9;want AST&#10;&#9;&#9;wantErr bool&#10;&#9;}{&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;basic component with entity&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component table for User&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Components: []Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;table&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;component with attributes&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component table for User {&#10;&#9;&#9;&#9;&#9;&#9;data from &quot;users/active&quot;&#10;&#9;&#9;&#9;&#9;&#9;fields [&quot;name&quot;, &quot;email&quot;, &quot;status&quot;]&#10;&#9;&#9;&#9;&#9;&#9;actions [&quot;edit&quot;, &quot;delete&quot;, &quot;activate&quot;]&#10;&#9;&#9;&#9;&#9;&#9;style &quot;bordered&quot;&#10;&#9;&#9;&#9;&#9;&#9;classes &quot;table-responsive&quot;&#10;&#9;&#9;&#9;&#9;&#9;pagination size 25&#10;&#9;&#9;&#9;&#9;&#9;validate&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Components: []Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;table&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attribute: &amp;ComponentAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;DataSource: stringPtr(&quot;users/active&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Fields: []string{&quot;name&quot;, &quot;email&quot;, &quot;status&quot;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Actions: []string{&quot;edit&quot;, &quot;delete&quot;, &quot;activate&quot;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Style: stringPtr(&quot;bordered&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Classes: stringPtr(&quot;table-responsive&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;PageSize: intPtr(25),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Validate: true,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;form component with fields&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component form for User {&#10;&#9;&#9;&#9;&#9;&#9;field name type text label &quot;Full Name&quot; placeholder &quot;Enter your name&quot; required&#10;&#9;&#9;&#9;&#9;&#9;field email type email label &quot;Email Address&quot; required&#10;&#9;&#9;&#9;&#9;&#9;field bio type textarea rows 5 placeholder &quot;Tell us about yourself&quot;&#10;&#9;&#9;&#9;&#9;&#9;field avatar type file accept &quot;image/*&quot;&#10;&#9;&#9;&#9;&#9;&#9;field role type select options [&quot;admin&quot;, &quot;user&quot;, &quot;guest&quot;] default &quot;user&quot;&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Components: []Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;name&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;text&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Label: stringPtr(&quot;Full Name&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Placeholder: stringPtr(&quot;Enter your name&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Required: true},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;email&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;email&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Label: stringPtr(&quot;Email Address&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Required: true},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;bio&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;textarea&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Rows: intPtr(5)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Placeholder: stringPtr(&quot;Tell us about yourself&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;avatar&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;file&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Accept: stringPtr(&quot;image/*&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;role&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;select&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Options: []string{&quot;admin&quot;, &quot;user&quot;, &quot;guest&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Default: stringPtr(&quot;user&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;component with field attributes and validation&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component form for Product {&#10;&#9;&#9;&#9;&#9;&#9;field name type text required validate min_length &quot;3&quot;&#10;&#9;&#9;&#9;&#9;&#9;field price type number format &quot;currency&quot; validate min &quot;0&quot;&#10;&#9;&#9;&#9;&#9;&#9;field category type autocomplete relates to Category&#10;&#9;&#9;&#9;&#9;&#9;field tags type multiselect source &quot;tags/popular&quot;&#10;&#9;&#9;&#9;&#9;&#9;field description type richtext&#10;&#9;&#9;&#9;&#9;&#9;field featured type checkbox default &quot;false&quot;&#10;&#9;&#9;&#9;&#9;&#9;field thumbnail type image thumbnail&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Components: []Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;Product&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;name&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;text&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Required: true},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Validation: &amp;ComponentValidation{Type: &quot;min_length&quot;, Value: stringPtr(&quot;3&quot;)}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;price&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;number&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Format: stringPtr(&quot;currency&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Validation: &amp;ComponentValidation{Type: &quot;min&quot;, Value: stringPtr(&quot;0&quot;)}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;category&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;autocomplete&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Relates: &amp;FieldRelation{Type: &quot;Category&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;tags&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;multiselect&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Source: stringPtr(&quot;tags/popular&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;description&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;richtext&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;featured&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;checkbox&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Default: stringPtr(&quot;false&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;thumbnail&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;image&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Thumbnail: true},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;component with buttons&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component form for User {&#10;&#9;&#9;&#9;&#9;&#9;field name type text&#10;&#9;&#9;&#9;&#9;&#9;button save label &quot;Save User&quot; style &quot;primary&quot; icon &quot;save&quot;&#10;&#9;&#9;&#9;&#9;&#9;button cancel label &quot;Cancel&quot; style &quot;secondary&quot; &#10;&#9;&#9;&#9;&#9;&#9;button delete label &quot;Delete&quot; style &quot;danger&quot; confirm &quot;Are you sure?&quot; disabled when &quot;is_protected&quot;&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Components: []Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;name&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;text&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Button: &amp;ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;save&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Save User&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;primary&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Icon: &amp;ComponentButtonIcon{Value: &quot;save&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Button: &amp;ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;cancel&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Cancel&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;secondary&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Button: &amp;ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;delete&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Delete&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;danger&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Confirm: &amp;ComponentButtonConfirm{Value: &quot;Are you sure?&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Disabled: &amp;ComponentButtonDisabled{Value: &quot;is_protected&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;component with conditional fields&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component form for User {&#10;&#9;&#9;&#9;&#9;&#9;field account_type type select options [&quot;personal&quot;, &quot;business&quot;]&#10;&#9;&#9;&#9;&#9;&#9;when account_type equals &quot;business&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;field company_name type text required&#10;&#9;&#9;&#9;&#9;&#9;&#9;field tax_id type text&#10;&#9;&#9;&#9;&#9;&#9;&#9;button verify_business label &quot;Verify Business&quot;&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;when account_type equals &quot;personal&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;field date_of_birth type date&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Components: []Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;account_type&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;select&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Options: []string{&quot;personal&quot;, &quot;business&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;When: &amp;WhenCondition{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &quot;account_type&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Operator: &quot;equals&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Value: &quot;business&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Fields: []ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;company_name&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;text&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Required: true},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;tax_id&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;text&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Buttons: []ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;verify_business&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Verify Business&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;When: &amp;WhenCondition{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &quot;account_type&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Operator: &quot;equals&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Value: &quot;personal&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Fields: []ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;date_of_birth&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;date&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;component with nested sections&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component dashboard {&#10;&#9;&#9;&#9;&#9;&#9;section stats type container class &quot;stats-grid&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;component metric {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;field total_users type display value &quot;1,234&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;field revenue type display format &quot;currency&quot; value &quot;45,678&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;section charts type container {&#10;&#9;&#9;&#9;&#9;&#9;&#9;component chart for Analytics {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;data from &quot;analytics/monthly&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Components: []Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;dashboard&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;stats&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Class: stringPtr(&quot;stats-grid&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;metric&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;total_users&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;display&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Value: stringPtr(&quot;1,234&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;revenue&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;display&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Format: stringPtr(&quot;currency&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Value: stringPtr(&quot;45,678&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;charts&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;chart&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;Analytics&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attribute: &amp;ComponentAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;DataSource: stringPtr(&quot;analytics/monthly&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;}&#10;&#10;&#9;for _, tt := range tests {&#10;&#9;&#9;t.Run(tt.name, func(t *testing.T) {&#10;&#9;&#9;&#9;got, err := ParseInput(tt.input)&#10;&#9;&#9;&#9;if (err != nil) != tt.wantErr {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() error = %v, wantErr %v&quot;, err, tt.wantErr)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;if !astEqual(got, tt.want) {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() got = %v, want %v&quot;, got, tt.want)&#10;&#9;&#9;&#9;}&#10;&#9;&#9;})&#10;&#9;}&#10;}&#10;&#10;func TestParseComponentFieldTypes(t *testing.T) {&#10;&#9;fieldTypes := []string{&#10;&#9;&#9;&quot;text&quot;, &quot;email&quot;, &quot;password&quot;, &quot;number&quot;, &quot;date&quot;, &quot;datetime&quot;, &quot;time&quot;,&#10;&#9;&#9;&quot;textarea&quot;, &quot;richtext&quot;, &quot;select&quot;, &quot;multiselect&quot;, &quot;checkbox&quot;, &quot;radio&quot;,&#10;&#9;&#9;&quot;file&quot;, &quot;image&quot;, &quot;autocomplete&quot;, &quot;range&quot;, &quot;color&quot;, &quot;url&quot;, &quot;tel&quot;,&#10;&#9;&#9;&quot;hidden&quot;, &quot;display&quot;, &quot;json&quot;, &quot;code&quot;,&#10;&#9;}&#10;&#10;&#9;for _, fieldType := range fieldTypes {&#10;&#9;&#9;t.Run(&quot;field_type_&quot;+fieldType, func(t *testing.T) {&#10;&#9;&#9;&#9;input := `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component form {&#10;&#9;&#9;&#9;&#9;&#9;field test_field type ` + fieldType + `&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`&#10;&#10;&#9;&#9;&#9;got, err := ParseInput(input)&#10;&#9;&#9;&#9;if err != nil {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() failed for field type %s: %v&quot;, fieldType, err)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;if len(got.Definitions) != 1 || got.Definitions[0].Page == nil {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() failed to parse page for field type %s&quot;, fieldType)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;page := got.Definitions[0].Page&#10;&#9;&#9;&#9;if len(page.Components) != 1 || len(page.Components[0].Elements) != 1 {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() failed to parse component for field type %s&quot;, fieldType)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;element := page.Components[0].Elements[0]&#10;&#9;&#9;&#9;if element.Field == nil || element.Field.Type != fieldType {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() field type mismatch: got %v, want %s&quot;, element.Field, fieldType)&#10;&#9;&#9;&#9;}&#10;&#9;&#9;})&#10;&#9;}&#10;}&#10;&#10;func TestParseComponentErrors(t *testing.T) {&#10;&#9;tests := []struct {&#10;&#9;&#9;name string&#10;&#9;&#9;input string&#10;&#9;}{&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;missing component type&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;invalid field syntax&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component form {&#10;&#9;&#9;&#9;&#9;&#9;field name&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;invalid button syntax&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component form {&#10;&#9;&#9;&#9;&#9;&#9;button&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;},&#10;&#9;}&#10;&#10;&#9;for _, tt := range tests {&#10;&#9;&#9;t.Run(tt.name, func(t *testing.T) {&#10;&#9;&#9;&#9;_, err := ParseInput(tt.input)&#10;&#9;&#9;&#9;if err == nil {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() expected error for invalid syntax, got nil&quot;)&#10;&#9;&#9;&#9;}&#10;&#9;&#9;})&#10;&#9;}&#10;}&#10;" />
<option name="updatedContent" value="package lang&#10;&#10;import (&#10;&#9;&quot;testing&quot;&#10;)&#10;&#10;func TestParseComponentDefinitions(t *testing.T) {&#10;&#9;tests := []struct {&#10;&#9;&#9;name string&#10;&#9;&#9;input string&#10;&#9;&#9;want AST&#10;&#9;&#9;wantErr bool&#10;&#9;}{&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;basic component with entity&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component table for User&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Components: []Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;table&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;form component with fields&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component form for User {&#10;&#9;&#9;&#9;&#9;&#9;field name type text label &quot;Full Name&quot; placeholder &quot;Enter your name&quot; required&#10;&#9;&#9;&#9;&#9;&#9;field email type email label &quot;Email Address&quot; required&#10;&#9;&#9;&#9;&#9;&#9;field bio type textarea rows 5 placeholder &quot;Tell us about yourself&quot;&#10;&#9;&#9;&#9;&#9;&#9;field avatar type file accept &quot;image/*&quot;&#10;&#9;&#9;&#9;&#9;&#9;field role type select options [&quot;admin&quot;, &quot;user&quot;, &quot;guest&quot;] default &quot;user&quot;&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Components: []Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;name&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;text&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Label: stringPtr(&quot;Full Name&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Placeholder: stringPtr(&quot;Enter your name&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Required: true},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;email&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;email&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Label: stringPtr(&quot;Email Address&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Required: true},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;bio&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;textarea&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Rows: intPtr(5)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Placeholder: stringPtr(&quot;Tell us about yourself&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;avatar&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;file&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Accept: stringPtr(&quot;image/*&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;role&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;select&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Options: []string{&quot;admin&quot;, &quot;user&quot;, &quot;guest&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Default: stringPtr(&quot;user&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;component with field attributes and validation&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component form for Product {&#10;&#9;&#9;&#9;&#9;&#9;field name type text required validate min_length &quot;3&quot;&#10;&#9;&#9;&#9;&#9;&#9;field price type number format &quot;currency&quot; validate min &quot;0&quot;&#10;&#9;&#9;&#9;&#9;&#9;field category type autocomplete relates to Category&#10;&#9;&#9;&#9;&#9;&#9;field tags type multiselect source &quot;tags/popular&quot;&#10;&#9;&#9;&#9;&#9;&#9;field description type richtext&#10;&#9;&#9;&#9;&#9;&#9;field featured type checkbox default &quot;false&quot;&#10;&#9;&#9;&#9;&#9;&#9;field thumbnail type image thumbnail&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Components: []Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;Product&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;name&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;text&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Required: true},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Validation: &amp;ComponentValidation{Type: &quot;min_length&quot;, Value: stringPtr(&quot;3&quot;)}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;price&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;number&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Format: stringPtr(&quot;currency&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Validation: &amp;ComponentValidation{Type: &quot;min&quot;, Value: stringPtr(&quot;0&quot;)}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;category&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;autocomplete&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Relates: &amp;FieldRelation{Type: &quot;Category&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;tags&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;multiselect&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Source: stringPtr(&quot;tags/popular&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;description&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;richtext&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;featured&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;checkbox&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Default: stringPtr(&quot;false&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;thumbnail&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;image&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Thumbnail: true},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;component with buttons&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component form for User {&#10;&#9;&#9;&#9;&#9;&#9;field name type text&#10;&#9;&#9;&#9;&#9;&#9;button save label &quot;Save User&quot; style &quot;primary&quot; icon &quot;save&quot;&#10;&#9;&#9;&#9;&#9;&#9;button cancel label &quot;Cancel&quot; style &quot;secondary&quot; &#10;&#9;&#9;&#9;&#9;&#9;button delete label &quot;Delete&quot; style &quot;danger&quot; confirm &quot;Are you sure?&quot; disabled when is_protected&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Components: []Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;name&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;text&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Button: &amp;ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;save&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Save User&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;primary&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Icon: &amp;ComponentButtonIcon{Value: &quot;save&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Button: &amp;ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;cancel&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Cancel&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;secondary&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Button: &amp;ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;delete&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Delete&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;danger&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Confirm: &amp;ComponentButtonConfirm{Value: &quot;Are you sure?&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Disabled: &amp;ComponentButtonDisabled{Value: &quot;is_protected&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;component with conditional fields&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component form for User {&#10;&#9;&#9;&#9;&#9;&#9;field account_type type select options [&quot;personal&quot;, &quot;business&quot;]&#10;&#9;&#9;&#9;&#9;&#9;when account_type equals &quot;business&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;field company_name type text required&#10;&#9;&#9;&#9;&#9;&#9;&#9;field tax_id type text&#10;&#9;&#9;&#9;&#9;&#9;&#9;button verify_business label &quot;Verify Business&quot;&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;when account_type equals &quot;personal&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;field date_of_birth type date&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Components: []Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;account_type&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;select&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Options: []string{&quot;personal&quot;, &quot;business&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;When: &amp;WhenCondition{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &quot;account_type&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Operator: &quot;equals&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Value: &quot;business&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Fields: []ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;company_name&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;text&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Required: true},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;tax_id&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;text&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Buttons: []ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;verify_business&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Verify Business&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;When: &amp;WhenCondition{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &quot;account_type&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Operator: &quot;equals&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Value: &quot;personal&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Fields: []ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;date_of_birth&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;date&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;component with nested sections&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component dashboard {&#10;&#9;&#9;&#9;&#9;&#9;section stats type container class &quot;stats-grid&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;component metric {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;field total_users type display value &quot;1,234&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;field revenue type display format &quot;currency&quot; value &quot;45,678&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;section charts type container {&#10;&#9;&#9;&#9;&#9;&#9;&#9;component chart for Analytics {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;data from &quot;analytics/monthly&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Components: []Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;dashboard&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;stats&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Class: stringPtr(&quot;stats-grid&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;metric&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;total_users&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;display&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Value: stringPtr(&quot;1,234&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;revenue&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;display&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Format: stringPtr(&quot;currency&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Value: stringPtr(&quot;45,678&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;charts&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;chart&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;Analytics&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attribute: &amp;ComponentAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;DataSource: stringPtr(&quot;analytics/monthly&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;}&#10;&#10;&#9;for _, tt := range tests {&#10;&#9;&#9;t.Run(tt.name, func(t *testing.T) {&#10;&#9;&#9;&#9;got, err := ParseInput(tt.input)&#10;&#9;&#9;&#9;if (err != nil) != tt.wantErr {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() error = %v, wantErr %v&quot;, err, tt.wantErr)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;if !astEqual(got, tt.want) {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() got = %v, want %v&quot;, got, tt.want)&#10;&#9;&#9;&#9;}&#10;&#9;&#9;})&#10;&#9;}&#10;}&#10;&#10;func TestParseComponentFieldTypes(t *testing.T) {&#10;&#9;fieldTypes := []string{&#10;&#9;&#9;&quot;text&quot;, &quot;email&quot;, &quot;password&quot;, &quot;number&quot;, &quot;date&quot;, &quot;datetime&quot;, &quot;time&quot;,&#10;&#9;&#9;&quot;textarea&quot;, &quot;richtext&quot;, &quot;select&quot;, &quot;multiselect&quot;, &quot;checkbox&quot;, &quot;radio&quot;,&#10;&#9;&#9;&quot;file&quot;, &quot;image&quot;, &quot;autocomplete&quot;, &quot;range&quot;, &quot;color&quot;, &quot;url&quot;, &quot;tel&quot;,&#10;&#9;&#9;&quot;hidden&quot;, &quot;display&quot;, &quot;json&quot;, &quot;code&quot;,&#10;&#9;}&#10;&#10;&#9;for _, fieldType := range fieldTypes {&#10;&#9;&#9;t.Run(&quot;field_type_&quot;+fieldType, func(t *testing.T) {&#10;&#9;&#9;&#9;input := `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component form {&#10;&#9;&#9;&#9;&#9;&#9;field test_field type ` + fieldType + `&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`&#10;&#10;&#9;&#9;&#9;got, err := ParseInput(input)&#10;&#9;&#9;&#9;if err != nil {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() failed for field type %s: %v&quot;, fieldType, err)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;if len(got.Definitions) != 1 || got.Definitions[0].Page == nil {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() failed to parse page for field type %s&quot;, fieldType)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;page := got.Definitions[0].Page&#10;&#9;&#9;&#9;if len(page.Components) != 1 || len(page.Components[0].Elements) != 1 {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() failed to parse component for field type %s&quot;, fieldType)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;element := page.Components[0].Elements[0]&#10;&#9;&#9;&#9;if element.Field == nil || element.Field.Type != fieldType {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() field type mismatch: got %v, want %s&quot;, element.Field, fieldType)&#10;&#9;&#9;&#9;}&#10;&#9;&#9;})&#10;&#9;}&#10;}&#10;&#10;func TestParseComponentErrors(t *testing.T) {&#10;&#9;tests := []struct {&#10;&#9;&#9;name string&#10;&#9;&#9;input string&#10;&#9;}{&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;missing component type&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;invalid field syntax&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component form {&#10;&#9;&#9;&#9;&#9;&#9;field name&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;invalid button syntax&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;component form {&#10;&#9;&#9;&#9;&#9;&#9;button&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;},&#10;&#9;}&#10;&#10;&#9;for _, tt := range tests {&#10;&#9;&#9;t.Run(tt.name, func(t *testing.T) {&#10;&#9;&#9;&#9;_, err := ParseInput(tt.input)&#10;&#9;&#9;&#9;if err == nil {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() expected error for invalid syntax, got nil&quot;)&#10;&#9;&#9;&#9;}&#10;&#9;&#9;})&#10;&#9;}&#10;}" />
</PendingDiffInfo>
</value>
</entry>
<entry key="$PROJECT_DIR$/lang/parser_ui_page_test.go">
<value>
<PendingDiffInfo>
<option name="filePath" value="$PROJECT_DIR$/lang/parser_ui_page_test.go" />
<option name="originalContent" value="package lang&#10;&#10;import (&#10;&#9;&quot;testing&quot;&#10;)&#10;&#10;func TestParsePageDefinitions(t *testing.T) {&#10;&#9;tests := []struct {&#10;&#9;&#9;name string&#10;&#9;&#9;input string&#10;&#9;&#9;want AST&#10;&#9;&#9;wantErr bool&#10;&#9;}{&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;basic page with minimal fields&quot;,&#10;&#9;&#9;&#9;input: `page Dashboard at &quot;/dashboard&quot; layout main`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Dashboard&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/dashboard&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;page with all optional fields&quot;,&#10;&#9;&#9;&#9;input: `page UserProfile at &quot;/profile&quot; layout main title &quot;User Profile&quot; desc &quot;Manage user profile settings&quot; auth`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;UserProfile&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/profile&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Title: stringPtr(&quot;User Profile&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Description: stringPtr(&quot;Manage user profile settings&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Auth: true,&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;page with meta tags&quot;,&#10;&#9;&#9;&#9;input: `page HomePage at &quot;/&quot; layout main {&#10;&#9;&#9;&#9;&#9;meta description &quot;Welcome to our application&quot;&#10;&#9;&#9;&#9;&#9;meta keywords &quot;app, dashboard, management&quot;&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;HomePage&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Meta: []MetaTag{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Name: &quot;description&quot;, Content: &quot;Welcome to our application&quot;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Name: &quot;keywords&quot;, Content: &quot;app, dashboard, management&quot;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;page with sections and components&quot;,&#10;&#9;&#9;&#9;input: `page UserManagement at &quot;/users&quot; layout admin auth {&#10;&#9;&#9;&#9;&#9;section header type container {&#10;&#9;&#9;&#9;&#9;&#9;component form for User {&#10;&#9;&#9;&#9;&#9;&#9;&#9;field name type text required&#10;&#9;&#9;&#9;&#9;&#9;&#9;field email type email required&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;section content type container {&#10;&#9;&#9;&#9;&#9;&#9;component table for User {&#10;&#9;&#9;&#9;&#9;&#9;&#9;data from &quot;users&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;fields [&quot;name&quot;, &quot;email&quot;, &quot;created_at&quot;]&#10;&#9;&#9;&#9;&#9;&#9;&#9;actions [&quot;edit&quot;, &quot;delete&quot;]&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;UserManagement&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/users&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;admin&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Auth: true,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sections: []Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;header&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;name&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;text&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Required: true},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;email&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;email&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Required: true},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;content&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;table&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attribute: &amp;ComponentAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;DataSource: stringPtr(&quot;users&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Fields: []string{&quot;name&quot;, &quot;email&quot;, &quot;created_at&quot;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Actions: []string{&quot;edit&quot;, &quot;delete&quot;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;page with nested sections&quot;,&#10;&#9;&#9;&#9;input: `page Settings at &quot;/settings&quot; layout main {&#10;&#9;&#9;&#9;&#9;section tabs type tab {&#10;&#9;&#9;&#9;&#9;&#9;section profile label &quot;Profile&quot; active {&#10;&#9;&#9;&#9;&#9;&#9;&#9;component form for User {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;field name type text&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;section security label &quot;Security&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;component form for User {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;field password type password&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Settings&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/settings&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sections: []Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;tabs&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;tab&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;profile&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: stringPtr(&quot;Profile&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Active: true,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;name&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;text&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;security&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: stringPtr(&quot;Security&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;password&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;password&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;page with modal and panel sections&quot;,&#10;&#9;&#9;&#9;input: `page ProductList at &quot;/products&quot; layout main {&#10;&#9;&#9;&#9;&#9;section main type container {&#10;&#9;&#9;&#9;&#9;&#9;component table for Product&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;section editModal type modal trigger &quot;edit-product&quot; {&#10;&#9;&#9;&#9;&#9;&#9;component form for Product {&#10;&#9;&#9;&#9;&#9;&#9;&#9;field name type text required&#10;&#9;&#9;&#9;&#9;&#9;&#9;button save label &quot;Save Changes&quot; style &quot;primary&quot;&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;section filters type panel position &quot;left&quot; {&#10;&#9;&#9;&#9;&#9;&#9;component form {&#10;&#9;&#9;&#9;&#9;&#9;&#9;field category type select&#10;&#9;&#9;&#9;&#9;&#9;&#9;field price_range type range&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;ProductList&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/products&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sections: []Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;table&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;Product&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;editModal&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;modal&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Trigger: stringPtr(&quot;edit-product&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;Product&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;name&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;text&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Required: true},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Button: &amp;ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;save&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Save Changes&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;primary&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;filters&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;panel&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Position: stringPtr(&quot;left&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;category&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;select&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;price_range&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;range&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;}&#10;&#10;&#9;for _, tt := range tests {&#10;&#9;&#9;t.Run(tt.name, func(t *testing.T) {&#10;&#9;&#9;&#9;got, err := ParseInput(tt.input)&#10;&#9;&#9;&#9;if (err != nil) != tt.wantErr {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() error = %v, wantErr %v&quot;, err, tt.wantErr)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;if !astEqual(got, tt.want) {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() got = %v, want %v&quot;, got, tt.want)&#10;&#9;&#9;&#9;}&#10;&#9;&#9;})&#10;&#9;}&#10;}&#10;&#10;func TestParsePageErrors(t *testing.T) {&#10;&#9;tests := []struct {&#10;&#9;&#9;name string&#10;&#9;&#9;input string&#10;&#9;}{&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;missing layout&quot;,&#10;&#9;&#9;&#9;input: `page Dashboard at &quot;/dashboard&quot;`,&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;missing path&quot;,&#10;&#9;&#9;&#9;input: `page Dashboard layout main`,&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;invalid path format&quot;,&#10;&#9;&#9;&#9;input: `page Dashboard at dashboard layout main`,&#10;&#9;&#9;},&#10;&#9;}&#10;&#10;&#9;for _, tt := range tests {&#10;&#9;&#9;t.Run(tt.name, func(t *testing.T) {&#10;&#9;&#9;&#9;_, err := ParseInput(tt.input)&#10;&#9;&#9;&#9;if err == nil {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() expected error for invalid syntax, got nil&quot;)&#10;&#9;&#9;&#9;}&#10;&#9;&#9;})&#10;&#9;}&#10;}&#10;" />
<option name="updatedContent" value="package lang&#10;&#10;import (&#10;&#9;&quot;testing&quot;&#10;)&#10;&#10;func TestParsePageDefinitions(t *testing.T) {&#10;&#9;tests := []struct {&#10;&#9;&#9;name string&#10;&#9;&#9;input string&#10;&#9;&#9;want AST&#10;&#9;&#9;wantErr bool&#10;&#9;}{&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;basic page with minimal fields&quot;,&#10;&#9;&#9;&#9;input: `page Dashboard at &quot;/dashboard&quot; layout main`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Dashboard&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/dashboard&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;page with all optional fields&quot;,&#10;&#9;&#9;&#9;input: `page UserProfile at &quot;/profile&quot; layout main title &quot;User Profile&quot; desc &quot;Manage user profile settings&quot; auth`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;UserProfile&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/profile&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Title: stringPtr(&quot;User Profile&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Description: stringPtr(&quot;Manage user profile settings&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Auth: true,&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;page with meta tags&quot;,&#10;&#9;&#9;&#9;input: `page HomePage at &quot;/&quot; layout main {&#10;&#9;&#9;&#9;&#9;meta description &quot;Welcome to our application&quot;&#10;&#9;&#9;&#9;&#9;meta keywords &quot;app, dashboard, management&quot;&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;HomePage&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Meta: []MetaTag{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Name: &quot;description&quot;, Content: &quot;Welcome to our application&quot;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Name: &quot;keywords&quot;, Content: &quot;app, dashboard, management&quot;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;page with nested sections&quot;,&#10;&#9;&#9;&#9;input: `page Settings at &quot;/settings&quot; layout main {&#10;&#9;&#9;&#9;&#9;section tabs type tab {&#10;&#9;&#9;&#9;&#9;&#9;section profile label &quot;Profile&quot; active {&#10;&#9;&#9;&#9;&#9;&#9;&#9;component form for User {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;field name type text&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;section security label &quot;Security&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;component form for User {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;field password type password&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Settings&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/settings&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sections: []Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;tabs&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;tab&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;profile&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: stringPtr(&quot;Profile&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Active: true,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;name&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;text&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;security&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: stringPtr(&quot;Security&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;password&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;password&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;page with modal and panel sections&quot;,&#10;&#9;&#9;&#9;input: `page ProductList at &quot;/products&quot; layout main {&#10;&#9;&#9;&#9;&#9;section main type container {&#10;&#9;&#9;&#9;&#9;&#9;component table for Product&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;section editModal type modal trigger &quot;edit-product&quot; {&#10;&#9;&#9;&#9;&#9;&#9;component form for Product {&#10;&#9;&#9;&#9;&#9;&#9;&#9;field name type text required&#10;&#9;&#9;&#9;&#9;&#9;&#9;button save label &quot;Save Changes&quot; style &quot;primary&quot;&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;section filters type panel position &quot;left&quot; {&#10;&#9;&#9;&#9;&#9;&#9;component form {&#10;&#9;&#9;&#9;&#9;&#9;&#9;field category type select&#10;&#9;&#9;&#9;&#9;&#9;&#9;field price_range type range&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;ProductList&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/products&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sections: []Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;table&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;Product&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;editModal&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;modal&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Trigger: stringPtr(&quot;edit-product&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;Product&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;name&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;text&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Required: true},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Button: &amp;ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;save&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Save Changes&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;primary&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;filters&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;panel&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Position: stringPtr(&quot;left&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;category&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;select&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;price_range&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;range&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;}&#10;&#10;&#9;for _, tt := range tests {&#10;&#9;&#9;t.Run(tt.name, func(t *testing.T) {&#10;&#9;&#9;&#9;got, err := ParseInput(tt.input)&#10;&#9;&#9;&#9;if (err != nil) != tt.wantErr {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() error = %v, wantErr %v&quot;, err, tt.wantErr)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;if !astEqual(got, tt.want) {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() got = %v, want %v&quot;, got, tt.want)&#10;&#9;&#9;&#9;}&#10;&#9;&#9;})&#10;&#9;}&#10;}&#10;&#10;func TestParsePageErrors(t *testing.T) {&#10;&#9;tests := []struct {&#10;&#9;&#9;name string&#10;&#9;&#9;input string&#10;&#9;}{&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;missing layout&quot;,&#10;&#9;&#9;&#9;input: `page Dashboard at &quot;/dashboard&quot;`,&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;missing path&quot;,&#10;&#9;&#9;&#9;input: `page Dashboard layout main`,&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;invalid path format&quot;,&#10;&#9;&#9;&#9;input: `page Dashboard at dashboard layout main`,&#10;&#9;&#9;},&#10;&#9;}&#10;&#10;&#9;for _, tt := range tests {&#10;&#9;&#9;t.Run(tt.name, func(t *testing.T) {&#10;&#9;&#9;&#9;_, err := ParseInput(tt.input)&#10;&#9;&#9;&#9;if err == nil {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() expected error for invalid syntax, got nil&quot;)&#10;&#9;&#9;&#9;}&#10;&#9;&#9;})&#10;&#9;}&#10;}" />
</PendingDiffInfo>
</value>
</entry>
<entry key="$PROJECT_DIR$/lang/parser_ui_section_test.go">
<value>
<PendingDiffInfo>
<option name="filePath" value="$PROJECT_DIR$/lang/parser_ui_section_test.go" />
<option name="originalContent" value="package lang&#10;&#10;import (&#10;&#9;&quot;testing&quot;&#10;)&#10;&#10;func TestParseSectionDefinitions(t *testing.T) {&#10;&#9;tests := []struct {&#10;&#9;&#9;name string&#10;&#9;&#9;input string&#10;&#9;&#9;want AST&#10;&#9;&#9;wantErr bool&#10;&#9;}{&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;basic container section&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;section main type container&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sections: []Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;section with all attributes&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;section sidebar type panel position &quot;left&quot; class &quot;sidebar-nav&quot; label &quot;Navigation&quot; trigger &quot;toggle-sidebar&quot; for User&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sections: []Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;sidebar&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;panel&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Position: stringPtr(&quot;left&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Class: stringPtr(&quot;sidebar-nav&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: stringPtr(&quot;Navigation&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Trigger: stringPtr(&quot;toggle-sidebar&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;tab sections with active state&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;section tabs type tab {&#10;&#9;&#9;&#9;&#9;&#9;section overview label &quot;Overview&quot; active&#10;&#9;&#9;&#9;&#9;&#9;section details label &quot;Details&quot;&#10;&#9;&#9;&#9;&#9;&#9;section settings label &quot;Settings&quot;&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sections: []Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;tabs&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;tab&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;overview&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: stringPtr(&quot;Overview&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Active: true,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;details&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: stringPtr(&quot;Details&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;settings&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: stringPtr(&quot;Settings&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;modal section with content&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;section userModal type modal trigger &quot;edit-user&quot; {&#10;&#9;&#9;&#9;&#9;&#9;component form for User {&#10;&#9;&#9;&#9;&#9;&#9;&#9;field name type text required&#10;&#9;&#9;&#9;&#9;&#9;&#9;field email type email required&#10;&#9;&#9;&#9;&#9;&#9;&#9;button save label &quot;Save Changes&quot; style &quot;primary&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;button cancel label &quot;Cancel&quot; style &quot;secondary&quot;&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sections: []Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;userModal&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;modal&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Trigger: stringPtr(&quot;edit-user&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;name&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;text&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Required: true},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;email&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;email&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Required: true},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Button: &amp;ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;save&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Save Changes&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;primary&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Button: &amp;ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;cancel&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Cancel&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;secondary&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;master-detail sections&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;section masterDetail type master {&#10;&#9;&#9;&#9;&#9;&#9;section userList type container {&#10;&#9;&#9;&#9;&#9;&#9;&#9;component table for User {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fields [&quot;name&quot;, &quot;email&quot;]&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;section userDetail type detail trigger &quot;user-selected&quot; for User {&#10;&#9;&#9;&#9;&#9;&#9;&#9;component form for User {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;field name type text&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;field email type email&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;field bio type textarea&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sections: []Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;masterDetail&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;master&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;userList&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;table&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attribute: &amp;ComponentAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Fields: []string{&quot;name&quot;, &quot;email&quot;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;userDetail&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;detail&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Trigger: stringPtr(&quot;user-selected&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;name&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;text&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;email&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;email&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;bio&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;textarea&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;section with attributes and nested components&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;section dashboard type container {&#10;&#9;&#9;&#9;&#9;&#9;data from &quot;dashboard/stats&quot;&#10;&#9;&#9;&#9;&#9;&#9;style &quot;dashboard-grid&quot;&#10;&#9;&#9;&#9;&#9;&#9;classes &quot;bg-gray-100 p-4&quot;&#10;&#9;&#9;&#9;&#9;&#9;size 12&#10;&#9;&#9;&#9;&#9;&#9;theme &quot;dark&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;component metric {&#10;&#9;&#9;&#9;&#9;&#9;&#9;field users type display&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;component chart for Analytics&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sections: []Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;dashboard&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attribute: &amp;SectionAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;DataSource: stringPtr(&quot;dashboard/stats&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Style: stringPtr(&quot;dashboard-grid&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Classes: stringPtr(&quot;bg-gray-100 p-4&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Size: intPtr(12),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Theme: stringPtr(&quot;dark&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;metric&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;users&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;display&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;chart&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;Analytics&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;deeply nested sections&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;section mainLayout type container {&#10;&#9;&#9;&#9;&#9;&#9;section header type container class &quot;header&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;component navbar {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;field search type text placeholder &quot;Search...&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;section content type container {&#10;&#9;&#9;&#9;&#9;&#9;&#9;section sidebar type panel position &quot;left&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;component menu {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;field navigation type list&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;&#9;section main type container {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;section tabs type tab {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;section overview label &quot;Overview&quot; active {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;component dashboard {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;field stats type metric&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;section reports label &quot;Reports&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;component table for Report&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sections: []Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;mainLayout&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;header&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Class: stringPtr(&quot;header&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;navbar&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;search&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;text&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Placeholder: stringPtr(&quot;Search...&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;content&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;sidebar&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;panel&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Position: stringPtr(&quot;left&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;menu&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;navigation&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;list&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;tabs&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;tab&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;overview&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: stringPtr(&quot;Overview&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Active: true,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;dashboard&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;stats&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;metric&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;reports&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: stringPtr(&quot;Reports&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;table&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;Report&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;section with conditional content&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;section adminPanel type container {&#10;&#9;&#9;&#9;&#9;&#9;when user_role equals &quot;admin&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;section userManagement type container {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;component table for User&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;section systemSettings type container {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;component form for Settings&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sections: []Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;adminPanel&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;When: &amp;WhenCondition{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &quot;user_role&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Operator: &quot;equals&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Value: &quot;admin&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sections: []Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;userManagement&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;table&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;systemSettings&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;Settings&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;}&#10;&#10;&#9;for _, tt := range tests {&#10;&#9;&#9;t.Run(tt.name, func(t *testing.T) {&#10;&#9;&#9;&#9;got, err := ParseInput(tt.input)&#10;&#9;&#9;&#9;if (err != nil) != tt.wantErr {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() error = %v, wantErr %v&quot;, err, tt.wantErr)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;if !astEqual(got, tt.want) {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() got = %v, want %v&quot;, got, tt.want)&#10;&#9;&#9;&#9;}&#10;&#9;&#9;})&#10;&#9;}&#10;}&#10;&#10;func TestParseSectionTypes(t *testing.T) {&#10;&#9;sectionTypes := []string{&#10;&#9;&#9;&quot;container&quot;, &quot;tab&quot;, &quot;panel&quot;, &quot;modal&quot;, &quot;master&quot;, &quot;detail&quot;,&#10;&#9;}&#10;&#10;&#9;for _, sectionType := range sectionTypes {&#10;&#9;&#9;t.Run(&quot;section_type_&quot;+sectionType, func(t *testing.T) {&#10;&#9;&#9;&#9;input := `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;section test_section type ` + sectionType + `&#10;&#9;&#9;&#9;}`&#10;&#10;&#9;&#9;&#9;got, err := ParseInput(input)&#10;&#9;&#9;&#9;if err != nil {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() failed for section type %s: %v&quot;, sectionType, err)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;if len(got.Definitions) != 1 || got.Definitions[0].Page == nil {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() failed to parse page for section type %s&quot;, sectionType)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;page := got.Definitions[0].Page&#10;&#9;&#9;&#9;if len(page.Sections) != 1 {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() failed to parse section for type %s&quot;, sectionType)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;section := page.Sections[0]&#10;&#9;&#9;&#9;if section.Type == nil || *section.Type != sectionType {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() section type mismatch: got %v, want %s&quot;, section.Type, sectionType)&#10;&#9;&#9;&#9;}&#10;&#9;&#9;})&#10;&#9;}&#10;}&#10;&#10;func TestParseSectionErrors(t *testing.T) {&#10;&#9;tests := []struct {&#10;&#9;&#9;name string&#10;&#9;&#9;input string&#10;&#9;}{&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;missing section name&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;section type container&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;invalid section type&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;section test type invalid_type&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;unclosed section block&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;section test type container {&#10;&#9;&#9;&#9;&#9;&#9;component form&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;},&#10;&#9;}&#10;&#10;&#9;for _, tt := range tests {&#10;&#9;&#9;t.Run(tt.name, func(t *testing.T) {&#10;&#9;&#9;&#9;_, err := ParseInput(tt.input)&#10;&#9;&#9;&#9;if err == nil {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() expected error for invalid syntax, got nil&quot;)&#10;&#9;&#9;&#9;}&#10;&#9;&#9;})&#10;&#9;}&#10;}&#10;" />
<option name="updatedContent" value="package lang&#10;&#10;import (&#10;&#9;&quot;testing&quot;&#10;)&#10;&#10;func TestParseSectionDefinitions(t *testing.T) {&#10;&#9;tests := []struct {&#10;&#9;&#9;name string&#10;&#9;&#9;input string&#10;&#9;&#9;want AST&#10;&#9;&#9;wantErr bool&#10;&#9;}{&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;basic container section&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;section main type container&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sections: []Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;section with all attributes&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;section sidebar type panel class &quot;sidebar-nav&quot; label &quot;Navigation&quot; trigger &quot;toggle-sidebar&quot; position &quot;left&quot; for User&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sections: []Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;sidebar&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;panel&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Position: stringPtr(&quot;left&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Class: stringPtr(&quot;sidebar-nav&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: stringPtr(&quot;Navigation&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Trigger: stringPtr(&quot;toggle-sidebar&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;tab sections with active state&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;section tabs type tab {&#10;&#9;&#9;&#9;&#9;&#9;section overview label &quot;Overview&quot; active&#10;&#9;&#9;&#9;&#9;&#9;section details label &quot;Details&quot;&#10;&#9;&#9;&#9;&#9;&#9;section settings label &quot;Settings&quot;&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sections: []Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;tabs&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;tab&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;overview&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: stringPtr(&quot;Overview&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Active: true,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;details&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: stringPtr(&quot;Details&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;settings&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: stringPtr(&quot;Settings&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;modal section with content&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;section userModal type modal trigger &quot;edit-user&quot; {&#10;&#9;&#9;&#9;&#9;&#9;component form for User {&#10;&#9;&#9;&#9;&#9;&#9;&#9;field name type text required&#10;&#9;&#9;&#9;&#9;&#9;&#9;field email type email required&#10;&#9;&#9;&#9;&#9;&#9;&#9;button save label &quot;Save Changes&quot; style &quot;primary&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;button cancel label &quot;Cancel&quot; style &quot;secondary&quot;&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sections: []Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;userModal&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;modal&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Trigger: stringPtr(&quot;edit-user&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;name&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;text&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Required: true},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;email&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;email&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Required: true},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Button: &amp;ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;save&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Save Changes&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;primary&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Button: &amp;ComponentButton{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;cancel&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: &quot;Cancel&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentButtonAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Style: &amp;ComponentButtonStyle{Value: &quot;secondary&quot;}},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;master-detail sections&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;section masterDetail type master {&#10;&#9;&#9;&#9;&#9;&#9;section userList type container {&#10;&#9;&#9;&#9;&#9;&#9;&#9;component table for User {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fields [name, email]&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;section userDetail type detail trigger &quot;user-selected&quot; for User {&#10;&#9;&#9;&#9;&#9;&#9;&#9;component form for User {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;field name type text&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;field email type email&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;field bio type textarea&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sections: []Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;masterDetail&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;master&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;userList&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;table&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attribute: &amp;ComponentAttr{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Fields: []string{&quot;name&quot;, &quot;email&quot;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;userDetail&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;detail&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Trigger: stringPtr(&quot;user-selected&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;name&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;text&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;email&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;email&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;bio&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;textarea&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;deeply nested sections&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;section mainLayout type container {&#10;&#9;&#9;&#9;&#9;&#9;section header type container class &quot;header&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;component navbar {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;field search type text placeholder &quot;Search...&quot;&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;section content type container {&#10;&#9;&#9;&#9;&#9;&#9;&#9;section sidebar type panel position &quot;left&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;component menu {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;field navigation type list&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;&#9;section main type container {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;section tabs type tab {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;section overview label &quot;Overview&quot; active {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;component dashboard {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;field stats type metric&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;section reports label &quot;Reports&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;component table for Report&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sections: []Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;mainLayout&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;header&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Class: stringPtr(&quot;header&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;navbar&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;search&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;text&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Attributes: []ComponentFieldAttribute{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{Placeholder: stringPtr(&quot;Search...&quot;)},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;content&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;sidebar&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;panel&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Position: stringPtr(&quot;left&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;menu&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;navigation&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;list&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;tabs&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;tab&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;overview&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: stringPtr(&quot;Overview&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Active: true,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;dashboard&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []ComponentElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &amp;ComponentField{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;stats&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;metric&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Section: &amp;Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;reports&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label: stringPtr(&quot;Reports&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;table&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;Report&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;section with conditional content&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;section adminPanel type container {&#10;&#9;&#9;&#9;&#9;&#9;when user_role equals &quot;admin&quot; {&#10;&#9;&#9;&#9;&#9;&#9;&#9;section userManagement type container {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;component table for User&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;&#9;section systemSettings type container {&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;component form for Settings&#10;&#9;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;&#9;want: AST{&#10;&#9;&#9;&#9;&#9;Definitions: []Definition{&#10;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;Page: &amp;Page{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;Test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Path: &quot;/test&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Layout: &quot;main&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sections: []Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;adminPanel&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;When: &amp;WhenCondition{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Field: &quot;user_role&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Operator: &quot;equals&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Value: &quot;admin&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sections: []Section{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;userManagement&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;table&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;User&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Name: &quot;systemSettings&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: stringPtr(&quot;container&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Elements: []SectionElement{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Component: &amp;Component{&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Type: &quot;form&quot;,&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Entity: stringPtr(&quot;Settings&quot;),&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;&#9;},&#10;&#9;&#9;&#9;},&#10;&#9;&#9;},&#10;&#9;}&#10;&#10;&#9;for _, tt := range tests {&#10;&#9;&#9;t.Run(tt.name, func(t *testing.T) {&#10;&#9;&#9;&#9;got, err := ParseInput(tt.input)&#10;&#9;&#9;&#9;if (err != nil) != tt.wantErr {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() error = %v, wantErr %v&quot;, err, tt.wantErr)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#9;&#9;&#9;if !astEqual(got, tt.want) {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() got = %v, want %v&quot;, got, tt.want)&#10;&#9;&#9;&#9;}&#10;&#9;&#9;})&#10;&#9;}&#10;}&#10;&#10;func TestParseSectionTypes(t *testing.T) {&#10;&#9;sectionTypes := []string{&#10;&#9;&#9;&quot;container&quot;, &quot;tab&quot;, &quot;panel&quot;, &quot;modal&quot;, &quot;master&quot;, &quot;detail&quot;,&#10;&#9;}&#10;&#10;&#9;for _, sectionType := range sectionTypes {&#10;&#9;&#9;t.Run(&quot;section_type_&quot;+sectionType, func(t *testing.T) {&#10;&#9;&#9;&#9;input := `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;section test_section type ` + sectionType + `&#10;&#9;&#9;&#9;}`&#10;&#10;&#9;&#9;&#9;got, err := ParseInput(input)&#10;&#9;&#9;&#9;if err != nil {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() failed for section type %s: %v&quot;, sectionType, err)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;if len(got.Definitions) != 1 || got.Definitions[0].Page == nil {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() failed to parse page for section type %s&quot;, sectionType)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;page := got.Definitions[0].Page&#10;&#9;&#9;&#9;if len(page.Sections) != 1 {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() failed to parse section for type %s&quot;, sectionType)&#10;&#9;&#9;&#9;&#9;return&#10;&#9;&#9;&#9;}&#10;&#10;&#9;&#9;&#9;section := page.Sections[0]&#10;&#9;&#9;&#9;if section.Type == nil || *section.Type != sectionType {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() section type mismatch: got %v, want %s&quot;, section.Type, sectionType)&#10;&#9;&#9;&#9;}&#10;&#9;&#9;})&#10;&#9;}&#10;}&#10;&#10;func TestParseSectionErrors(t *testing.T) {&#10;&#9;tests := []struct {&#10;&#9;&#9;name string&#10;&#9;&#9;input string&#10;&#9;}{&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;missing section name&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;section type container&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;invalid section type&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;section test type invalid_type&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;},&#10;&#9;&#9;{&#10;&#9;&#9;&#9;name: &quot;unclosed section block&quot;,&#10;&#9;&#9;&#9;input: `page Test at &quot;/test&quot; layout main {&#10;&#9;&#9;&#9;&#9;section test type container {&#10;&#9;&#9;&#9;&#9;&#9;component form&#10;&#9;&#9;&#9;}`,&#10;&#9;&#9;},&#10;&#9;}&#10;&#10;&#9;for _, tt := range tests {&#10;&#9;&#9;t.Run(tt.name, func(t *testing.T) {&#10;&#9;&#9;&#9;_, err := ParseInput(tt.input)&#10;&#9;&#9;&#9;if err == nil {&#10;&#9;&#9;&#9;&#9;t.Errorf(&quot;ParseInput() expected error for invalid syntax, got nil&quot;)&#10;&#9;&#9;&#9;}&#10;&#9;&#9;})&#10;&#9;}&#10;}" />
</PendingDiffInfo>
</value>
</entry>
<entry key="$PROJECT_DIR$/lang/simplified_lang.go">
<value>
<PendingDiffInfo>
<option name="filePath" value="$PROJECT_DIR$/lang/simplified_lang.go" />
<option name="updatedContent" value="package lang&#10;&#10;// Simplified DSL structure proposal&#10;// This reduces complexity while maintaining power and flexibility&#10;&#10;import (&#10;&#9;&quot;github.com/alecthomas/participle/v2&quot;&#10;)&#10;&#10;// Root AST node containing all definitions&#10;type SimplifiedAST struct {&#10;&#9;Definitions []Definition `parser:&quot;@@*&quot;`&#10;}&#10;&#10;// Enhanced Page definitions with unified section model&#10;type SimplifiedPage struct {&#10;&#9;Name string `parser:&quot;'page' @Ident&quot;`&#10;&#9;Path string `parser:&quot;'at' @String&quot;`&#10;&#9;Layout string `parser:&quot;'layout' @Ident&quot;`&#10;&#9;Title *string `parser:&quot;('title' @String)?&quot;`&#10;&#9;Description *string `parser:&quot;('desc' @String)?&quot;`&#10;&#9;Auth bool `parser:&quot;@'auth'?&quot;`&#10;&#9;Meta []MetaTag `parser:&quot;@@*&quot;`&#10;&#9;Sections []Section `parser:&quot;@@*&quot;` // Unified sections&#10;&#9;Components []Component `parser:&quot;@@*&quot;` // Direct components&#10;}&#10;&#10;// Unified Section type that replaces Container, Tab, Panel, Modal, MasterDetail&#10;type Section struct {&#10;&#9;Name string `parser:&quot;'section' @Ident&quot;`&#10;&#9;Type *string `parser:&quot;('type' @('container' | 'tab' | 'panel' | 'modal' | 'master' | 'detail'))?&quot;`&#10;&#9;Class *string `parser:&quot;('class' @String)?&quot;`&#10;&#9;Label *string `parser:&quot;('label' @String)?&quot;` // for tabs&#10;&#9;Active bool `parser:&quot;@'active'?&quot;` // for tabs &#10;&#9;Trigger *string `parser:&quot;('trigger' @String)?&quot;` // for panels/modals/detail&#10;&#9;Position *string `parser:&quot;('position' @String)?&quot;` // for panels&#10;&#9;Entity *string `parser:&quot;('for' @Ident)?&quot;` // for panels&#10;&#9;Attributes []SectionAttribute `parser:&quot;@@*&quot;` // Flexible attributes&#10;&#9;Components []Component `parser:&quot;@@*&quot;`&#10;&#9;Sections []Section `parser:&quot;@@*&quot;` // Recursive support&#10;&#9;When []WhenCondition `parser:&quot;@@*&quot;` // Conditional sections&#10;}&#10;&#10;// Flexible section attributes (similar to field attributes)&#10;type SectionAttribute struct {&#10;&#9;DataSource *string `parser:&quot;('data' 'from' @String)&quot;`&#10;&#9;Style *string `parser:&quot;| ('style' @String)&quot;`&#10;&#9;Classes *string `parser:&quot;| ('classes' @String)&quot;`&#10;&#9;Size *int `parser:&quot;| ('size' @Int)&quot;` // for pagination, etc.&#10;&#9;Theme *string `parser:&quot;| ('theme' @String)&quot;`&#10;}&#10;&#10;// Simplified Component with unified element model&#10;type Component struct {&#10;&#9;Type string `parser:&quot;'component' @Ident&quot;`&#10;&#9;Entity *string `parser:&quot;('for' @Ident)?&quot;`&#10;&#9;Attributes []ComponentAttr `parser:&quot;@@*&quot;` // Simplified attributes&#10;&#9;Elements []ComponentElement `parser:&quot;@@*&quot;`&#10;}&#10;&#10;// Simplified component attributes using key-value pattern&#10;type ComponentAttr struct {&#10;&#9;DataSource *string `parser:&quot;('data' 'from' @String)&quot;`&#10;&#9;Fields []string `parser:&quot;| ('fields' '[' @Ident (',' @Ident)* ']')&quot;`&#10;&#9;Style *string `parser:&quot;| ('style' @String)&quot;`&#10;&#9;Classes *string `parser:&quot;| ('classes' @String)&quot;`&#10;&#9;PageSize *int `parser:&quot;| ('pagination' 'size' @Int)&quot;`&#10;&#9;Validate bool `parser:&quot;| @'validate'&quot;`&#10;}&#10;&#10;// Enhanced ComponentElement with recursive section support&#10;type ComponentElement struct {&#10;&#9;Field *ComponentField `parser:&quot;@@&quot;`&#10;&#9;Section *Section `parser:&quot;| @@&quot;` // Sections can be nested in components&#10;&#9;Button *ComponentButton `parser:&quot;| @@&quot;`&#10;&#9;When *WhenCondition `parser:&quot;| @@&quot;`&#10;}&#10;&#10;// Enhanced WhenCondition with recursive support for both sections and components&#10;type WhenCondition struct {&#10;&#9;Field string `parser:&quot;'when' @Ident&quot;`&#10;&#9;Operator string `parser:&quot;@('equals' | 'not_equals' | 'contains')&quot;`&#10;&#9;Value string `parser:&quot;@String&quot;`&#10;&#9;Fields []ComponentField `parser:&quot;@@*&quot;`&#10;&#9;Sections []Section `parser:&quot;@@*&quot;` // Can contain sections&#10;&#9;Components []Component `parser:&quot;@@*&quot;` // Can contain components &#10;&#9;Buttons []ComponentButton `parser:&quot;@@*&quot;`&#10;}&#10;&#10;// Simplified button (renamed from ComponentButtonAttr for clarity)&#10;type ComponentButton struct {&#10;&#9;Name string `parser:&quot;'button' @Ident&quot;`&#10;&#9;Label string `parser:&quot;'label' @String&quot;`&#10;&#9;Style *string `parser:&quot;('style' @String)?&quot;`&#10;&#9;Icon *string `parser:&quot;('icon' @String)?&quot;`&#10;&#9;Loading *string `parser:&quot;('loading' @String)?&quot;`&#10;&#9;Disabled *string `parser:&quot;('disabled' 'when' @Ident)?&quot;`&#10;&#9;Confirm *string `parser:&quot;('confirm' @String)?&quot;`&#10;&#9;Target *string `parser:&quot;('target' @Ident)?&quot;`&#10;&#9;Position *string `parser:&quot;('position' @String)?&quot;`&#10;&#9;Via *string `parser:&quot;('via' @String)?&quot;`&#10;}&#10;&#10;// ComponentField remains the same as it's already well-designed&#10;type ComponentField struct {&#10;&#9;Name string `parser:&quot;'field' @Ident&quot;`&#10;&#9;Type string `parser:&quot;'type' @Ident&quot;`&#10;&#9;Attributes []ComponentFieldAttribute `parser:&quot;@@*&quot;`&#10;}&#10;&#10;// Example usage with the simplified structure:&#10;//&#10;// page UserManagement at &quot;/admin/users&quot; layout AdminLayout&#10;// section main type container class &quot;grid grid-cols-3 gap-4&quot;&#10;// section sidebar class &quot;col-span-1&quot;&#10;// component UserStats for User&#10;// data from &quot;/users/stats&quot;&#10;// &#10;// section content class &quot;col-span-2&quot; &#10;// component UserTable for User&#10;// fields [email, name, role]&#10;// data from &quot;/users&quot;&#10;// &#10;// section editPanel type panel trigger &quot;edit&quot; position &quot;slide-right&quot; for User&#10;// component UserForm for User&#10;// field email type text required&#10;// field name type text required&#10;// &#10;// page PostManagement at &quot;/posts&quot; layout AdminLayout&#10;// section master type master&#10;// component PostList for Post&#10;// field title type text sortable&#10;// data from &quot;/posts&quot;&#10;// &#10;// section detail type detail trigger &quot;edit&quot;&#10;// component PostForm for Post&#10;// field title type text required&#10;// field content type richtext required&#10;// &#10;// when status equals &quot;published&quot;&#10;// section publishedOptions&#10;// field featured type toggle&#10;// field priority type number" />
</PendingDiffInfo>
</value>
</entry>
</map>
</option>
</component>
</project>