diff --git a/src/protocol/ast.rs b/src/protocol/ast.rs index 6df72ed25770718b6ba4d0726a6d91f057bad956..e28067b5849b6d42322ef7524386c96b9a5aff3e 100644 --- a/src/protocol/ast.rs +++ b/src/protocol/ast.rs @@ -1246,14 +1246,36 @@ impl SyntaxElement for Root { } #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] -pub struct Pragma { +pub enum Pragma { + Version(PragmaVersion), + Module(PragmaModule) +} + +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] +pub struct PragmaVersion { + pub this: PragmaId, + // Phase 1: parser + pub position: InputPosition, + pub version: u64, +} + +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] +pub struct PragmaModule { + pub this: PragmaId, + // Phase 1: parser + pub position: InputPosition, + pub value: Vec, +} + +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] +pub struct PragmaOld { pub this: PragmaId, // Phase 1: parser pub position: InputPosition, pub value: Vec, } -impl SyntaxElement for Pragma { +impl SyntaxElement for PragmaOld { fn position(&self) -> InputPosition { self.position } @@ -1481,7 +1503,7 @@ impl SyntaxElement for TypeAnnotation { } type CharacterData = Vec; -type IntegerData = Vec; +type IntegerData = i64; #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] pub enum Constant {