src/parser.cpp

changeset 358
ef90ed0a5720
parent 335
c5830bce1c23
equal deleted inserted replaced
357:66c75604f5b8 358:ef90ed0a5720
105 }; 105 };
106 } 106 }
107 parsed->content = match.captured(0); 107 parsed->content = match.captured(0);
108 return parsed; 108 return parsed;
109 }; 109 };
110 if (auto line1Match = tryRe(exprs().commentRe)) {
111 LineType0* const parsed = init(LineType0{}, *line1Match);
112 parsed->value = Comment{attrib<Attribute::Text>(*parsed)};
113 }
110 if (auto line1Match = tryRe(exprs().subfileRe)) { 114 if (auto line1Match = tryRe(exprs().subfileRe)) {
111 LineType1* const parsed = init(LineType1{}, *line1Match); 115 LineType1* const parsed = init(LineType1{}, *line1Match);
112 parsed->value = { 116 parsed->value = {
113 SubfileReference{ 117 SubfileReference{
114 .name = attrib<Attribute::Name>(*parsed), 118 .name = attrib<Attribute::Name>(*parsed),
115 .transformation = glm::mat4{ 119 .transformation = glm::mat4{
116 glm::vec4{vectorAttrib<Attribute::X2, Attribute::Y2, Attribute::Z2>(*parsed), 0}, 120 glm::vec4{vectorAttrib<Attribute::X2, Attribute::Y2, Attribute::Z2>(*parsed), 0},
117 glm::vec4{vectorAttrib<Attribute::X3, Attribute::Y3, Attribute::Z3>(*parsed), 0}, 121 glm::vec4{vectorAttrib<Attribute::X3, Attribute::Y3, Attribute::Z3>(*parsed), 0},
118 glm::vec4{vectorAttrib<Attribute::X4, Attribute::Y4, Attribute::Z4>(*parsed), 0}, 122 glm::vec4{vectorAttrib<Attribute::X4, Attribute::Y4, Attribute::Z4>(*parsed), 0},
119 glm::vec4{vectorAttrib<Attribute::X1, Attribute::Y1, Attribute::Z1>(*parsed), 0} 123 glm::vec4{vectorAttrib<Attribute::X1, Attribute::Y1, Attribute::Z1>(*parsed), 1}
120 }, 124 },
121 }, 125 },
122 colorAttrib(parsed), 126 colorAttrib(parsed),
123 }; 127 };
124 } 128 }

mercurial