From 4ae9e07ddc8ca344f27c2d56b060fda66d5f2972 Mon Sep 17 00:00:00 2001 From: Greg de Lima <8351200+GD-L@users.noreply.github.com> Date: Mon, 13 Feb 2023 11:12:01 -0500 Subject: Add new lexer for DAX (#2335) Co-authored-by: Jean Abou-Samra --- tests/examplefiles/dax/dax_example1.dax | 11 +++++++ tests/examplefiles/dax/dax_example1.dax.output | 45 ++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 tests/examplefiles/dax/dax_example1.dax create mode 100644 tests/examplefiles/dax/dax_example1.dax.output (limited to 'tests') diff --git a/tests/examplefiles/dax/dax_example1.dax b/tests/examplefiles/dax/dax_example1.dax new file mode 100644 index 00000000..39b48891 --- /dev/null +++ b/tests/examplefiles/dax/dax_example1.dax @@ -0,0 +1,11 @@ +/* This calculation sums sales divided +by days in the month +multiplied by current MTD +*/ +Total Sales Spread = ( + --This line does a calculate + CALCULATE ( + SUM ( TABLE1[SALES]), + PBCS_PLAN_FCST[Scenario] = "Plan" + ) / 'Days in Month'[Days in Month Value] +) * 'Current MTD'[Current MTD Value] \ No newline at end of file diff --git a/tests/examplefiles/dax/dax_example1.dax.output b/tests/examplefiles/dax/dax_example1.dax.output new file mode 100644 index 00000000..107cde5a --- /dev/null +++ b/tests/examplefiles/dax/dax_example1.dax.output @@ -0,0 +1,45 @@ +'/*' Comment.Multiline +' This calculation sums sales divided\nby days in the month \nmultiplied by current MTD\n' Comment.Multiline + +'*/' Comment.Multiline +'\n' Text.Whitespace + +'Total Sales Spread = (\n' Text + +' ' Text.Whitespace +'--This line does a calculate\n' Comment.Single + +' ' Text.Whitespace +'CALCULATE' Name.Function +' ' Text.Whitespace +'(' Punctuation +'\n ' Text.Whitespace +'SUM' Name.Function +' ' Text.Whitespace +'(' Punctuation +' ' Text.Whitespace +'TABLE1[SALES]' Name.Attribute +')' Punctuation +',' Punctuation +'\n ' Text.Whitespace +'PBCS_PLAN_FCST[Scenario]' Name.Attribute +' ' Text.Whitespace +'=' Operator +' ' Text.Whitespace +'"' Literal.String +'Plan' Literal.String +'"' Literal.String +'\n ' Text.Whitespace +')' Punctuation +' ' Text.Whitespace +'/' Operator +' ' Text.Whitespace +"'Days in Month'[Days in Month Value]" Name.Attribute +'\n' Text.Whitespace + +')' Punctuation +' ' Text.Whitespace +'*' Operator +' ' Text.Whitespace +"'Current MTD'[Current MTD Value]" Name.Attribute +'\n' Text.Whitespace -- cgit v1.2.1