Skip to content

Commit 3ab7b23

Browse files
authored
Merge branch 'master' into abroooo/fix_dbg_alignment
2 parents ee0a8dd + bb74795 commit 3ab7b23

File tree

49 files changed

+202
-186
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+202
-186
lines changed

compiler/plc_ast/src/ast.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ pub struct CompilationUnit {
417417
pub global_vars: Vec<VariableBlock>,
418418
pub var_config: Vec<ConfigVariable>,
419419
/// List of POU definitions (signature and some additional metadata)
420-
pub units: Vec<Pou>,
420+
pub pous: Vec<Pou>,
421421
/// List of statements within a POU body
422422
pub implementations: Vec<Implementation>,
423423
pub interfaces: Vec<Interface>,
@@ -430,7 +430,7 @@ impl CompilationUnit {
430430
CompilationUnit {
431431
global_vars: Vec::new(),
432432
var_config: Vec::new(),
433-
units: Vec::new(),
433+
pous: Vec::new(),
434434
implementations: Vec::new(),
435435
interfaces: Vec::new(),
436436
user_types: Vec::new(),
@@ -451,7 +451,7 @@ impl CompilationUnit {
451451
/// `other` the other CompilationUnit to import the elements from.
452452
pub fn import(&mut self, other: CompilationUnit) {
453453
self.global_vars.extend(other.global_vars);
454-
self.units.extend(other.units);
454+
self.pous.extend(other.pous);
455455
self.implementations.extend(other.implementations);
456456
self.user_types.extend(other.user_types);
457457
}

compiler/plc_ast/src/mut_visitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ impl WalkerMut for CompilationUnit {
421421
visitor.visit_user_type_declaration(user_type);
422422
}
423423

424-
for pou in &mut self.units {
424+
for pou in &mut self.pous {
425425
visitor.visit_pou(pou);
426426
}
427427

compiler/plc_ast/src/pre_processor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use plc_source::source_location::SourceLocation;
1818

1919
pub fn pre_process(unit: &mut CompilationUnit, mut id_provider: IdProvider) {
2020
//process all local variables from POUs
21-
for pou in unit.units.iter_mut() {
21+
for pou in unit.pous.iter_mut() {
2222
//Find all generic types in that pou
2323
let generic_types = preprocess_generic_structs(pou);
2424
unit.user_types.extend(generic_types);

compiler/plc_ast/src/visitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ impl Walker for CompilationUnit {
627627
visitor.visit_user_type_declaration(user_type);
628628
}
629629

630-
for pou in &self.units {
630+
for pou in &self.pous {
631631
visitor.visit_pou(pou);
632632
}
633633

compiler/plc_driver/src/pipelines/validator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use super::{participant::PipelineParticipant, ParsedProject};
55
impl PipelineParticipant for ParticipantValidator {
66
fn pre_index(&mut self, project: &ParsedProject) {
77
for unit in &project.units {
8-
for pou in &unit.units {
8+
for pou in &unit.pous {
99
self.validate_properties(pou);
1010
}
1111
}

compiler/plc_lowering/src/inheritance.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ mod units_tests {
275275
.into();
276276

277277
let (_, project) = parse_and_annotate("test", vec![src]).unwrap();
278-
let unit = &project.units[0].get_unit().units[1];
278+
let unit = &project.units[0].get_unit().pous[1];
279279
assert_debug_snapshot!(unit, @r###"
280280
POU {
281281
name: "bar",
@@ -2006,7 +2006,7 @@ mod units_tests {
20062006
.into();
20072007

20082008
let (_, project) = parse_and_annotate("test", vec![src]).unwrap();
2009-
let unit = &project.units[0].get_unit().units[2];
2009+
let unit = &project.units[0].get_unit().pous[2];
20102010
assert_debug_snapshot!(unit, @r###"
20112011
POU {
20122012
name: "child",
@@ -2094,7 +2094,7 @@ mod units_tests {
20942094
.into();
20952095

20962096
let (_, project) = parse_and_annotate("test", vec![src]).unwrap();
2097-
let unit = &project.units[0].get_unit().units[3];
2097+
let unit = &project.units[0].get_unit().pous[3];
20982098
assert_debug_snapshot!(unit, @r#"
20992099
POU {
21002100
name: "child.foo",

compiler/plc_xml/src/xml_parser/snapshots/plc_xml__xml_parser__control__tests__jump_and_label_converted_to_ast.snap

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
---
22
source: compiler/plc_xml/src/xml_parser/control.rs
33
expression: ast
4-
snapshot_kind: text
54
---
65
CompilationUnit {
76
global_vars: [],
87
var_config: [],
9-
units: [
8+
pous: [
109
POU {
1110
name: "program_0",
1211
variable_blocks: [

compiler/plc_xml/src/xml_parser/snapshots/plc_xml__xml_parser__control__tests__negated_jump_ast.snap

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
---
22
source: compiler/plc_xml/src/xml_parser/control.rs
33
expression: ast
4-
snapshot_kind: text
54
---
65
CompilationUnit {
76
global_vars: [],
87
var_config: [],
9-
units: [
8+
pous: [
109
POU {
1110
name: "program_0",
1211
variable_blocks: [

compiler/plc_xml/src/xml_parser/snapshots/plc_xml__xml_parser__control__tests__unconnected_jump_generated_as_empty_statement.snap

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
---
22
source: compiler/plc_xml/src/xml_parser/control.rs
33
expression: ast
4-
snapshot_kind: text
54
---
65
CompilationUnit {
76
global_vars: [],
87
var_config: [],
9-
units: [
8+
pous: [
109
POU {
1110
name: "program_0",
1211
variable_blocks: [

compiler/plc_xml/src/xml_parser/snapshots/plc_xml__xml_parser__control__tests__unnamed_controls.snap

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
---
22
source: compiler/plc_xml/src/xml_parser/control.rs
33
expression: ast
4-
snapshot_kind: text
54
---
65
CompilationUnit {
76
global_vars: [],
87
var_config: [],
9-
units: [
8+
pous: [
109
POU {
1110
name: "program_0",
1211
variable_blocks: [],

0 commit comments

Comments
 (0)