Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

End of line normalisation

  • Loading branch information...
commit a4ae88dc50a78f93e90bc62e6b831af492db40fc 1 parent 1d84208
@citizenmatt citizenmatt authored
Showing with 16,281 additions and 16,259 deletions.
  1. +22 −0 .gitattributes
  2. +64 −64 .gitignore
  3. +51 −51 README.md
  4. +22 −22 src/fsharper/Daemon.FSharp/src/Stages/FSharpDaemonStageBase.cs
  5. +20 −20 src/fsharper/LexerVisualization/MainWindow.xaml
  6. +167 −167 src/fsharper/LexerVisualization/MainWindow.xaml.cs
  7. +55 −55 src/fsharper/LexerVisualization/Properties/AssemblyInfo.cs
  8. +7 −7 src/fsharper/Plugin/Actions.xml
  9. +5,725 −5,725 src/fsharper/Plugin/AssemblyDependencies.dgml
  10. +65 −65 src/fsharper/Plugin/Plugin.csproj
  11. +17 −17 src/fsharper/ProjectModel/src/IFSharpProjectConfiguration.cs
  12. +1,340 −1,340 src/fsharper/Psi.FSharp/Psi.FSharp.csproj
  13. +8 −8 src/fsharper/Psi.FSharp/src/CodeStyle/IFSharpCodeFormatter.cs
  14. +15 −15 src/fsharper/Psi.FSharp/src/FSharpElementFactory.cs
  15. +24 −24 src/fsharper/Psi.FSharp/src/FSharpLanguage.cs
  16. +30 −30 src/fsharper/Psi.FSharp/src/Impl/FSharpElementFactoryImpl.cs
  17. +44 −44 src/fsharper/Psi.FSharp/src/Impl/Tree/FSharpExpressionBase.cs
  18. +331 −331 src/fsharper/Psi.FSharp/src/Parsing/FSharpLexer.gen.lex
  19. +1 −1  src/fsharper/Psi.FSharp/src/Parsing/FSharpLexer.gen_lex.depends
  20. +248 −248 src/fsharper/Psi.FSharp/src/Parsing/FSharpLexerGenerated.cs
  21. +34 −34 src/fsharper/Psi.FSharp/src/Parsing/FSharpParser.cs
  22. +484 −484 src/fsharper/Psi.FSharp/src/Parsing/FSharpTokenType.cs
  23. +3,469 −3,469 src/fsharper/Psi.FSharp/src/Parsing/FSharpTokenTypeGenerated.cs
  24. +7 −7 src/fsharper/Psi.FSharp/src/Parsing/IFSharpParser.cs
  25. +59 −59 src/fsharper/Psi.FSharp/src/Parsing/ParserMessages.cs
  26. +252 −252 src/fsharper/Psi.FSharp/src/Parsing/Tokens.xml
  27. +51 −51 src/fsharper/Psi.FSharp/src/Tree/FSharpTokenBase.cs
  28. +8 −8 src/fsharper/Psi.FSharp/src/Tree/IFSharpExpression.cs
  29. +8 −8 src/fsharper/Psi.FSharp/src/Tree/IFSharpFile.cs
  30. +10 −10 src/fsharper/Psi.FSharp/src/Tree/IFSharpTreeNode.cs
  31. +12 −12 src/fsharper/Psi.FSharp/src/Tree/Impl/ChildRole.cs
  32. +27 −27 src/fsharper/Psi.FSharp/src/Tree/Impl/FSharpCompositeElement.cs
  33. +9 −9 src/fsharper/Psi.FSharp/src/Tree/Impl/FSharpFile.cs
  34. +10 −10 src/fsharper/Psi.FSharp/src/Tree/Impl/FSharpFileElement.cs
  35. +1,794 −1,794 src/fsharper/Psi.FSharp/src/fsharp.psi
  36. +17 −17 src/fsharper/Services.FSharp/Properties/AssemblyInfo.cs
  37. +65 −65 src/fsharper/Services.FSharp/Services.FSharp.csproj
  38. +30 −30 src/fsharper/Services.FSharp/src/Analyses/Bulbs/FSharpContextActionDataBuilder.cs
  39. +27 −27 src/fsharper/Services.FSharp/src/Analyses/Bulbs/FSharpContextActionDataProvider.cs
  40. +9 −9 src/fsharper/Services.FSharp/src/Analyses/Bulbs/IFSharpContextActionDataProvider.cs
  41. +77 −77 src/fsharper/Tests/FSharpLexerTest.cs
  42. +89 −89 src/fsharper/Tests/FSharpLexerTestBase.cs
  43. +70 −70 src/fsharper/Tests/Properties/AssemblyInfo.cs
  44. +403 −403 src/fsharper/Tests/Tests.csproj
  45. +115 −115 src/fsharper/fsharper.sln
  46. +17 −17 test/data/lexing/fsharp/active-patterns-multi-case.fs.gold
  47. +13 −13 test/data/lexing/fsharp/active-patterns-one-case.fs.gold
  48. +19 −19 test/data/lexing/fsharp/active-patterns-parameterized.fs.gold
  49. +17 −17 test/data/lexing/fsharp/active-patterns-partial.fs.gold
  50. +5 −5 test/data/lexing/fsharp/bignum-literals.fs
  51. +11 −11 test/data/lexing/fsharp/bignum-literals.fs.gold
  52. +1 −1  test/data/lexing/fsharp/bytearray-string-literals.fs
  53. +3 −3 test/data/lexing/fsharp/bytearray-string-literals.fs.gold
  54. +1 −1  test/data/lexing/fsharp/bytechar-literal.fs.gold
  55. +23 −23 test/data/lexing/fsharp/decimal-literals.fs
  56. +47 −47 test/data/lexing/fsharp/decimal-literals.fs.gold
  57. +5 −5 test/data/lexing/fsharp/do-bang.fs.gold
  58. +35 −35 test/data/lexing/fsharp/float32-literals-exponent-form.fs
  59. +71 −71 test/data/lexing/fsharp/float32-literals-exponent-form.fs.gold
  60. +13 −13 test/data/lexing/fsharp/float32-literals.fs
  61. +27 −27 test/data/lexing/fsharp/float32-literals.fs.gold
  62. +17 −17 test/data/lexing/fsharp/float64-literals-exponent-form.fs
  63. +35 −35 test/data/lexing/fsharp/float64-literals-exponent-form.fs.gold
  64. +9 −9 test/data/lexing/fsharp/float64-literals.fs
  65. +19 −19 test/data/lexing/fsharp/float64-literals.fs.gold
  66. +1 −1  test/data/lexing/fsharp/identifier-double-backstick-1.fs.gold
  67. +1 −1  test/data/lexing/fsharp/identifier-double-backstick-2.fs.gold
  68. +1 −1  test/data/lexing/fsharp/identifier-double-backstick-3.fs.gold
  69. +17 −17 test/data/lexing/fsharp/int-literals.fs
  70. +35 −35 test/data/lexing/fsharp/int-literals.fs.gold
  71. +11 −11 test/data/lexing/fsharp/let-arith-1.fs.gold
  72. +8 −8 test/data/lexing/fsharp/let-array-1.fs.gold
  73. +14 −14 test/data/lexing/fsharp/let-array-2.fs.gold
  74. +7 −7 test/data/lexing/fsharp/let-bang.fs.gold
  75. +8 −8 test/data/lexing/fsharp/let-list-1.fs.gold
  76. +9 −9 test/data/lexing/fsharp/let-list-2.fs.gold
  77. +14 −14 test/data/lexing/fsharp/let-list-3.fs.gold
  78. +12 −12 test/data/lexing/fsharp/let-list-4.fs.gold
  79. +16 −16 test/data/lexing/fsharp/let-list-5.fs.gold
  80. +13 −13 test/data/lexing/fsharp/let-list-6.fs.gold
  81. +17 −17 test/data/lexing/fsharp/let-list-7.fs.gold
  82. +17 −17 test/data/lexing/fsharp/let-list-8.fs.gold
  83. +21 −21 test/data/lexing/fsharp/let-list-9.fs.gold
  84. +9 −9 test/data/lexing/fsharp/let-mutable.fs.gold
  85. +11 −11 test/data/lexing/fsharp/let-tuple-1.fs.gold
  86. +15 −15 test/data/lexing/fsharp/let-tuple-2.fs.gold
  87. +13 −13 test/data/lexing/fsharp/let-tuple-3.fs.gold
  88. +17 −17 test/data/lexing/fsharp/let-tuple-4.fs.gold
  89. +3 −3 test/data/lexing/fsharp/module-decl-1.fs.gold
  90. +2 −2 test/data/lexing/fsharp/module-decl-2.fs
  91. +12 −12 test/data/lexing/fsharp/module-decl-2.fs.gold
  92. +5 −5 test/data/lexing/fsharp/module-decl-3.fs.gold
  93. +3 −3 test/data/lexing/fsharp/namespace-decl-1.fs.gold
  94. +5 −5 test/data/lexing/fsharp/namespace-decl-2.fs.gold
  95. +6 −6 test/data/lexing/fsharp/object-transformation-operators.fs
  96. +13 −13 test/data/lexing/fsharp/object-transformation-operators.fs.gold
  97. +3 −3 test/data/lexing/fsharp/open-directive-1.fs.gold
  98. +7 −7 test/data/lexing/fsharp/open-directive-2.fs.gold
  99. +2 −2 test/data/lexing/fsharp/open-directive-3.fs
  100. +15 −15 test/data/lexing/fsharp/open-directive-3.fs.gold
  101. +2 −2 test/data/lexing/fsharp/operators-comparison.fs
  102. +5 −5 test/data/lexing/fsharp/operators-comparison.fs.gold
  103. +1 −1  test/data/lexing/fsharp/operators-functional.fs
  104. +3 −3 test/data/lexing/fsharp/operators-functional.fs.gold
  105. +13 −13 test/data/lexing/fsharp/raise.fs.gold
  106. +3 −3 test/data/lexing/fsharp/return-bang.fs.gold
  107. +7 −7 test/data/lexing/fsharp/test1.fs.gold
  108. +5 −5 test/data/lexing/fsharp/triple-quoted-string.fs
  109. +9 −9 test/data/lexing/fsharp/triple-quoted-string.fs.gold
  110. +2 −2 test/data/lexing/fsharp/union-type-1.fs
  111. +13 −13 test/data/lexing/fsharp/union-type-1.fs.gold
  112. +2 −2 test/data/lexing/fsharp/union-type-2-generic-recursive.fs
  113. +25 −25 test/data/lexing/fsharp/union-type-2-generic-recursive.fs.gold
  114. +2 −2 test/data/lexing/fsharp/union-type-3-generic-recursive.fs
  115. +27 −27 test/data/lexing/fsharp/union-type-3-generic-recursive.fs.gold
  116. +10 −10 test/data/lexing/fsharp/use-bang.fs.gold
  117. +1 −1  test/data/lexing/fsharp/verbatim-string-escape-double-quote.fs.gold
  118. +1 −1  test/data/lexing/fsharp/verbatim-string-escape.fs.gold
  119. +1 −1  test/data/lexing/fsharp/verbatim-string-simple.fs.gold
  120. +6 −6 test/data/lexing/fsharp/yield-bang.fs.gold
View
22 .gitattributes
@@ -0,0 +1,22 @@
+# Auto detect text files and perform LF normalization
+* text=auto
+
+# Custom for Visual Studio
+*.cs diff=csharp
+*.sln merge=union
+*.csproj merge=union
+*.vbproj merge=union
+*.fsproj merge=union
+*.dbproj merge=union
+
+# Standard to msysgit
+*.doc diff=astextplain
+*.DOC diff=astextplain
+*.docx diff=astextplain
+*.DOCX diff=astextplain
+*.dot diff=astextplain
+*.DOT diff=astextplain
+*.pdf diff=astextplain
+*.PDF diff=astextplain
+*.rtf diff=astextplain
+*.RTF diff=astextplain
View
128 .gitignore
@@ -1,65 +1,65 @@
-
-#OS junk files
-[Tt]humbs.db
-*.DS_Store
-
-#Visual Studio files
-*.[Oo]bj
-*.exe
-*.pdb
-*.user
-*.aps
-*.pch
-*.vspscc
-*.vssscc
-*_i.c
-*_p.c
-*.ncb
-*.suo
-*.tlb
-*.tlh
-*.bak
-*.[Cc]ache
-*.ilk
-*.log
-*.lib
-*.sbr
-*.sdf
-*.opensdf
-*.tmp
-ipch/
-obj/
-[Bb]in
-[Bb]indebug
-[Bb]intests
-[Dd]ebug*/
-[Rr]elease*/
-[Dd]istrib
-Ankh.NoLoad
-
-Build/
-
-#Tooling
-_ReSharper*/
-*.resharper
-[Tt]est[Rr]esult*
-
-#Subversion files
-.svn
-
-# Office Temp Files
-~$*
-
-#generated parser files should not be added!
-/src/fsharper/Psi.FSharp/src/Gen
-
-#Visual Studio backup and report files
-[Uu]pgrade[Ll]og*
-[Bb]ackup*/
-_[Uu]pgrade[Rr]eport_[Ff]iles*/
-
-#ignore sublime files
-*.sublime-*
-
-#directory for playground
+
+#OS junk files
+[Tt]humbs.db
+*.DS_Store
+
+#Visual Studio files
+*.[Oo]bj
+*.exe
+*.pdb
+*.user
+*.aps
+*.pch
+*.vspscc
+*.vssscc
+*_i.c
+*_p.c
+*.ncb
+*.suo
+*.tlb
+*.tlh
+*.bak
+*.[Cc]ache
+*.ilk
+*.log
+*.lib
+*.sbr
+*.sdf
+*.opensdf
+*.tmp
+ipch/
+obj/
+[Bb]in
+[Bb]indebug
+[Bb]intests
+[Dd]ebug*/
+[Rr]elease*/
+[Dd]istrib
+Ankh.NoLoad
+
+Build/
+
+#Tooling
+_ReSharper*/
+*.resharper
+[Tt]est[Rr]esult*
+
+#Subversion files
+.svn
+
+# Office Temp Files
+~$*
+
+#generated parser files should not be added!
+/src/fsharper/Psi.FSharp/src/Gen
+
+#Visual Studio backup and report files
+[Uu]pgrade[Ll]og*
+[Bb]ackup*/
+_[Uu]pgrade[Rr]eport_[Ff]iles*/
+
+#ignore sublime files
+*.sublime-*
+
+#directory for playground
playground/
View
102 README.md
@@ -1,52 +1,52 @@
-FSharper
-========
-This project is an attempt to build a plug-in to support the F# programming language in ReSharper.
-
-Broadly speaking, its goals are to:
-
-* Provide ReSharper with a PSI (lexer+parser+inference engine)
-* Provide integration with existing R# features (e.g., navigation, search, etc.)
-* Provide OOP-related as well as FP-related services (e.g., type inferencing helpers)
-
-Status
-======
-**Note:** the plugin is not yet ready to be installed and executed. For now, to see it in action, run the `LexerVisualization` application.
-
-At the moment, we are working towards the 0.1 release, which aims to have a fully (or maybe 95%) compliant lexer covered with tests. What we need is:
-
-* To correctly define known F# constructs in the `.lex`. file (and also in `Tokens.xml`, but see note in the next section).
-* To create a sufficient number of lexer tests to ensure everything works.
-
-A correctly working lexer (plus maybe one lexer-based service, e.g., TODO explorer support) would constitute the 0.1 release ([tentative roadmap](https://github.com/JetBrains/FSharper/wiki/Roadmap)).
-
-Building
-========
-In order to compile the project, you need the following:
-
-* **Visual Studio 2012** (earlier versions are not supported as F# projects are not backward-compatible)
-* [ReSharper SDK](http://www.jetbrains.com/resharper/download/index.html) (download and install the MSI package)
-* [WiX (Windows Installer for XML)](http://wix.sourceforge.net/)
-
-If you have all of these on the machine, the solution should build out of the box. (If it doesn't, please post an issue on the tracker.)
-
-Please note that, currently, any changes to `Tokens.xml` will need to be processed on our end - this is due to one code generation tool not making it into the SDK (please [vote for it](http://youtrack.jetbrains.com/issue/RSRP-318622)). This mechamism might be reworked at a later time.
-
-Debugging
-=========
-To debug the plugin, you need to
-
- * Have **ReSharper 7.1** installed for Visual Studio 2012
- * Set `Plugin` project as StartUp project
- * In the Debug section of the project properties
- * Set the start action to "Start external program" and specify the path to your Visual Studio installation e.g. "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe".
- * Set the command line arguments to match your debug output directory e.g. "/ReSharper.Internal /ReSharper.Plugin C:\Code\FSharper\bindebug".
- * Press F5 and load a F# project
-
-In addition, try running the `LexerVisualization` project - this gives a graphical representation of a file being lexed. You can just type things in or open an existing F# file. If you see valid code turn red - that needs to be fixed.
-
-Contributing
-============
-Pull requests are most welcome and will be reviewed and integrated as soon as humanly possible. However, please don't commit one-line pull requests, as those just waste everyone's time (feel free to use `--squash` if necessary).
-Right now, the bulk of development happens on the `develop` branch, though other branches will be created for various subsystems.
-
+FSharper
+========
+This project is an attempt to build a plug-in to support the F# programming language in ReSharper.
+
+Broadly speaking, its goals are to:
+
+* Provide ReSharper with a PSI (lexer+parser+inference engine)
+* Provide integration with existing R# features (e.g., navigation, search, etc.)
+* Provide OOP-related as well as FP-related services (e.g., type inferencing helpers)
+
+Status
+======
+**Note:** the plugin is not yet ready to be installed and executed. For now, to see it in action, run the `LexerVisualization` application.
+
+At the moment, we are working towards the 0.1 release, which aims to have a fully (or maybe 95%) compliant lexer covered with tests. What we need is:
+
+* To correctly define known F# constructs in the `.lex`. file (and also in `Tokens.xml`, but see note in the next section).
+* To create a sufficient number of lexer tests to ensure everything works.
+
+A correctly working lexer (plus maybe one lexer-based service, e.g., TODO explorer support) would constitute the 0.1 release ([tentative roadmap](https://github.com/JetBrains/FSharper/wiki/Roadmap)).
+
+Building
+========
+In order to compile the project, you need the following:
+
+* **Visual Studio 2012** (earlier versions are not supported as F# projects are not backward-compatible)
+* [ReSharper SDK](http://www.jetbrains.com/resharper/download/index.html) (download and install the MSI package)
+* [WiX (Windows Installer for XML)](http://wix.sourceforge.net/)
+
+If you have all of these on the machine, the solution should build out of the box. (If it doesn't, please post an issue on the tracker.)
+
+Please note that, currently, any changes to `Tokens.xml` will need to be processed on our end - this is due to one code generation tool not making it into the SDK (please [vote for it](http://youtrack.jetbrains.com/issue/RSRP-318622)). This mechamism might be reworked at a later time.
+
+Debugging
+=========
+To debug the plugin, you need to
+
+ * Have **ReSharper 7.1** installed for Visual Studio 2012
+ * Set `Plugin` project as StartUp project
+ * In the Debug section of the project properties
+ * Set the start action to "Start external program" and specify the path to your Visual Studio installation e.g. "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe".
+ * Set the command line arguments to match your debug output directory e.g. "/ReSharper.Internal /ReSharper.Plugin C:\Code\FSharper\bindebug".
+ * Press F5 and load a F# project
+
+In addition, try running the `LexerVisualization` project - this gives a graphical representation of a file being lexed. You can just type things in or open an existing F# file. If you see valid code turn red - that needs to be fixed.
+
+Contributing
+============
+Pull requests are most welcome and will be reviewed and integrated as soon as humanly possible. However, please don't commit one-line pull requests, as those just waste everyone's time (feel free to use `--squash` if necessary).
+Right now, the bulk of development happens on the `develop` branch, though other branches will be created for various subsystems.
+
If you're not sure what to contribute, please take a look at the issues list.
View
44 src/fsharper/Daemon.FSharp/src/Stages/FSharpDaemonStageBase.cs
@@ -1,22 +1,22 @@
-namespace JetBrains.ReSharper.Daemon.FSharp.Stages
-{
- using System.Collections.Generic;
- using Application.Settings;
- using Psi;
- using Psi.FSharp;
- using Psi.Tree;
-
- public abstract class FSharpDaemonStageBase : IDaemonStage
- {
- protected static bool IsSupported(IPsiSourceFile sourceFile)
- {
- if (sourceFile == null || !sourceFile.IsValid())
- return false;
- var psiFile = sourceFile.GetNonInjectedPsiFile<FSharpLanguage>();
- return psiFile != null && psiFile.Language.Is<FSharpLanguage>();
- }
-
- public abstract IEnumerable<IDaemonStageProcess> CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings, DaemonProcessKind processKind);
- public abstract ErrorStripeRequest NeedsErrorStripe(IPsiSourceFile sourceFile, IContextBoundSettingsStore settingsStore);
- }
-}
+namespace JetBrains.ReSharper.Daemon.FSharp.Stages
+{
+ using System.Collections.Generic;
+ using Application.Settings;
+ using Psi;
+ using Psi.FSharp;
+ using Psi.Tree;
+
+ public abstract class FSharpDaemonStageBase : IDaemonStage
+ {
+ protected static bool IsSupported(IPsiSourceFile sourceFile)
+ {
+ if (sourceFile == null || !sourceFile.IsValid())
+ return false;
+ var psiFile = sourceFile.GetNonInjectedPsiFile<FSharpLanguage>();
+ return psiFile != null && psiFile.Language.Is<FSharpLanguage>();
+ }
+
+ public abstract IEnumerable<IDaemonStageProcess> CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings, DaemonProcessKind processKind);
+ public abstract ErrorStripeRequest NeedsErrorStripe(IPsiSourceFile sourceFile, IContextBoundSettingsStore settingsStore);
+ }
+}
View
40 src/fsharper/LexerVisualization/MainWindow.xaml
@@ -1,20 +1,20 @@
-<Window x:Class="JetBrains.ReSharper.FSharp.LexerVisualization.MainWindow"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- Title="Lexer Visualizer" Height="350" Width="525" x:Name="theWindow">
- <Grid DataContext="{Binding ElementName=theWindow, Path=.}">
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
- <Button Name="btnOpen" Click="OnOpen">Open</Button>
- <TextBox AcceptsReturn="True" AcceptsTab="True" Grid.Row="1" Name="tbIn"
- Text="{Binding Path=InputText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontFamily="Consolas">
- </TextBox>
- <WebBrowser Grid.Column="1" Name="theBrowser" Grid.Row="1"/>
- </Grid>
-</Window>
+<Window x:Class="JetBrains.ReSharper.FSharp.LexerVisualization.MainWindow"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ Title="Lexer Visualizer" Height="350" Width="525" x:Name="theWindow">
+ <Grid DataContext="{Binding ElementName=theWindow, Path=.}">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition />
+ <ColumnDefinition />
+ </Grid.ColumnDefinitions>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition/>
+ </Grid.RowDefinitions>
+ <Button Name="btnOpen" Click="OnOpen">Open</Button>
+ <TextBox AcceptsReturn="True" AcceptsTab="True" Grid.Row="1" Name="tbIn"
+ Text="{Binding Path=InputText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontFamily="Consolas">
+ </TextBox>
+ <WebBrowser Grid.Column="1" Name="theBrowser" Grid.Row="1"/>
+ </Grid>
+</Window>
View
334 src/fsharper/LexerVisualization/MainWindow.xaml.cs
@@ -1,167 +1,167 @@
-using System.IO;
-using System.Linq;
-using Microsoft.Win32;
-
-namespace JetBrains.ReSharper.FSharp.LexerVisualization
-{
- using System;
- using System.Net;
- using System.Text;
- using System.Windows;
- using Psi.FSharp.Parsing;
- using Psi.Parsing;
- using Text;
-
- public partial class MainWindow : Window
- {
- public static readonly DependencyProperty InputTextProperty =
- DependencyProperty.Register("InputText", typeof(string), typeof(MainWindow),
- new PropertyMetadata(string.Empty, InputTextChanged));
-
- private static void InputTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- ((MainWindow)d).Process();
- }
-
- public MainWindow()
- {
- InitializeComponent();
- }
-
- public string InputText
- {
- get { return (string)GetValue(InputTextProperty); }
- set { SetValue(InputTextProperty, value); }
- }
-
- class Implementation
- {
- public static string Start(string inputText)
- {
- if (inputText == null) throw new ArgumentNullException("inputText");
- return Lex(inputText);
- }
-
- private static string Lex(string inputText)
- {
- var sb = new StringBuilder();
- var lexer = new FSharpLexer(new StringBuffer(inputText));
- int position = 0;
- lexer.Start();
- try
- {
- while (lexer.TokenType != null)
- {
- if (lexer.TokenStart != position) sb.AppendFormat("<pre>Token start error. Expected: {0}, actual: {1}</pre>", position, lexer.TokenStart);
-
- //Assert.AreEqual(lexer.TokenStart, position, "Token start error. Expected: {0}, actual: {1}", position, lexer.TokenStart);
- position = lexer.TokenEnd;
-
- //
- var token = lexer.TokenType;
- var len = lexer.TokenEnd - lexer.TokenStart;
- char[] buffer = new char[len];
- lexer.Buffer.CopyTo(lexer.TokenStart, buffer, 0, len);
- string tokenText = WebUtility.HtmlEncode(new string(buffer));
- if (token.IsComment) RenderComment(sb, tokenText, token);
- else if (token.IsKeyword) RenderKeyword(sb, tokenText, token);
- else if (token.IsWhitespace) RenderWhitespace(sb, tokenText, token);
- else if (token.IsConstantLiteral) RenderConstantLiteral(sb, tokenText, token);
- else if (token.IsStringLiteral) RenderStringLiteral(sb, tokenText, token);
- else if (token.IsIdentifier) RenderIdentifier(sb, tokenText, token);
- else if (token == FSharpTokenType.BAD_CHARACTER)
- {
- RenderBad(sb, tokenText, token);
- }
- else
- {
- // something else?
- RenderSomethingElse(sb, tokenText, token);
- }
-
- lexer.Advance();
- }
- }
- catch (Exception ex)
- {
- sb.AppendFormat("<span style=\"color:red\">{0}</span>", ex);
- }
-
- //Assert.AreEqual(lexer.Buffer.Length, position, "position == lexer.Buffer.Length");
- return sb.ToString();
- }
-
- private static void RenderBad(StringBuilder sb, string tokenText, TokenNodeType token)
- {
- sb.AppendFormat("<span title=\"bad character\" style=\"color:red\">{0}</span>", tokenText);
- }
-
- private static void RenderSomethingElse(StringBuilder sb, string tokenText, TokenNodeType token)
- {
- sb.AppendFormat("<span title=\"maybe operator {0}\">{0}</span>", tokenText);
- }
-
- private static void RenderIdentifier(StringBuilder sb, string tokenText, TokenNodeType token)
- {
- sb.AppendFormat("<span title=\"identifier\" style=\"background-color: lightgreen\">{0}</span>", tokenText);
- }
-
- private static void RenderStringLiteral(StringBuilder sb, string tokenText, TokenNodeType token)
- {
- sb.AppendFormat("<span title=\"comment\" style=\"background-color: #ffe0e0\">{0}</span>", tokenText);
- }
-
- private static void RenderConstantLiteral(StringBuilder sb, string tokenText, TokenNodeType token)
- {
- sb.AppendFormat("<span title=\"constant literal {0}\" style=\"background-color: #e0e0ff\">{0}</span>", tokenText);
- }
-
- private static void RenderWhitespace(StringBuilder sb, string tokenText, TokenNodeType token)
- {
- if (Environment.NewLine.Contains(tokenText))
- sb.Append("<br/>");
- else
- {
- sb.AppendFormat("<span title=\"whitespace\" style=\"background-color: #efefef\">");
- for (int i = 0; i < tokenText.Length; ++i)
- sb.Append("&hellip;");
- sb.Append("</span>");
- }
- }
-
- private static void RenderKeyword(StringBuilder sb, string tokenText, TokenNodeType token)
- {
- sb.AppendFormat("<span title=\"keyword\" style=\"background-color: #e0e0ff\">{0}</span>", tokenText);
- }
-
- private static void RenderComment(StringBuilder sb, string tokenText, TokenNodeType token)
- {
- sb.AppendFormat("<span title=\"comment\" style=\"background-color: #e0ffe0\">{0}</span>", tokenText);
- }
- }
-
- private void OnProcess(object sender, RoutedEventArgs e)
- {
- Process();
- }
-
- private void Process()
- {
- string html = Implementation.Start(InputText);
-
- const string preamble = "<pre>";
- const string postamble = "<pre>";
-
- theBrowser.NavigateToString(preamble + html + postamble);
- }
-
- private void OnOpen(object sender, RoutedEventArgs e)
- {
- var ofd = new OpenFileDialog {Filter = "F# Files|*.fs"};
- if (ofd.ShowDialog() ?? false)
- {
- tbIn.Text = File.ReadAllText(ofd.FileName);
- }
- }
- }
-}
+using System.IO;
+using System.Linq;
+using Microsoft.Win32;
+
+namespace JetBrains.ReSharper.FSharp.LexerVisualization
+{
+ using System;
+ using System.Net;
+ using System.Text;
+ using System.Windows;
+ using Psi.FSharp.Parsing;
+ using Psi.Parsing;
+ using Text;
+
+ public partial class MainWindow : Window
+ {
+ public static readonly DependencyProperty InputTextProperty =
+ DependencyProperty.Register("InputText", typeof(string), typeof(MainWindow),
+ new PropertyMetadata(string.Empty, InputTextChanged));
+
+ private static void InputTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ ((MainWindow)d).Process();
+ }
+
+ public MainWindow()
+ {
+ InitializeComponent();
+ }
+
+ public string InputText
+ {
+ get { return (string)GetValue(InputTextProperty); }
+ set { SetValue(InputTextProperty, value); }
+ }
+
+ class Implementation
+ {
+ public static string Start(string inputText)
+ {
+ if (inputText == null) throw new ArgumentNullException("inputText");
+ return Lex(inputText);
+ }
+
+ private static string Lex(string inputText)
+ {
+ var sb = new StringBuilder();
+ var lexer = new FSharpLexer(new StringBuffer(inputText));
+ int position = 0;
+ lexer.Start();
+ try
+ {
+ while (lexer.TokenType != null)
+ {
+ if (lexer.TokenStart != position) sb.AppendFormat("<pre>Token start error. Expected: {0}, actual: {1}</pre>", position, lexer.TokenStart);
+
+ //Assert.AreEqual(lexer.TokenStart, position, "Token start error. Expected: {0}, actual: {1}", position, lexer.TokenStart);
+ position = lexer.TokenEnd;
+
+ //
+ var token = lexer.TokenType;
+ var len = lexer.TokenEnd - lexer.TokenStart;
+ char[] buffer = new char[len];
+ lexer.Buffer.CopyTo(lexer.TokenStart, buffer, 0, len);
+ string tokenText = WebUtility.HtmlEncode(new string(buffer));
+ if (token.IsComment) RenderComment(sb, tokenText, token);
+ else if (token.IsKeyword) RenderKeyword(sb, tokenText, token);
+ else if (token.IsWhitespace) RenderWhitespace(sb, tokenText, token);
+ else if (token.IsConstantLiteral) RenderConstantLiteral(sb, tokenText, token);
+ else if (token.IsStringLiteral) RenderStringLiteral(sb, tokenText, token);
+ else if (token.IsIdentifier) RenderIdentifier(sb, tokenText, token);
+ else if (token == FSharpTokenType.BAD_CHARACTER)
+ {
+ RenderBad(sb, tokenText, token);
+ }
+ else
+ {
+ // something else?
+ RenderSomethingElse(sb, tokenText, token);
+ }
+
+ lexer.Advance();
+ }
+ }
+ catch (Exception ex)
+ {
+ sb.AppendFormat("<span style=\"color:red\">{0}</span>", ex);
+ }
+
+ //Assert.AreEqual(lexer.Buffer.Length, position, "position == lexer.Buffer.Length");
+ return sb.ToString();
+ }
+
+ private static void RenderBad(StringBuilder sb, string tokenText, TokenNodeType token)
+ {
+ sb.AppendFormat("<span title=\"bad character\" style=\"color:red\">{0}</span>", tokenText);
+ }
+
+ private static void RenderSomethingElse(StringBuilder sb, string tokenText, TokenNodeType token)
+ {
+ sb.AppendFormat("<span title=\"maybe operator {0}\">{0}</span>", tokenText);
+ }
+
+ private static void RenderIdentifier(StringBuilder sb, string tokenText, TokenNodeType token)
+ {
+ sb.AppendFormat("<span title=\"identifier\" style=\"background-color: lightgreen\">{0}</span>", tokenText);
+ }
+
+ private static void RenderStringLiteral(StringBuilder sb, string tokenText, TokenNodeType token)
+ {
+ sb.AppendFormat("<span title=\"comment\" style=\"background-color: #ffe0e0\">{0}</span>", tokenText);
+ }
+
+ private static void RenderConstantLiteral(StringBuilder sb, string tokenText, TokenNodeType token)
+ {
+ sb.AppendFormat("<span title=\"constant literal {0}\" style=\"background-color: #e0e0ff\">{0}</span>", tokenText);
+ }
+
+ private static void RenderWhitespace(StringBuilder sb, string tokenText, TokenNodeType token)
+ {
+ if (Environment.NewLine.Contains(tokenText))
+ sb.Append("<br/>");
+ else
+ {
+ sb.AppendFormat("<span title=\"whitespace\" style=\"background-color: #efefef\">");
+ for (int i = 0; i < tokenText.Length; ++i)
+ sb.Append("&hellip;");
+ sb.Append("</span>");
+ }
+ }
+
+ private static void RenderKeyword(StringBuilder sb, string tokenText, TokenNodeType token)
+ {
+ sb.AppendFormat("<span title=\"keyword\" style=\"background-color: #e0e0ff\">{0}</span>", tokenText);
+ }
+
+ private static void RenderComment(StringBuilder sb, string tokenText, TokenNodeType token)
+ {
+ sb.AppendFormat("<span title=\"comment\" style=\"background-color: #e0ffe0\">{0}</span>", tokenText);
+ }
+ }
+
+ private void OnProcess(object sender, RoutedEventArgs e)
+ {
+ Process();
+ }
+
+ private void Process()
+ {
+ string html = Implementation.Start(InputText);
+
+ const string preamble = "<pre>";
+ const string postamble = "<pre>";
+
+ theBrowser.NavigateToString(preamble + html + postamble);
+ }
+
+ private void OnOpen(object sender, RoutedEventArgs e)
+ {
+ var ofd = new OpenFileDialog {Filter = "F# Files|*.fs"};
+ if (ofd.ShowDialog() ?? false)
+ {
+ tbIn.Text = File.ReadAllText(ofd.FileName);
+ }
+ }
+ }
+}
View
110 src/fsharper/LexerVisualization/Properties/AssemblyInfo.cs
@@ -1,55 +1,55 @@
-using System.Reflection;
-using System.Resources;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Windows;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("JetBrains.ReSharper.FSharp.LexerVisualization")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("JetBrains.ReSharper.FSharp.LexerVisualization")]
-[assembly: AssemblyCopyright("Copyright © JeetBrains s.r.o 2011")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-//In order to begin building localizable applications, set
-//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
-//inside a <PropertyGroup>. For example, if you are using US english
-//in your source files, set the <UICulture> to en-US. Then uncomment
-//the NeutralResourceLanguage attribute below. Update the "en-US" in
-//the line below to match the UICulture setting in the project file.
-
-//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
-
-[assembly: ThemeInfo(
- ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
- //(used if a resource is not found in the page,
- // or application resource dictionaries)
- ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
- //(used if a resource is not found in the page,
- // app, or any theme specific resource dictionaries)
-)]
-
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("JetBrains.ReSharper.FSharp.LexerVisualization")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("JetBrains.ReSharper.FSharp.LexerVisualization")]
+[assembly: AssemblyCopyright("Copyright © JeetBrains s.r.o 2011")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+//In order to begin building localizable applications, set
+//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
+//inside a <PropertyGroup>. For example, if you are using US english
+//in your source files, set the <UICulture> to en-US. Then uncomment
+//the NeutralResourceLanguage attribute below. Update the "en-US" in
+//the line below to match the UICulture setting in the project file.
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
+
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
View
14 src/fsharper/Plugin/Actions.xml
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<actions>
- <insert group-id="ReSharper" position="last">
- <action-group id="Plugin" text="FSharper">
- </action-group>
- </insert>
-</actions>
+<?xml version="1.0" encoding="utf-8" ?>
+<actions>
+ <insert group-id="ReSharper" position="last">
+ <action-group id="Plugin" text="FSharper">
+ </action-group>
+ </insert>
+</actions>
View
11,450 src/fsharper/Plugin/AssemblyDependencies.dgml
5,725 additions, 5,725 deletions not shown
View
130 src/fsharper/Plugin/Plugin.csproj
@@ -1,66 +1,66 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{F479FF4A-AB6E-4C2C-8478-9BDFA0424C0E}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>JetBrains.ReSharper.FSharp.Plugin</RootNamespace>
- <AssemblyName>JetBrains.ReSharper.FSharp.Plugin</AssemblyName>
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <TargetFrameworkProfile />
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>..\..\..\bindebug\</OutputPath>
- <DefineConstants>JET_MODE_ASSERT;DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>..\..\..\bin\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="PresentationCore" />
- <Reference Include="System" />
- <Reference Include="System.Core" />
- <Reference Include="System.Drawing" />
- <Reference Include="System.Xml.Linq" />
- <Reference Include="System.Data.DataSetExtensions" />
- <Reference Include="System.Data" />
- <Reference Include="System.Windows.Forms" />
- <Reference Include="System.Xml" />
- <Reference Include="WindowsBase" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="ReadMe.txt" />
- </ItemGroup>
- <ItemGroup>
- <EmbeddedResource Include="Actions.xml" />
- </ItemGroup>
- <ItemGroup>
- <None Include="..\..\..\README.md">
- <Link>README.md</Link>
- </None>
- <None Include="AssemblyDependencies.dgml" />
- </ItemGroup>
- <PropertyGroup>
- <ReSharperSdkTargets Condition=" '$(ReSharperSdkTargets)' == '' ">$(MSBuildExtensionsPath)\JetBrains\ReSharper.SDK\v7.1</ReSharperSdkTargets>
- </PropertyGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <Import Project="$(ReSharperSdkTargets)\Plugin.Targets" />
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{F479FF4A-AB6E-4C2C-8478-9BDFA0424C0E}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>JetBrains.ReSharper.FSharp.Plugin</RootNamespace>
+ <AssemblyName>JetBrains.ReSharper.FSharp.Plugin</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <TargetFrameworkProfile />
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>..\..\..\bindebug\</OutputPath>
+ <DefineConstants>JET_MODE_ASSERT;DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>..\..\..\bin\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="PresentationCore" />
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml" />
+ <Reference Include="WindowsBase" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="ReadMe.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Actions.xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="..\..\..\README.md">
+ <Link>README.md</Link>
+ </None>
+ <None Include="AssemblyDependencies.dgml" />
+ </ItemGroup>
+ <PropertyGroup>
+ <ReSharperSdkTargets Condition=" '$(ReSharperSdkTargets)' == '' ">$(MSBuildExtensionsPath)\JetBrains\ReSharper.SDK\v7.1</ReSharperSdkTargets>
+ </PropertyGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(ReSharperSdkTargets)\Plugin.Targets" />
</Project>
View
34 src/fsharper/ProjectModel/src/IFSharpProjectConfiguration.cs
@@ -1,18 +1,18 @@
-namespace JetBrains.ProjectModel
-{
- using JetBrains.ProjectModel.Properties.Managed;
-
- public interface IFSharpProjectConfiguration :
- IManagedProjectConfiguration
- {
- VSFSharpLanguageVersion LanguageVersion { get; set; }
- }
-
- public enum VSFSharpLanguageVersion
- {
- FS10,
- FS20,
- FS30,
- Latest
- }
+namespace JetBrains.ProjectModel
+{
+ using JetBrains.ProjectModel.Properties.Managed;
+
+ public interface IFSharpProjectConfiguration :
+ IManagedProjectConfiguration
+ {
+ VSFSharpLanguageVersion LanguageVersion { get; set; }
+ }
+
+ public enum VSFSharpLanguageVersion
+ {
+ FS10,
+ FS20,
+ FS30,
+ Latest
+ }
}
View
2,680 src/fsharper/Psi.FSharp/Psi.FSharp.csproj
1,340 additions, 1,340 deletions not shown
View
16 src/fsharper/Psi.FSharp/src/CodeStyle/IFSharpCodeFormatter.cs
@@ -1,9 +1,9 @@
-using JetBrains.ReSharper.Psi.CodeStyle;
-
-namespace JetBrains.ReSharper.Psi.FSharp.CodeStyle
-{
- public interface IFSharpCodeFormatter : ICodeFormatter
- {
-
- }
+using JetBrains.ReSharper.Psi.CodeStyle;
+
+namespace JetBrains.ReSharper.Psi.FSharp.CodeStyle
+{
+ public interface IFSharpCodeFormatter : ICodeFormatter
+ {
+
+ }
}
View
30 src/fsharper/Psi.FSharp/src/FSharpElementFactory.cs
@@ -1,16 +1,16 @@
-using JetBrains.Annotations;
-using JetBrains.ReSharper.Psi.FSharp.Impl;
-
-namespace JetBrains.ReSharper.Psi.FSharp
-{
- public abstract class FSharpElementFactory
- {
- public static FSharpElementFactory GetInstance([NotNull] IPsiModule module, bool applyCodeFormatter = true, bool throwOnParseError = true)
- {
- return new FSharpElementFactoryImpl(module, applyCodeFormatter, throwOnParseError);
- }
-
- //[NotNull]
- //public abstract IFSharpFile CreateFileImpl(string test, params object[] args);
- }
+using JetBrains.Annotations;
+using JetBrains.ReSharper.Psi.FSharp.Impl;
+
+namespace JetBrains.ReSharper.Psi.FSharp
+{
+ public abstract class FSharpElementFactory
+ {
+ public static FSharpElementFactory GetInstance([NotNull] IPsiModule module, bool applyCodeFormatter = true, bool throwOnParseError = true)
+ {
+ return new FSharpElementFactoryImpl(module, applyCodeFormatter, throwOnParseError);
+ }
+
+ //[NotNull]
+ //public abstract IFSharpFile CreateFileImpl(string test, params object[] args);
+ }
}
View
48 src/fsharper/Psi.FSharp/src/FSharpLanguage.cs
@@ -1,25 +1,25 @@
-namespace JetBrains.ReSharper.Psi.FSharp
-{
- using Annotations;
-
- /// <summary>The F# language. Where necessary, use the Instance field.</summary>
- [LanguageDefinition(Name)]
- public class FSharpLanguage : KnownLanguage
- {
- public new const string Name = "FSHARP";
- public new const string PresentableName = "F#";
-
- [UsedImplicitly]
- public static readonly FSharpLanguage Instance;
-
- private FSharpLanguage() : base(Name, PresentableName) { }
-
- protected FSharpLanguage([NotNull] string name) : base(name)
- {
- }
-
- protected FSharpLanguage([NotNull] string name, [NotNull] string presentableName) : base(name, presentableName)
- {
- }
- }
+namespace JetBrains.ReSharper.Psi.FSharp
+{
+ using Annotations;
+
+ /// <summary>The F# language. Where necessary, use the Instance field.</summary>
+ [LanguageDefinition(Name)]
+ public class FSharpLanguage : KnownLanguage
+ {
+ public new const string Name = "FSHARP";
+ public new const string PresentableName = "F#";
+
+ [UsedImplicitly]
+ public static readonly FSharpLanguage Instance;
+
+ private FSharpLanguage() : base(Name, PresentableName) { }
+
+ protected FSharpLanguage([NotNull] string name) : base(name)
+ {
+ }
+
+ protected FSharpLanguage([NotNull] string name, [NotNull] string presentableName) : base(name, presentableName)
+ {
+ }
+ }
}
View
60 src/fsharper/Psi.FSharp/src/Impl/FSharpElementFactoryImpl.cs
@@ -1,31 +1,31 @@
-namespace JetBrains.ReSharper.Psi.FSharp.Impl
-{
- using Annotations;
- using ProjectModel;
- using CodeStyle;
- using JetBrains.Util;
-
- public class FSharpElementFactoryImpl : FSharpElementFactory
- {
- private readonly IPsiModule module;
- private readonly bool applyCodeFormatter;
- private readonly bool throwOnParseError;
- private readonly ISolution solution;
- private readonly IPsiServices psiServices;
- private readonly LanguageService languageService;
- private readonly IFSharpCodeFormatter codeFormatter;
-
- public FSharpElementFactoryImpl([NotNull] IPsiModule module, bool applyCodeFormatter, bool throwOnParseError)
- {
- this.module = module;
- this.applyCodeFormatter = applyCodeFormatter;
- this.throwOnParseError = throwOnParseError;
- solution = module.GetSolution();
- psiServices = solution.GetPsiServices();
- languageService = FSharpLanguage.Instance.LanguageService();
- Assertion.AssertNotNull(languageService, "languageService == null");
- codeFormatter = languageService.CodeFormatter as IFSharpCodeFormatter;
- Assertion.AssertNotNull(codeFormatter, "codeFormatter == null");
- }
- }
+namespace JetBrains.ReSharper.Psi.FSharp.Impl
+{
+ using Annotations;
+ using ProjectModel;
+ using CodeStyle;
+ using JetBrains.Util;
+
+ public class FSharpElementFactoryImpl : FSharpElementFactory
+ {
+ private readonly IPsiModule module;
+ private readonly bool applyCodeFormatter;
+ private readonly bool throwOnParseError;
+ private readonly ISolution solution;
+ private readonly IPsiServices psiServices;
+ private readonly LanguageService languageService;
+ private readonly IFSharpCodeFormatter codeFormatter;
+
+ public FSharpElementFactoryImpl([NotNull] IPsiModule module, bool applyCodeFormatter, bool throwOnParseError)
+ {
+ this.module = module;
+ this.applyCodeFormatter = applyCodeFormatter;
+ this.throwOnParseError = throwOnParseError;
+ solution = module.GetSolution();
+ psiServices = solution.GetPsiServices();
+ languageService = FSharpLanguage.Instance.LanguageService();
+ Assertion.AssertNotNull(languageService, "languageService == null");
+ codeFormatter = languageService.CodeFormatter as IFSharpCodeFormatter;
+ Assertion.AssertNotNull(codeFormatter, "codeFormatter == null");
+ }
+ }
}
View
88 src/fsharper/Psi.FSharp/src/Impl/Tree/FSharpExpressionBase.cs
@@ -1,45 +1,45 @@
-using JetBrains.ReSharper.Psi.ExtensionsAPI.Resolve.Managed;
-using JetBrains.ReSharper.Psi.FSharp.Tree;
-using JetBrains.ReSharper.Psi.FSharp.Tree.Impl;
-using JetBrains.ReSharper.Psi.Resolve;
-
-namespace JetBrains.ReSharper.Psi.FSharp.Tree.Impl
-{
- abstract class FSharpExpressionBase : FSharpCompositeElement, IFSharpExpression//, IManagedExpressionImpl, IAccessContext
- {
- }
-
- internal abstract class ReferenceExpressionBase : FSharpExpressionBase
- {
- }
-
- internal abstract class OperatorExpressionBase : FSharpExpressionBase
- {
- }
-
- internal abstract class TypeExpressionBase : FSharpExpressionBase
- {
- }
-
- // TODO: Is this an expression?
- internal abstract class PatternBase : FSharpExpressionBase
- {
- }
-
- internal abstract class TypeVariableScopeBase : FSharpCompositeElement
- {
- // TODO: What should this class do?
- }
-}
-
-// TODO: Define this to do something useful!
-namespace JetBrains.ReSharper.Psi.FSharp.Impl.InferenceCacheSupport
-{
- abstract class InferenceErrorBase : FSharpCompositeElement
- {
- }
-
- abstract class InferenceTypeBase : FSharpCompositeElement
- {
- }
+using JetBrains.ReSharper.Psi.ExtensionsAPI.Resolve.Managed;
+using JetBrains.ReSharper.Psi.FSharp.Tree;
+using JetBrains.ReSharper.Psi.FSharp.Tree.Impl;
+using JetBrains.ReSharper.Psi.Resolve;
+
+namespace JetBrains.ReSharper.Psi.FSharp.Tree.Impl
+{
+ abstract class FSharpExpressionBase : FSharpCompositeElement, IFSharpExpression//, IManagedExpressionImpl, IAccessContext
+ {
+ }
+
+ internal abstract class ReferenceExpressionBase : FSharpExpressionBase
+ {
+ }
+
+ internal abstract class OperatorExpressionBase : FSharpExpressionBase
+ {
+ }
+
+ internal abstract class TypeExpressionBase : FSharpExpressionBase
+ {
+ }
+
+ // TODO: Is this an expression?
+ internal abstract class PatternBase : FSharpExpressionBase
+ {
+ }
+
+ internal abstract class TypeVariableScopeBase : FSharpCompositeElement
+ {
+ // TODO: What should this class do?
+ }
+}
+
+// TODO: Define this to do something useful!
+namespace JetBrains.ReSharper.Psi.FSharp.Impl.InferenceCacheSupport
+{
+ abstract class InferenceErrorBase : FSharpCompositeElement
+ {
+ }
+
+ abstract class InferenceTypeBase : FSharpCompositeElement
+ {
+ }
}
View
662 src/fsharper/Psi.FSharp/src/Parsing/FSharpLexer.gen.lex
@@ -1,332 +1,332 @@
-using JetBrains;
-using JetBrains.ReSharper.Psi.Parsing;
-using JetBrains.Text;
-using JetBrains.Util;
-using System.Collections;
-
-%%
-
-%unicode
-
-%namespace JetBrains.ReSharper.Psi.FSharp.Parsing
-%class FSharpLexerGenerated
-%public
-%implements ILexer
-%function _locateToken
-%type TokenNodeType
-%eofval{
- currTokenType = null; return currTokenType;
-%eofval}
-
-NULL_CHAR=\u0000
-CARRIAGE_RETURN_CHAR=\u000D
-LINE_FEED_CHAR=\u000A
-NEW_LINE_PAIR={CARRIAGE_RETURN_CHAR}{LINE_FEED_CHAR}
-NEW_LINE_CHAR=({CARRIAGE_RETURN_CHAR}|{LINE_FEED_CHAR}|(\u0085)|(\u2028)|(\u2029))
-NOT_NEW_LINE=([^\u0085\u2028\u2029\u000D\u000A])
-NOT_NEW_LINE_NUMBER_WS=([^\#\u0085)\u2028\u2029\n\r\ \t\f\u0009\u000B\u000C])
-
-
-INPUT_CHARACTER={NOT_NEW_LINE}
-ASTERISKS="*"+
-
-%include ../../../../../tools/UnicodeGroupGenerator/Unicode.lex
-
-WHITE_SPACE_CHAR=({UNICODE_ZS}|(\u0009)|(\u000B)|(\u000C)|(\u200B)|(\uFEFF)|{NULL_CHAR})
-
-DELIMITED_COMMENT_SECTION=([^\*]|({ASTERISKS}[^\*\/]))
-UNFINISHED_DELIMITED_COMMENT="(*"{DELIMITED_COMMENT_SECTION}*
-DELIMITED_COMMENT={UNFINISHED_DELIMITED_COMMENT}{ASTERISKS}"/"
-
-SINGLE_LINE_COMMENT=("//"{INPUT_CHARACTER}*)
-
-DECIMAL_DIGIT=[0-9]
-HEX_DIGIT=({DECIMAL_DIGIT}|[A-Fa-f])
-OCT_DIGIT=[0-7]
-BIN_DIGIT=[0-1]
-INTEGER_TYPE_SUFFIX=([UuLl]|UL|Ul|uL|ul|LU|lU|Lu|lu)
-
-
-DECIMAL_INTEGER_LITERAL=({DECIMAL_DIGIT}+{INTEGER_TYPE_SUFFIX}?)
-HEXADECIMAL_INTEGER_LITERAL=(0[Xx]({HEX_DIGIT})*{INTEGER_TYPE_SUFFIX}?)
-
-
-EXPONENT_PART=([eE](([+-])?({DECIMAL_DIGIT})*))
-REAL_TYPE_SUFFIX=[FfDdMm]
-REAL_LITERAL=({DECIMAL_DIGIT}*"."{DECIMAL_DIGIT}+({EXPONENT_PART})?{REAL_TYPE_SUFFIX}?)|({DECIMAL_DIGIT}+({EXPONENT_PART}|({EXPONENT_PART}?{REAL_TYPE_SUFFIX})))
-
-SINGLE_CHARACTER=[^\'\\\u0085\u2028\u2029\u000D\u000A]
-SIMPLE_ESCAPE_SEQUENCE=(\\[\'\"\\0abfnrtv])
-HEXADECIMAL_ESCAPE_SEQUENCE=(\\x{HEX_DIGIT}({HEX_DIGIT}|{HEX_DIGIT}{HEX_DIGIT}|{HEX_DIGIT}{HEX_DIGIT}{HEX_DIGIT})?)
-UNICODE_ESCAPE_SEQUENCE=((\\u{HEX_DIGIT}{HEX_DIGIT}{HEX_DIGIT}{HEX_DIGIT})|(\\U{HEX_DIGIT}{HEX_DIGIT}{HEX_DIGIT}{HEX_DIGIT}{HEX_DIGIT}{HEX_DIGIT}{HEX_DIGIT}{HEX_DIGIT}))
-CHARACTER=({SINGLE_CHARACTER}|{SIMPLE_ESCAPE_SEQUENCE}|{HEXADECIMAL_ESCAPE_SEQUENCE}|{UNICODE_ESCAPE_SEQUENCE})
-BAD_ESCAPE_SEQUENCE=((\\u)|(\\[^\'\"\\0abfnrtv]))
-CHARACTER_LITERAL=\'({CHARACTER})\'
-UNFINISHED_CHARACTER_LITERAL=\'(({CHARACTER})|({BAD_ESCAPE_SEQUENCE}(\'?))|\')
-EXCEEDING_CHARACTER_LITERAL=\'{CHARACTER}({CHARACTER}|{BAD_ESCAPE_SEQUENCE})+\'
-BYTECHAR_LITERAL={CHARACTER_LITERAL}B
-
-DECIMAL_DIGIT_CHARACTER={UNICODE_ND}
-CONNECTING_CHARACTER={UNICODE_PC}
-COMBINING_CHARACTER=({UNICODE_MC}|{UNICODE_MN})
-FORMATTING_CHARACTER={UNICODE_CF}
-LETTER_CHARACTER=({UNICODE_LL}|{UNICODE_LM}|{UNICODE_LO}|{UNICODE_LT}|{UNICODE_LU}|{UNICODE_NL}|{UNICODE_ESCAPE_SEQUENCE})
-
-SINGLE_QUOTE=\'
-IDENTIFIER_SURROUNDED_BY_DOUBLE_BACKTICK=``([^`\n\r\t]|`[^`\n\r\t])+``
-IDENTIFIER_START_CHARACTER=({LETTER_CHARACTER}|(\u005F))
-IDENTIFIER_PART_CHARACTER=({LETTER_CHARACTER}|{DECIMAL_DIGIT_CHARACTER}|{CONNECTING_CHARACTER}|{COMBINING_CHARACTER}|{FORMATTING_CHARACTER}|{SINGLE_QUOTE})
-IDENTIFIER=({LETTER_CHARACTER}|{IDENTIFIER_START_CHARACTER}{IDENTIFIER_PART_CHARACTER}+|{IDENTIFIER_SURROUNDED_BY_DOUBLE_BACKTICK})
-
-TYPE_VARIABLE=\'{IDENTIFIER}
-
-REGULAR_STRING_LITERAL_CHARACTER=({SINGLE_REGULAR_STRING_LITERAL_CHARACTER}|{SIMPLE_ESCAPE_SEQUENCE}|{HEXADECIMAL_ESCAPE_SEQUENCE}|{UNICODE_ESCAPE_SEQUENCE})
-SINGLE_REGULAR_STRING_LITERAL_CHARACTER=[^\"\\\u0085\u2028\u2029\u000D\u000A]
-REGULAR_STRING_LITERAL=(\"{REGULAR_STRING_LITERAL_CHARACTER}*\")
-
-VERBATIM_STRING_LITERAL=(\@\"{VERBATIM_STRING_LITERAL_CHARACTER}*\")
-VERBATIM_STRING_LITERAL_CHARACTER=({SINGLE_VERBATIM_STRING_LITERAL_CHARACTER}|{QUOTE_ESCAPE_SEQUENCE})
-SINGLE_VERBATIM_STRING_LITERAL_CHARACTER=[^\"]
-QUOTE_ESCAPE_SEQUENCE=(\"\")
-
-TRIPLE_QUOTED_STRING=\"\"\"{SIMPLE_CHAR_OR_QUOTE_CHAR_SEQUENCE}*\"\"\"
-SIMPLE_CHAR_OR_QUOTE_CHAR_SEQUENCE=([^\"]|(\"[^\"])|(\"\"[^\"]))
-
-STRING_LITERAL=({REGULAR_STRING_LITERAL}|{VERBATIM_STRING_LITERAL}|{TRIPLE_QUOTED_STRING})
-UNFINISHED_REGULAR_STRING_LITERAL=(\"{REGULAR_STRING_LITERAL_CHARACTER}*)
-UNFINISHED_VERBATIM_STRING_LITERAL=(@\"{VERBATIM_STRING_LITERAL_CHARACTER}*)
-ERROR_REGULAR_STRING_LITERAL=(\"{REGULAR_STRING_LITERAL_CHARACTER}*{BAD_ESCAPE_SEQUENCE}({BAD_ESCAPE_SEQUENCE}|{REGULAR_STRING_LITERAL_CHARACTER})*\"?)
-ERROR_STRING_LITERAL=({UNFINISHED_REGULAR_STRING_LITERAL}|{UNFINISHED_VERBATIM_STRING_LITERAL}|{ERROR_REGULAR_STRING_LITERAL})
-
-BYTEARRAY_STRING_LITERAL=({REGULAR_STRING_LITERAL}|{VERBATIM_STRING_LITERAL})B
-
-HEX_LITERAL=(0[xX]{HEX_DIGIT}+)
-OCT_LITERAL=(0[oO]{OCT_DIGIT}+)
-BIN_LITERAL=(0[bB]{BIN_DIGIT}+)
-UINT_LITERAL = (({DECIMAL_DIGIT}+)|{HEX_LITERAL}|{OCT_LITERAL}|{BIN_LITERAL})
-INT_LITERAL = -?{UINT_LITERAL}
-
-INT8_LITERAL = {INT_LITERAL}y
-UINT8_LITERAL = {UINT_LITERAL}uy
-
-INT16_LITERAL = {INT_LITERAL}s
-UINT16_LITERAL = {UINT_LITERAL}us
-INT32_LITERAL = {INT_LITERAL}l
-UINT32_LITERAL = {UINT_LITERAL}ul?
-NATIVEINT_LITERAL = {INT_LITERAL}n
-UNATIVEINT_LITERAL = {UINT_LITERAL}un
-INT64_LITERAL = {INT_LITERAL}L
-UINT64_LITERAL = {UINT_LITERAL}[uU]L
-
-BIGNUM_LITERAL=({DECIMAL_DIGIT}+[QRZING])
-
-DECIMAL_LITERAL=((-?{DECIMAL_DIGIT}+)|{FLOAT_LITERAL})[Mm]
-
-FLOAT_LITERAL = ((-?{DECIMAL_DIGIT}+"."{DECIMAL_DIGIT}*)|(-?{DECIMAL_DIGIT}+("."{DECIMAL_DIGIT}*)?([eE])(([+-])?){DECIMAL_DIGIT}+))
-
-FLOAT32_LITERAL = (({FLOAT_LITERAL}[fF])|({HEX_LITERAL}lf)|({OCT_LITERAL}lf)|({BIN_LITERAL}lf))
-FLOAT64_LITERAL = (({FLOAT_LITERAL})|({HEX_LITERAL}LF)|({OCT_LITERAL}LF)|({BIN_LITERAL}LF))
-
-NOT_NUMBER_SIGN=[^#]
-PP_NUMBER_SIGN=#
-
-PP_BAD_DIRECTIVE=(define|undef|if|elif|else|endif|error|warning|region|endregion|line|pragma)({IDENTIFIER}|{DECIMAL_DIGIT})
-
-PP_FILENAME_CHARACTER=[^\"\r\n\u0085\u2028\u2029]
-
-PP_FILENAME=(\"{PP_FILENAME_CHARACTER}+\")
-PP_BAD_FILENAME=(\"{PP_FILENAME_CHARACTER}+)
-PP_DEC_DIGITS={DECIMAL_DIGIT}+
-
-PP_CONDITIONAL_SYMBOL={IDENTIFIER}
-
-WHITE_SPACE=({WHITE_SPACE_CHAR}+)
-END_LINE={NOT_NEW_LINE}*(({PP_NEW_LINE_PAIR})|({PP_NEW_LINE_CHAR}))
-
-PP_MESSAGE={INPUT_CHARACTER}*
-
-%state PPSHARP
-%state PPSYMBOL
-%state PPDIGITS
-%state PPMESSAGE
-
-%%
-
-<YYINITIAL> {INT_LITERAL} { currTokenType = makeToken (FSharpTokenType.INT_LITERAL); return currTokenType; }
-<YYINITIAL> {INT8_LITERAL} { currTokenType = makeToken (FSharpTokenType.INT8_LITERAL); return currTokenType; }
-<YYINITIAL> {UINT8_LITERAL} { currTokenType = makeToken (FSharpTokenType.UINT8_LITERAL); return currTokenType; }
-<YYINITIAL> {INT16_LITERAL} { currTokenType = makeToken (FSharpTokenType.INT16_LITERAL); return currTokenType; }
-<YYINITIAL> {UINT16_LITERAL} { currTokenType = makeToken (FSharpTokenType.UINT16_LITERAL); return currTokenType; }
-<YYINITIAL> {INT32_LITERAL} { currTokenType = makeToken (FSharpTokenType.INT32_LITERAL); return currTokenType; }
-<YYINITIAL> {UINT32_LITERAL} { currTokenType = makeToken (FSharpTokenType.UINT32_LITERAL); return currTokenType; }
-<YYINITIAL> {NATIVEINT_LITERAL} { currTokenType = makeToken (FSharpTokenType.NATIVEINT_LITERAL); return currTokenType; }
-<YYINITIAL> {UNATIVEINT_LITERAL} { currTokenType = makeToken (FSharpTokenType.UNATIVEINT_LITERAL); return currTokenType; }
-<YYINITIAL> {INT64_LITERAL} { currTokenType = makeToken (FSharpTokenType.INT64_LITERAL); return currTokenType; }
-<YYINITIAL> {UINT64_LITERAL} { currTokenType = makeToken (FSharpTokenType.UINT64_LITERAL); return currTokenType; }
-
-<YYINITIAL> {BIGNUM_LITERAL} { return makeToken(FSharpTokenType.BIGNUM_LITERAL); }
-<YYINITIAL> {DECIMAL_LITERAL} { return makeToken(FSharpTokenType.DECIMAL_LITERAL); }
-
-<YYINITIAL> {FLOAT32_LITERAL} { currTokenType = makeToken (FSharpTokenType.FLOAT_LITERAL); return currTokenType; }
-<YYINITIAL> {FLOAT64_LITERAL} { currTokenType = makeToken (FSharpTokenType.FLOAT_LITERAL); return currTokenType; }
-
-<YYINITIAL> {NEW_LINE_PAIR} { yybegin(YYINITIAL); return makeToken(FSharpTokenType.NEW_LINE); }
-<YYINITIAL> {NEW_LINE_CHAR} { yybegin(YYINITIAL); return makeToken(FSharpTokenType.NEW_LINE); }
-
-<YYINITIAL> {DELIMITED_COMMENT} { return makeToken(FSharpTokenType.C_STYLE_COMMENT); }
-<YYINITIAL> {SINGLE_LINE_COMMENT} { yybegin(YYINITIAL); return makeToken(FSharpTokenType.END_OF_LINE_COMMENT); }
-<YYINITIAL> {UNFINISHED_DELIMITED_COMMENT} { return makeToken(FSharpTokenType.C_STYLE_COMMENT); }
-
-<YYINITIAL> {CHARACTER_LITERAL} { currTokenType = makeToken (FSharpTokenType.CHARACTER_LITERAL); return currTokenType; }
-<YYINITIAL> {BYTECHAR_LITERAL} { currTokenType = makeToken (FSharpTokenType.UINT8_LITERAL); return currTokenType; }
-<YYINITIAL> {TYPE_VARIABLE} { currTokenType = makeToken (FSharpTokenType.TYPE_VARIABLE); return currTokenType; }
-<YYINITIAL> {BYTEARRAY_STRING_LITERAL} { currTokenType = makeToken (FSharpTokenType.BYTEARRAY_STRING_LITERAL); return currTokenType; }
-<YYINITIAL> {STRING_LITERAL} { currTokenType = makeToken (FSharpTokenType.STRING_LITERAL); return currTokenType; }
-
-<YYINITIAL> {WHITE_SPACE} { currTokenType = makeToken(FSharpTokenType.WHITE_SPACE); return currTokenType; }
-
-<YYINITIAL> {IDENTIFIER} { currTokenType = makeToken(getKeyword() ?? FSharpTokenType.IDENTIFIER); return currTokenType; }
-
-<YYINITIAL> "@" { currTokenType = makeToken(FSharpTokenType.AT); return currTokenType; }
-<YYINITIAL> "_" { currTokenType = makeToken(FSharpTokenType.UNDERSCORE); return currTokenType; }
-<YYINITIAL> "<@" { currTokenType = makeToken(FSharpTokenType.LQUOTE); return currTokenType; }
-<YYINITIAL> "<@@" { currTokenType = makeToken(FSharpTokenType.LDQUOTE); return currTokenType; }
-<YYINITIAL> "<|" { currTokenType = makeToken(FSharpTokenType.BACKWARD_PIPE); return currTokenType; }
-<YYINITIAL> "|>" { currTokenType = makeToken(FSharpTokenType.FORWARD_PIPE); return currTokenType; }
-<YYINITIAL> "@>" { currTokenType = makeToken(FSharpTokenType.RQUOTE); return currTokenType; }
-<YYINITIAL> "@@>" { currTokenType = makeToken(FSharpTokenType.RDQUOTE); return currTokenType; }
-<YYINITIAL> "&" { currTokenType = makeToken(FSharpTokenType.AMP); return currTokenType; }
-<YYINITIAL> "&&" { currTokenType = makeToken(FSharpTokenType.AMP_AMP); return currTokenType; }
-<YYINITIAL> "||" { currTokenType = makeToken(FSharpTokenType.BAR_BAR); return currTokenType; }
-<YYINITIAL> "\'" { currTokenType = makeToken(FSharpTokenType.QUOTE); return currTokenType; }
-<YYINITIAL> "(" { currTokenType = makeToken(FSharpTokenType.LPAREN); return currTokenType; }
-<YYINITIAL> ")" { currTokenType = makeToken(FSharpTokenType.RPAREN); return currTokenType; }
-<YYINITIAL> "**" { currTokenType = makeToken(FSharpTokenType.STAR_STAR); return currTokenType; }
-<YYINITIAL> "*" { currTokenType = makeToken(FSharpTokenType.STAR); return currTokenType; }
-<YYINITIAL> "," { currTokenType = makeToken(FSharpTokenType.COMMA); return currTokenType; }
-<YYINITIAL> "->" { currTokenType = makeToken(FSharpTokenType.RARROW); return currTokenType; }
-<YYINITIAL> "?" { currTokenType = makeToken(FSharpTokenType.QMARK); return currTokenType; }
-<YYINITIAL> "??" { currTokenType = makeToken(FSharpTokenType.QMARK_QMARK); return currTokenType; }
-<YYINITIAL> ".." { currTokenType = makeToken(FSharpTokenType.DOT_DOT); return currTokenType; }
-<YYINITIAL> "." { currTokenType = makeToken(FSharpTokenType.DOT); return currTokenType; }
-<YYINITIAL> ":" { currTokenType = makeToken(FSharpTokenType.COLON); return currTokenType; }
-<YYINITIAL> "::" { currTokenType = makeToken(FSharpTokenType.COLON_COLON); return currTokenType; }
-<YYINITIAL> ":>" { currTokenType = makeToken(FSharpTokenType.COLON_GREATER); return currTokenType; }
-<YYINITIAL> "@>." { currTokenType = makeToken(FSharpTokenType.RQUOTE_DOT); return currTokenType; }
-<YYINITIAL> "@@>." { currTokenType = makeToken(FSharpTokenType.RDQUOTE_DOT); return currTokenType; }
-<YYINITIAL> ">|]" { currTokenType = makeToken(FSharpTokenType.GREATER_BAR_RBRACK); return currTokenType; }
-<YYINITIAL> ":?>" { currTokenType = makeToken(FSharpTokenType.COLON_QMARK_GREATER); return currTokenType; }
-<YYINITIAL> ":?" { currTokenType = makeToken(FSharpTokenType.COLON_QMARK); return currTokenType; }
-<YYINITIAL> ":=" { currTokenType = makeToken(FSharpTokenType.COLON_EQUALS); return currTokenType; }
-<YYINITIAL> ";;" { currTokenType = makeToken(FSharpTokenType.SEMICOLON_SEMICOLON); return currTokenType; }
-<YYINITIAL> ";" { currTokenType = makeToken(FSharpTokenType.SEMICOLON); return currTokenType; }
-<YYINITIAL> "<-" { currTokenType = makeToken(FSharpTokenType.LARROW); return currTokenType; }
-<YYINITIAL> "=" { currTokenType = makeToken(FSharpTokenType.EQUALS); return currTokenType; }
-<YYINITIAL> "[" { currTokenType = makeToken(FSharpTokenType.LBRACK); return currTokenType; }
-<YYINITIAL> "[|" { currTokenType = makeToken(FSharpTokenType.LBRACK_BAR); return currTokenType; }
-<YYINITIAL> "[<" { currTokenType = makeToken(FSharpTokenType.LBRACK_LESS); return currTokenType; }
-<YYINITIAL> "]" { currTokenType = makeToken(FSharpTokenType.RBRACK); return currTokenType; }
-<YYINITIAL> "|]" { currTokenType = makeToken(FSharpTokenType.BAR_RBRACK); return currTokenType; }
-<YYINITIAL> ">]" { currTokenType = makeToken(FSharpTokenType.GREATER_RBRACK); return currTokenType; }
-<YYINITIAL> "{" { currTokenType = makeToken(FSharpTokenType.LBRACE); return currTokenType; }
-<YYINITIAL> "|" { currTokenType = makeToken(FSharpTokenType.BAR); return currTokenType; }
-<YYINITIAL> "}" { currTokenType = makeToken(FSharpTokenType.RBRACE); return currTokenType; }
-<YYINITIAL> "$" { currTokenType = makeToken(FSharpTokenType.DOLLAR); return currTokenType; }
-<YYINITIAL> "%%" { currTokenType = makeToken(FSharpTokenType.DPERCENT_OP); return currTokenType; }
-<YYINITIAL> "-" { currTokenType = makeToken(FSharpTokenType.MINUS); return currTokenType; }
-<YYINITIAL> "~" { currTokenType = makeToken(FSharpTokenType.TILDE); return currTokenType; }
-<YYINITIAL> "`" { currTokenType = makeToken(FSharpTokenType.RESERVED); return currTokenType; }
-<YYINITIAL> "<>" { currTokenType = makeToken(FSharpTokenType.LESS_GREATER); return currTokenType; }
-<YYINITIAL> "<=" { currTokenType = makeToken(FSharpTokenType.LESS_EQUALS); return currTokenType; }
-<YYINITIAL> ">=" { currTokenType = makeToken(FSharpTokenType.GREATER_EQUALS); return currTokenType; }
-<YYINITIAL> ">>" { currTokenType = makeToken(FSharpTokenType.GREATER_GREATER); return currTokenType; }
-<YYINITIAL> "<<" { currTokenType = makeToken(FSharpTokenType.LESS_LESS); return currTokenType; }
-
-
-<YYINITIAL> "{" { return makeToken(FSharpTokenType.LBRACE); }
-<YYINITIAL> "}" { return makeToken(FSharpTokenType.RBRACE); }
-<YYINITIAL> "[" { return makeToken(FSharpTokenType.LBRACKET); }
-<YYINITIAL> "]" { return makeToken(FSharpTokenType.RBRACKET); }
-<YYINITIAL> "(" { return makeToken(FSharpTokenType.LPARENTH); }
-<YYINITIAL> ")" { return makeToken(FSharpTokenType.RPARENTH); }
-<YYINITIAL> "." { return makeToken(FSharpTokenType.DOT); }
-<YYINITIAL> "," { return makeToken(FSharpTokenType.COMMA); }
-<YYINITIAL> ":" { return makeToken(FSharpTokenType.COLON); }
-<YYINITIAL> ";" { return makeToken(FSharpTokenType.SEMICOLON); }
-
-<YYINITIAL> "+" { return makeToken(FSharpTokenType.PLUS); }
-<YYINITIAL> "-" { return makeToken(FSharpTokenType.MINUS); }
-<YYINITIAL> "*" { return makeToken(FSharpTokenType.STAR); }
-<YYINITIAL> "/" { return makeToken(FSharpTokenType.DIV); }
-<YYINITIAL> "%" { return makeToken(FSharpTokenType.PERCENT); }
-<YYINITIAL> "&" { return makeToken(FSharpTokenType.AND); }
-<YYINITIAL> "|" { return makeToken(FSharpTokenType.OR); }
-<YYINITIAL> "^^^" { return makeToken(FSharpTokenType.BITWISE_XOR); }
-<YYINITIAL> "!" { return makeToken(FSharpTokenType.EXCLAMATION_OP); }
-<YYINITIAL> "~" { return makeToken(FSharpTokenType.TILDE); }
-
-<YYINITIAL> "=" { return makeToken(FSharpTokenType.EQ); }
-<YYINITIAL> "<" { currTokenType = makeToken(FSharpTokenType.LESS); return currTokenType; }
-<YYINITIAL> ">" { currTokenType = makeToken(FSharpTokenType.GREATER); return currTokenType; }
-<YYINITIAL> "?" { return makeToken(FSharpTokenType.QUEST); }
-
-<YYINITIAL> {REAL_LITERAL} { return makeToken(FSharpTokenType.FLOAT_LITERAL); }
-<YYINITIAL> {CHARACTER_LITERAL} { return makeToken(FSharpTokenType.CHARACTER_LITERAL); }
-<YYINITIAL> {UNFINISHED_CHARACTER_LITERAL} { return makeToken(FSharpTokenType.CHARACTER_LITERAL); }
-
-<YYINITIAL> {STRING_LITERAL} { return makeToken(FSharpTokenType.STRING_LITERAL); }
-<YYINITIAL> {ERROR_STRING_LITERAL} { return makeToken(FSharpTokenType.STRING_LITERAL); }
-
-<YYINITIAL> . { currTokenType = makeToken(FSharpTokenType.BAD_CHARACTER); return currTokenType; }
-
-<PPSHARP, PPSYMBOL, PPDIGITS, PPMESSAGE> {WHITE_SPACE} { return makeToken (FSharpTokenType.WHITE_SPACE); }
-
-<PPSHARP> "undef" { yybegin(PPSYMBOL); return makeToken(FSharpTokenType.PP_UNDEF_DECLARATION); }
-<PPSHARP> "define" { yybegin(PPSYMBOL); return makeToken(FSharpTokenType.PP_DEFINE_DECLARATION); }
-<PPSHARP> "if" { yybegin(PPSYMBOL); return makeToken(FSharpTokenType.PP_IF_SECTION); }
-<PPSHARP> "elif" { yybegin(PPSYMBOL); return makeToken(FSharpTokenType.PP_ELIF_SECTION); }
-<PPSHARP> "else" { yybegin(PPSYMBOL); return makeToken(FSharpTokenType.PP_ELSE_SECTION); }
-<PPSHARP> "endif" { yybegin(PPSYMBOL); return makeToken(FSharpTokenType.PP_ENDIF); }
-<PPSHARP> "error" { yybegin(PPMESSAGE); return makeToken(FSharpTokenType.PP_ERROR_DIAGNOSTIC); }
-<PPSHARP> "warning" { yybegin(PPMESSAGE); return makeToken(FSharpTokenType.PP_WARNING_DIAGNOSTIC); }
-<PPSHARP> "region" { yybegin(PPMESSAGE); return makeToken(FSharpTokenType.PP_START_REGION); }
-<PPSHARP> "endregion" { yybegin(PPMESSAGE); return makeToken(FSharpTokenType.PP_END_REGION); }
-<PPSHARP> "line" { yybegin(PPDIGITS); return makeToken(FSharpTokenType.PP_LINE); }
-<PPSHARP> "pragma" { yybegin(PPMESSAGE); return makeToken(FSharpTokenType.PP_PRAGMA); }
-<PPSHARP> "r" { yybegin(PPMESSAGE); return makeToken(FSharpTokenType.PP_R); }
-<PPSHARP> "q" { yybegin(PPMESSAGE); return makeToken(FSharpTokenType.PP_Q); }
-<PPSHARP> "i" { yybegin(PPMESSAGE); return makeToken(FSharpTokenType.PP_I); }
-<PPSHARP> "help" { yybegin(PPMESSAGE); return makeToken(FSharpTokenType.PP_HELP); }
-<PPSHARP> "load" { yybegin(PPMESSAGE); return makeToken(FSharpTokenType.PP_LOAD); }
-<PPSHARP> "light" { yybegin(PPMESSAGE); return makeToken(FSharpTokenType.PP_LIGHT); }
-<PPSHARP> "line" { yybegin(PPMESSAGE); return makeToken(FSharpTokenType.PP_LINE); }
-
-<PPSYMBOL> "||" { return makeToken(FSharpTokenType.PP_OR); }
-<PPSYMBOL> "&&" { return makeToken(FSharpTokenType.PP_AND); }
-<PPSYMBOL> "==" { return makeToken(FSharpTokenType.PP_EQU); }
-<PPSYMBOL> "!=" { return makeToken(FSharpTokenType.PP_NEQ); }
-<PPSYMBOL> "!" { return makeToken(FSharpTokenType.PP_NOT); }
-<PPSYMBOL> "true" { return makeToken(FSharpTokenType.PP_TRUE); }
-<PPSYMBOL> "false" { return makeToken (FSharpTokenType.PP_FALSE); }
-<PPSYMBOL> "(" { return makeToken(FSharpTokenType.PP_LPAR); }
-<PPSYMBOL> ")" { return makeToken(FSharpTokenType.PP_RPAR); }
-<PPSYMBOL> {PP_CONDITIONAL_SYMBOL} { return makeToken(FSharpTokenType.PP_CONDITIONAL_SYMBOL); }
-
-<PPDIGITS> {PP_DEC_DIGITS} { return makeToken(FSharpTokenType.PP_DEC_DIGITS); }
-<PPDIGITS> "," { return makeToken(FSharpTokenType.PP_COMMA); }
-<PPDIGITS> {PP_FILENAME} { return makeToken(FSharpTokenType.PP_FILENAME); }
-<PPDIGITS> {PP_BAD_FILENAME} { return makeToken(FSharpTokenType.PP_BAD_CHARACTER); }
-<PPDIGITS> "default" { return makeToken(FSharpTokenType.PP_DEFAULT); }
-<PPDIGITS> "hidden" { return makeToken(FSharpTokenType.PP_HIDDEN); }
-<PPDIGITS> {IDENTIFIER} { return makeToken(FSharpTokenType.PP_BAD_CHARACTER); }
-
-<PPMESSAGE> {PP_MESSAGE} { return makeToken(FSharpTokenType.PP_MESSAGE); }
-
-<PPSHARP, PPSYMBOL, PPDIGITS, PPMESSAGE> {SINGLE_LINE_COMMENT} { return makeToken(FSharpTokenType.END_OF_LINE_COMMENT); }
-<PPSHARP, PPSYMBOL, PPDIGITS, PPMESSAGE> {NEW_LINE_PAIR} { yybegin(YYINITIAL); return makeToken(FSharpTokenType.NEW_LINE); }
-<PPSHARP, PPSYMBOL, PPDIGITS, PPMESSAGE> {NEW_LINE_CHAR} { yybegin(YYINITIAL); return makeToken(FSharpTokenType.NEW_LINE); }
-
-<PPSHARP> {PP_BAD_DIRECTIVE} { yybegin(PPMESSAGE); return makeToken(FSharpTokenType.PP_BAD_DIRECTIVE); }
-<YYINITIAL> . { return makeToken(FSharpTokenType.BAD_CHARACTER); }
-<PPSHARP> . { yybegin(PPMESSAGE); return makeToken(FSharpTokenType.PP_BAD_DIRECTIVE); }
+using JetBrains;
+using JetBrains.ReSharper.Psi.Parsing;
+using JetBrains.Text;
+using JetBrains.Util;
+using System.Collections;
+
+%%
+
+%unicode
+
+%namespace JetBrains.ReSharper.Psi.FSharp.Parsing
+%class FSharpLexerGenerated
+%public
+%implements ILexer
+%function _locateToken
+%type TokenNodeType
+%eofval{
+ currTokenType = null; return currTokenType;
+%eofval}
+
+NULL_CHAR=\u0000
+CARRIAGE_RETURN_CHAR=\u000D
+LINE_FEED_CHAR=\u000A
+NEW_LINE_PAIR={CARRIAGE_RETURN_CHAR}{LINE_FEED_CHAR}
+NEW_LINE_CHAR=({CARRIAGE_RETURN_CHAR}|{LINE_FEED_CHAR}|(\u0085)|(\u2028)|(\u2029))
+NOT_NEW_LINE=([^\u0085\u2028\u2029\u000D\u000A])
+NOT_NEW_LINE_NUMBER_WS=([^\#\u0085)\u2028\u2029\n\r\ \t\f\u0009\u000B\u000C])
+
+
+INPUT_CHARACTER={NOT_NEW_LINE}
+ASTERISKS="*"+
+
+%include ../../../../../tools/UnicodeGroupGenerator/Unicode.lex
+
+WHITE_SPACE_CHAR=({UNICODE_ZS}|(\u0009)|(\u000B)|(\u000C)|(\u200B)|(\uFEFF)|{NULL_CHAR})
+
+DELIMITED_COMMENT_SECTION=([^\*]|({ASTERISKS}[^\*\/]))
+UNFINISHED_DELIMITED_COMMENT="(*"{DELIMITED_COMMENT_SECTION}*
+DELIMITED_COMMENT={UNFINISHED_DELIMITED_COMMENT}{ASTERISKS}"/"
+
+SINGLE_LINE_COMMENT=("//"{INPUT_CHARACTER}*)
+
+DECIMAL_DIGIT=[0-9]
+HEX_DIGIT=({DECIMAL_DIGIT}|[A-Fa-f])
+OCT_DIGIT=[0-7]
+BIN_DIGIT=[0-1]
+INTEGER_TYPE_SUFFIX=([UuLl]|UL|Ul|uL|ul|LU|lU|Lu|lu)
+
+
+DECIMAL_INTEGER_LITERAL=({DECIMAL_DIGIT}+{INTEGER_TYPE_SUFFIX}?)
+HEXADECIMAL_INTEGER_LITERAL=(0[Xx]({HEX_DIGIT})*{INTEGER_TYPE_SUFFIX}?)
+
+
+EXPONENT_PART=([eE](([+-])?({DECIMAL_DIGIT})*))
+REAL_TYPE_SUFFIX=[FfDdMm]
+REAL_LITERAL=({DECIMAL_DIGIT}*"."{DECIMAL_DIGIT}+({EXPONENT_PART})?{REAL_TYPE_SUFFIX}?)|({DECIMAL_DIGIT}+({EXPONENT_PART}|({EXPONENT_PART}?{REAL_TYPE_SUFFIX})))
+
+SINGLE_CHARACTER=[^\'\\\u0085\u2028\u2029\u000D\u000A]
+SIMPLE_ESCAPE_SEQUENCE=(\\[\'\"\\0abfnrtv])
+HEXADECIMAL_ESCAPE_SEQUENCE=(\\x{HEX_DIGIT}({HEX_DIGIT}|{HEX_DIGIT}{HEX_DIGIT}|{HEX_DIGIT}{HEX_DIGIT}{HEX_DIGIT})?)
+UNICODE_ESCAPE_SEQUENCE=((\\u{HEX_DIGIT}{HEX_DIGIT}{HEX_DIGIT}{HEX_DIGIT})|(\\U{HEX_DIGIT}{HEX_DIGIT}{HEX_DIGIT}{HEX_DIGIT}{HEX_DIGIT}{HEX_DIGIT}{HEX_DIGIT}{HEX_DIGIT}))
+CHARACTER=({SINGLE_CHARACTER}|{SIMPLE_ESCAPE_SEQUENCE}|{HEXADECIMAL_ESCAPE_SEQUENCE}|{UNICODE_ESCAPE_SEQUENCE})
+BAD_ESCAPE_SEQUENCE=((\\u)|(\\[^\'\"\\0abfnrtv]))
+CHARACTER_LITERAL=\'({CHARACTER})\'
+UNFINISHED_CHARACTER_LITERAL=\'(({CHARACTER})|({BAD_ESCAPE_SEQUENCE}(\'?))|\')
+EXCEEDING_CHARACTER_LITERAL=\'{CHARACTER}({CHARACTER}|{BAD_ESCAPE_SEQUENCE})+\'
+BYTECHAR_LITERAL={CHARACTER_LITERAL}B
+
+DECIMAL_DIGIT_CHARACTER={UNICODE_ND}
+CONNECTING_CHARACTER={UNICODE_PC}
+COMBINING_CHARACTER=({UNICODE_MC}|{UNICODE_MN})
+FORMATTING_CHARACTER={UNICODE_CF}
+LETTER_CHARACTER=({UNICODE_LL}|{UNICODE_LM}|{UNICODE_LO}|{UNICODE_LT}|{UNICODE_LU}|{UNICODE_NL}|{UNICODE_ESCAPE_SEQUENCE})
+
+SINGLE_QUOTE=\'
+IDENTIFIER_SURROUNDED_BY_DOUBLE_BACKTICK=``([^`\n\r\t]|`[^`\n\r\t])+``
+IDENTIFIER_START_CHARACTER=({LETTER_CHARACTER}|(\u005F))
+IDENTIFIER_PART_CHARACTER=({LETTER_CHARACTER}|{DECIMAL_DIGIT_CHARACTER}|{CONNECTING_CHARACTER}|{COMBINING_CHARACTER}|{FORMATTING_CHARACTER}|{SINGLE_QUOTE})
+IDENTIFIER=({LETTER_CHARACTER}|{IDENTIFIER_START_CHARACTER}{IDENTIFIER_PART_CHARACTER}+|{IDENTIFIER_SURROUNDED_BY_DOUBLE_BACKTICK})
+
+TYPE_VARIABLE=\'{IDENTIFIER}
+
+REGULAR_STRING_LITERAL_CHARACTER=({SINGLE_REGULAR_STRING_LITERAL_CHARACTER}|{SIMPLE_ESCAPE_SEQUENCE}|{HEXADECIMAL_ESCAPE_SEQUENCE}|{UNICODE_ESCAPE_SEQUENCE})
+SINGLE_REGULAR_STRING_LITERAL_CHARACTER=[^\"\\\u0085\u2028\u2029\u000D\u000A]
+REGULAR_STRING_LITERAL=(\"{REGULAR_STRING_LITERAL_CHARACTER}*\")
+
+VERBATIM_STRING_LITERAL=(\@\"{VERBATIM_STRING_LITERAL_CHARACTER}*\")
+VERBATIM_STRING_LITERAL_CHARACTER=({SINGLE_VERBATIM_STRING_LITERAL_CHARACTER}|{QUOTE_ESCAPE_SEQUENCE})
+SINGLE_VERBATIM_STRING_LITERAL_CHARACTER=[^\"]
+QUOTE_ESCAPE_SEQUENCE=(\"\")
+
+TRIPLE_QUOTED_STRING=\"\"\"{SIMPLE_CHAR_OR_QUOTE_CHAR_SEQUENCE}*\"\"\"
+SIMPLE_CHAR_OR_QUOTE_CHAR_SEQUENCE=([^\"]|(\"[^\"])|(\"\"[^\"]))
+
+STRING_LITERAL=({REGULAR_STRING_LITERAL}|{VERBATIM_STRING_LITERAL}|{TRIPLE_QUOTED_STRING})
+UNFINISHED_REGULAR_STRING_LITERAL=(\"{REGULAR_STRING_LITERAL_CHARACTER}*)
+UNFINISHED_VERBATIM_STRING_LITERAL=(@\"{VERBATIM_STRING_LITERAL_CHARACTER}*)
+ERROR_REGULAR_STRING_LITERAL=(\"{REGULAR_STRING_LITERAL_CHARACTER}*{BAD_ESCAPE_SEQUENCE}({BAD_ESCAPE_SEQUENCE}|{REGULAR_STRING_LITERAL_CHARACTER})*\"?)
+ERROR_STRING_LITERAL=({UNFINISHED_REGULAR_STRING_LITERAL}|{UNFINISHED_VERBATIM_STRING_LITERAL}|{ERROR_REGULAR_STRING_LITERAL})
+
+BYTEARRAY_STRING_LITERAL=({REGULAR_STRING_LITERAL}|{VERBATIM_STRING_LITERAL})B
+
+HEX_LITERAL=(0[xX]{HEX_DIGIT}+)
+OCT_LITERAL=(0[oO]{OCT_DIGIT}+)
+BIN_LITERAL=(0[bB]{BIN_DIGIT}+)
+UINT_LITERAL = (({DECIMAL_DIGIT}+)|{HEX_LITERAL}|{OCT_LITERAL}|{BIN_LITERAL})
+INT_LITERAL = -?{UINT_LITERAL}
+
+INT8_LITERAL = {INT_LITERAL}y
+UINT8_LITERAL = {UINT_LITERAL}uy
+
+INT16_LITERAL = {INT_LITERAL}s
+UINT16_LITERAL = {UINT_LITERAL}us
+INT32_LITERAL = {INT_LITERAL}l
+UINT32_LITERAL = {UINT_LITERAL}ul?
+NATIVEINT_LITERAL = {INT_LITERAL}n
+UNATIVEINT_LITERAL = {UINT_LITERAL}un
+INT64_LITERAL = {INT_LITERAL}L
+UINT64_LITERAL = {UINT_LITERAL}[uU]L
+
+BIGNUM_LITERAL=({DECIMAL_DIGIT}+[QRZING])
+
+DECIMAL_LITERAL=((-?{DECIMAL_DIGIT}+)|{FLOAT_LITERAL})[Mm]
+
+FLOAT_LITERAL = ((-?{DECIMAL_DIGIT}+"."{DECIMAL_DIGIT}*)|(-?{DECIMAL_DIGIT}+("."{DECIMAL_DIGIT}*)?([eE])(([+-])?){DECIMAL_DIGIT}+))
+
+FLOAT32_LITERAL = (({FLOAT_LITERAL}[fF])|({HEX_LITERAL}lf)|({OCT_LITERAL}lf)|({BIN_LITERAL}lf))
+FLOAT64_LITERAL = (({FLOAT_LITERAL})|({HEX_LITERAL}LF)|({OCT_LITERAL}LF)|({BIN_LITERAL}LF))
+
+NOT_NUMBER_SIGN=[^#]
+PP_NUMBER_SIGN=#
+
+PP_BAD_DIRECTIVE=(define|undef|if|elif|else|endif|error|warning|region|endregion|line|pragma)({IDENTIFIER}|{DECIMAL_DIGIT})
+
+PP_FILENAME_CHARACTER=[^\"\r\n\u0085\u2028\u2029]
+
+PP_FILENAME=(\"{PP_FILENAME_CHARACTER}+\")
+PP_BAD_FILENAME=(\"{PP_FILENAME_CHARACTER}+)
+PP_DEC_DIGITS={DECIMAL_DIGIT}+
+
+PP_CONDITIONAL_SYMBOL={IDENTIFIER}
+
+WHITE_SPACE=({WHITE_SPACE_CHAR}+)
+END_LINE={NOT_NEW_LINE}*(({PP_NEW_LINE_PAIR})|({PP_NEW_LINE_CHAR}))
+
+PP_MESSAGE={INPUT_CHARACTER}*
+
+%state PPSHARP
+%state PPSYMBOL
+%state PPDIGITS
+%state PPMESSAGE
+
+%%
+
+<YYINITIAL> {INT_LITERAL} { currTokenType = makeToken (FSharpTokenType.INT_LITERAL); return currTokenType; }
+<YYINITIAL> {INT8_LITERAL} { currTokenType = makeToken (FSharpTokenType.INT8_LITERAL); return currTokenType; }
+<YYINITIAL> {UINT8_LITERAL} { currTokenType = makeToken (FSharpTokenType.UINT8_LITERAL); return currTokenType; }
+<YYINITIAL> {INT16_LITERAL} { currTokenType = makeToken (FSharpTokenType.INT16_LITERAL); return currTokenType; }
+<YYINITIAL> {UINT16_LITERAL} { currTokenType = makeToken (FSharpTokenType.UINT16_LITERAL); return currTokenType; }
+<YYINITIAL> {INT32_LITERAL} { currTokenType = makeToken (FSharpTokenType.INT32_LITERAL); return currTokenType; }
+<YYINITIAL> {UINT32_LITERAL} { currTokenType = makeToken (FSharpTokenType.UINT32_LITERAL); return currTokenType; }
+<YYINITIAL> {NATIVEINT_LITERAL} { currTokenType = makeToken (FSharpTokenType.NATIVEINT_LITERAL); return currTokenType; }
+<YYINITIAL> {UNATIVEINT_LITERAL} { currTokenType = makeToken (FSharpTokenType.UNATIVEINT_LITERAL); return currTokenType; }
+<YYINITIAL> {INT64_LITERAL} { currTokenType = makeToken (FSharpTokenType.INT64_LITERAL); return currTokenType; }
+<YYINITIAL> {UINT64_LITERAL} { currTokenType = makeToken (FSharpTokenType.UINT64_LITERAL); return currTokenType; }
+
+<YYINITIAL> {BIGNUM_LITERAL} { return makeToken(FSharpTokenType.BIGNUM_LITERAL); }
+<YYINITIAL> {DECIMAL_LITERAL} { return makeToken(FSharpTokenType.DECIMAL_LITERAL); }
+
+<YYINITIAL> {FLOAT32_LITERAL} { currTokenType = makeToken (FSharpTokenType.FLOAT_LITERAL); return currTokenType; }
+<YYINITIAL> {FLOAT64_LITERAL} { currTokenType = makeToken (FSharpTokenType.FLOAT_LITERAL); return currTokenType; }
+
+<YYINITIAL> {NEW_LINE_PAIR} { yybegin(YYINITIAL); return makeToken(FSharpTokenType.NEW_LINE); }
+<YYINITIAL> {NEW_LINE_CHAR} { yybegin(YYINITIAL); return makeToken(FSharpTokenType.NEW_LINE); }
+
+<YYINITIAL> {DELIMITED_COMMENT} { return makeToken(FSharpTokenType.C_STYLE_COMMENT); }
+<YYINITIAL> {SINGLE_LINE_COMMENT} { yybegin(YYINITIAL); return makeToken(FSharpTokenType.END_OF_LINE_COMMENT); }
+<YYINITIAL> {UNFINISHED_DELIMITED_COMMENT} { return makeToken(FSharpTokenType.C_STYLE_COMMENT); }
+
+<YYINITIAL> {CHARACTER_LITERAL} { currTokenType = makeToken (FSharpTokenType.CHARACTER_LITERAL); return currTokenType; }
+<YYINITIAL> {BYTECHAR_LITERAL} { currTokenType = makeToken (FSharpTokenType.UINT8_LITERAL); return currTokenType; }
+<YYINITIAL> {TYPE_VARIABLE} { currTokenType = makeToken (FSharpTokenType.TYPE_VARIABLE); return currTokenType; }
+<YYINITIAL> {BYTEARRAY_STRING_LITERAL} { currTokenType = makeToken (FSharpTokenType.BYTEARRAY_STRING_LITERAL); return currTokenType; }
+<YYINITIAL> {STRING_LITERAL} { currTokenType = makeToken (FSharpTokenType.STRING_LITERAL); return currTokenType; }
+
+<YYINITIAL> {WHITE_SPACE} { currTokenType = makeToken(FSharpTokenType.WHITE_SPACE); return currTokenType; }
+
+<YYINITIAL> {IDENTIFIER} { currTokenType = makeToken(getKeyword() ?? FSharpTokenType.IDENTIFIER); return currTokenType; }
+
+<YYINITIAL> "@" { currTokenType = makeToken(FSharpTokenType.AT); return currTokenType; }
+<YYINITIAL> "_" { currTokenType = makeToken(FSharpTokenType.UNDERSCORE); return currTokenType; }
+<YYINITIAL> "<@" { currTokenType = makeToken(FSharpTokenType.LQUOTE); return currTokenType; }
+<YYINITIAL> "<@@" { currTokenType = makeToken(FSharpTokenType.LDQUOTE); return currTokenType; }
+<YYINITIAL> "<|" { currTokenType = makeToken(FSharpTokenType.BACKWARD_PIPE); return currTokenType; }
+<YYINITIAL> "|>" { currTokenType = makeToken(FSharpTokenType.FORWARD_PIPE); return currTokenType; }
+<YYINITIAL> "@>" { currTokenType = makeToken(FSharpTokenType.RQUOTE); return currTokenType; }
+<YYINITIAL> "@@>" { currTokenType = makeToken(FSharpTokenType.RDQUOTE); return currTokenType; }
+<YYINITIAL> "&" { currTokenType = makeToken(FSharpTokenType.AMP); return currTokenType; }
+<YYINITIAL> "&&" { currTokenType = makeToken(FSharpTokenType.AMP_AMP); return currTokenType; }
+<YYINITIAL> "||" { currTokenType = makeToken(FSharpTokenType.BAR_BAR); return currTokenType; }
+<YYINITIAL> "\'" { currTokenType = makeToken(FSharpTokenType.QUOTE); return currTokenType; }
+<YYINITIAL> "(" { currTokenType = makeToken(FSharpTokenType.LPAREN); return currTokenType; }
+<YYINITIAL> ")" { currTokenType = makeToken(FSharpTokenType.RPAREN); return currTokenType; }
+<YYINITIAL> "**" { currTokenType = makeToken(FSharpTokenType.STAR_STAR); return currTokenType; }
+<YYINITIAL> "*" { currTokenType = makeToken(FSharpTokenType.STAR); return currTokenType; }
+<YYINITIAL> "," { currTokenType = makeToken(FSharpTokenType.COMMA); return currTokenType; }
+<YYINITIAL> "->" { currTokenType = makeToken(FSharpTokenType.RARROW); return currTokenType; }
+<YYINITIAL> "?" { currTokenType = makeToken(FSharpTokenType.QMARK); return currTokenType; }
+<YYINITIAL> "??" { currTokenType = makeToken(FSharpTokenType.QMARK_QMARK); return currTokenType; }
+<YYINITIAL> ".." { currTokenType = makeToken(FSharpTokenType.DOT_DOT); return currTokenType; }
+<YYINITIAL> "." { currTokenType = makeToken(FSharpTokenType.DOT); return currTokenType; }
+<YYINITIAL> ":" { currTokenType = makeToken(FSharpTokenType.COLON); return currTokenType; }
+<YYINITIAL> "::" { currTokenType = makeToken(FSharpTokenType.COLON_COLON); return currTokenType; }
+<YYINITIAL> ":>" { currTokenType = makeToken(FSharpTokenType.COLON_GREATER); return currTokenType; }
+<YYINITIAL> "@>." { currTokenType = makeToken(FSharpTokenType.RQUOTE_DOT); return currTokenType; }
+<YYINITIAL> "@@>." { currTokenType = makeToken(FSharpTokenType.RDQUOTE_DOT); return currTokenType; }
+<YYINITIAL> ">|]" { currTokenType = makeToken(FSharpTokenType.GREATER_BAR_RBRACK); return currTokenType; }
+<YYINITIAL> ":?>" { currTokenType = makeToken(FSharpTokenType.COLON_QMARK_GREATER); return currTokenType; }
+<YYINITIAL> ":?" { currTokenType = makeToken(FSharpTokenType.COLON_QMARK); return currTokenType; }
+<YYINITIAL> ":=" { currTokenType = makeToken(FSharpTokenType.COLON_EQUALS); return currTokenType; }
+<YYINITIAL> ";;" { currTokenType = makeToken(FSharpTokenType.SEMICOLON_SEMICOLON); return currTokenType; }
+<YYINITIAL> ";" { currTokenType = makeToken(FSharpTokenType.SEMICOLON); return currTokenType; }
+<YYINITIAL> "<-" { currTokenType = makeToken(FSharpTokenType.LARROW); return currTokenType; }
+<YYINITIAL> "=" { currTokenType = makeToken(FSharpTokenType.EQUALS); return currTokenType; }
+<YYINITIAL> "[" { currTokenType = makeToken(FSharpTokenType.LBRACK); return currTokenType; }
+<YYINITIAL> "[|" { currTokenType = makeToken(FSharpTokenType.LBRACK_BAR); return currTokenType; }
+<YYINITIAL> "[<" { currTokenType = makeToken(FSharpTokenType.LBRACK_LESS); return currTokenType; }
+<YYINITIAL> "]" { currTokenType = makeToken(FSharpTokenType.RBRACK); return currTokenType; }
+<YYINITIAL> "|]" { currTokenType = makeToken(FSharpTokenType.BAR_RBRACK); return currTokenType; }
+<YYINITIAL> ">]" { currTokenType = makeToken(FSharpTokenType.GREATER_RBRACK); return currTokenType; }
+<YYINITIAL> "{" { currTokenType = makeToken(FSharpTokenType.LBRACE); return currTokenType; }
+<YYINITIAL> "|" { currTokenType = makeToken(FSharpTokenType.BAR); return currTokenType; }
+<YYINITIAL> "}" { currTokenType = makeToken(FSharpTokenType.RBRACE); return currTokenType; }
+<YYINITIAL> "$" { currTokenType = makeToken(FSharpTokenType.DOLLAR); return currTokenType; }
+<YYINITIAL> "%%" { currTokenType = makeToken(FSharpTokenType.DPERCENT_OP); return currTokenType; }
+<YYINITIAL> "-" { currTokenType = makeToken(FSharpTokenType.MINUS); return currTokenType; }
+<YYINITIAL> "~" { currTokenType = makeToken(FSharpTokenType.TILDE); return currTokenType; }
+<YYINITIAL> "`" { currTokenType = makeToken(FSharpTokenType.RESERVED); return currTokenType; }
+<YYINITIAL> "<>" { currTokenType = makeToken(FSharpTokenType.LESS_GREATER); return currTokenType; }
+<YYINITIAL> "<=" { currTokenType = makeToken(FSharpTokenType.LESS_EQUALS); return currTokenType; }
+<YYINITIAL> ">=" { currTokenType = makeToken(FSharpTokenType.GREATER_EQUALS); return currTokenType; }
+<YYINITIAL> ">>" { currTokenType = makeToken(FSharpTokenType.GREATER_GREATER); return currTokenType; }
+<YYINITIAL> "<<" { currTokenType = makeToken(FSharpTokenType.LESS_LESS); return currTokenType; }
+
+
+<YYINITIAL> "{" { return makeToken(FSharpTokenType.LBRACE); }
+<YYINITIAL> "}" { return makeToken(FSharpTokenType.RBRACE); }
+<YYINITIAL> "[" { return makeToken(FSharpTokenType.LBRACKET); }
+<YYINITIAL> "]" { return makeToken(FSharpTokenType.RBRACKET); }
+<YYINITIAL> "(" { return makeToken(FSharpTokenType.LPARENTH); }
+<YYINITIAL> ")" { return makeToken(FSharpTokenType.RPARENTH); }
+<YYINITIAL> "." { return makeToken(FSharpTokenType.DOT); }
+<YYINITIAL> "," { return makeToken(FSharpTokenType.COMMA); }
+<YYINITIAL> ":" { return makeToken(FSharpTokenType.COLON); }
+<YYINITIAL> ";" { return makeToken(FSharpTokenType.SEMICOLON); }
+
+<YYINITIAL> "+" { return makeToken(FSharpTokenType.PLUS); }
+<YYINITIAL> "-" { return makeToken(FSharpTokenType.MINUS); }
+<YYINITIAL> "*" { return makeToken(FSharpTokenType.STAR); }
+<YYINITIAL> "/" { return makeToken(FSharpTokenType.DIV); }
+<YYINITIAL> "%" { return makeToken(FSharpTokenType.PERCENT); }
+<YYINITIAL> "&" { return makeToken(FSharpTokenType.AND); }
+<YYINITIAL> "|" { return makeToken(FSharpTokenType.OR); }
+<YYINITIAL> "^^^" { return makeToken(FSharpTokenType.BITWISE_XOR); }
+<YYINITIAL> "!" { return makeToken(FSharpTokenType.EXCLAMATION_OP); }
+<YYINITIAL> "~" { return makeToken(FSharpTokenType.TILDE); }
+
+<YYINITIAL> "=" { return makeToken(FSharpTokenType.EQ); }
+<YYINITIAL> "<" { currTokenType = makeToken(FSharpTokenType.LESS); return currTokenType; }
+<YYINITIAL> ">" { currTokenType = makeToken(FSharpTokenType.GREATER); return currTokenType; }
+<YYINITIAL> "?" { return makeToken(FSharpTokenType.QUEST); }
+
+<YYINITIAL> {REAL_LITERAL} { return makeToken(FSharpTokenType.FLOAT_LITERAL); }
+<YYINITIAL> {CHARACTER_LITERAL} { return makeToken(FSharpTokenType.CHARACTER_LITERAL); }
+<YYINITIAL> {UNFINISHED_CHARACTER_LITERAL} { return makeToken(FSharpTokenType.CHARACTER_LITERAL); }
+
+<YYINITIAL> {STRING_LITERAL} { return makeToken(FSharpTokenType.STRING_LITERAL); }
+<YYINITIAL> {ERROR_STRING_LITERAL} { return makeToken(FSharpTokenType.STRING_LITERAL); }
+
+<YYINITIAL> . { currTokenType = makeToken(FSharpTokenType.BAD_CHARACTER); return currTokenType; }
+
+<PPSHARP, PPSYMBOL, PPDIGITS, PPMESSAGE> {WHITE_SPACE} { return makeToken (FSharpTokenType.WHITE_SPACE); }
+
+<PPSHARP> "undef" { yybegin(PPSYMBOL); return makeToken(FSharpTokenType.PP_UNDEF_DECLARATION); }
+<PPSHARP> "define" { yybegin(PPSYMBOL); return makeToken(FSharpTokenType.PP_DEFINE_DECLARATION); }
+<PPSHARP> "if" { yybegin(PPSYMBOL); return makeToken(FSharpTokenType.PP_IF_SECTION); }
+<PPSHARP> "elif" { yybegin(PPSYMBOL); return makeToken(FSharpTokenType.PP_ELIF_SECTION); }
+<PPSHARP> "else" { yybegin(PPSYMBOL); return makeToken(FSharpTokenType.PP_ELSE_SECTION); }
+<PPSHARP> "endif" { yybegin(PPSYMBOL); return makeToken(FSharpTokenType.PP_ENDIF); }
+<PPSHARP> "error" { yybegin(PPMESSAGE); return makeToken(FSharpTokenType.PP_ERROR_DIAGNOSTIC); }
+<PPSHARP> "warning" { yybegin(PPMESSAGE); return makeToken(FSharpTokenType.PP_WARNING_DIAGNOSTIC); }
+<PPSHARP> "region" { yybegin(PPMESSAGE); return makeToken(FSharpTokenType.PP_START_REGION); }
+<PPSHARP> "endregion" { yybegin(PPMESSAGE); return makeToken(FSharpTokenType.PP_END_REGION); }
+<PPSHARP> "line" { yybegin(PPDIGITS); return makeToken(FSharpTokenType.PP_LINE); }
+<PPSHARP> "pragma" { yybegin(PPMESSAGE); return makeToken(FSharpTokenType.PP_PRAGMA); }
+<PPSHARP> "r" { yybegin(PPMESSAGE); return makeToken(FSharpTokenType.PP_R); }
+<PPSHARP> "q" { yybegin(PPMESSAGE); return makeToken(FSharpTokenType.PP_Q); }
+<PPSHARP> "i" { yybegin(PPMESSAGE); return makeToken(FSharpTokenType.PP_I); }
+<PPSHARP> "help" { yybegin(PPMESSAGE); return makeToken(FSharpTokenType.PP_HELP); }
+<PPSHARP> "load" { yybegin(PPMESSAGE); return makeToken(FSharpTokenType.PP_LOAD); }
+<PPSHARP> "light" { yybegin(PPMESSAGE); return makeToken(FSharpTokenType.PP_LIGHT); }
+<PPSHARP> "line" { yybegin(PPMESSAGE); return makeToken(FSharpTokenType.PP_LINE); }
+
+<PPSYMBOL> "||" { return makeToken(FSharpTokenType.PP_OR); }
+<PPSYMBOL> "&&" { return makeToken(FSharpTokenType.PP_AND); }
+<PPSYMBOL> "==" { return makeToken(FSharpTokenType.PP_EQU); }
+<PPSYMBOL> "!=" { return makeToken(FSharpTokenType.PP_NEQ); }
+<PPSYMBOL> "!" { return makeToken(FSharpTokenType.PP_NOT); }
+<PPSYMBOL> "true" { return makeToken(FSharpTokenType.PP_TRUE); }
+<PPSYMBOL> "false" { return makeToken (FSharpTokenType.PP_FALSE); }
+<PPSYMBOL> "(" { return makeToken(FSharpTokenType.PP_LPAR); }
+<PPSYMBOL> ")" { return makeToken(FSharpTokenType.PP_RPAR); }
+<PPSYMBOL> {PP_CONDITIONAL_SYMBOL} { return makeToken(FSharpTokenType.PP_CONDITIONAL_SYMBOL); }
+
+<PPDIGITS> {PP_DEC_DIGITS} { return makeToken(FSharpTokenType.PP_DEC_DIGITS); }
+<PPDIGITS> "," { return makeToken(FSharpTokenType.PP_COMMA); }
+<PPDIGITS> {PP_FILENAME} { return makeToken(FSharpTokenType.PP_FILENAME); }
+<PPDIGITS> {PP_BAD_FILENAME} { return makeToken(FSharpTokenType.PP_BAD_CHARACTER); }
+<PPDIGITS> "default" { return makeToken(FSharpTokenType.PP_DEFAULT); }
+<PPDIGITS> "hidden" { return makeToken(FSharpTokenType.PP_HIDDEN); }
+<PPDIGITS> {IDENTIFIER} { return makeToken(FSharpTokenType.PP_BAD_CHARACTER); }
+
+<PPMESSAGE> {PP_MESSAGE} { return makeToken(FSharpTokenType.PP_MESSAGE); }
+
+<PPSHARP, PPSYMBOL, PPDIGITS, PPMESSAGE> {SINGLE_LINE_COMMENT} { return makeToken(FSharpTokenType.END_OF_LINE_COMMENT); }
+<PPSHARP, PPSYMBOL, PPDIGITS, PPMESSAGE> {NEW_LINE_PAIR} { yybegin(YYINITIAL); return makeToken(FSharpTokenType.NEW_LINE); }
+<PPSHARP, PPSYMBOL, PPDIGITS, PPMESSAGE> {NEW_LINE_CHAR} { yybegin(YYINITIAL); return makeToken(FSharpTokenType.NEW_LINE); }
+
+<PPSHARP> {PP_BAD_DIRECTIVE} { yybegin(PPMESSAGE); return makeToken(FSharpTokenType.PP_BAD_DIRECTIVE); }
+<YYINITIAL> . { return makeToken(FSharpTokenType.BAD_CHARACTER); }
+<PPSHARP> . { yybegin(PPMESSAGE); return makeToken(FSharpTokenType.PP_BAD_DIRECTIVE); }
<PPSYMBOL, PPDIGITS, PPMESSAGE> . { return makeToken(FSharpTokenType.PP_BAD_CHARACTER); }
View
2  src/fsharper/Psi.FSharp/src/Parsing/FSharpLexer.gen_lex.depends
@@ -1 +1 @@
-src\Parsing\../../../../../tools/UnicodeGroupGenerator/Unicode.lex
+src\Parsing\../../../../../tools/UnicodeGroupGenerator/Unicode.lex
View
496 src/fsharper/Psi.FSharp/src/Parsing/FSharpLexerGenerated.cs
@@ -1,249 +1,249 @@
-using System;
-using System.Collections.Generic;
-using JetBrains.ReSharper.Psi.ExtensionsAPI.Tree;
-using JetBrains.ReSharper.Psi.Parsing;
-using JetBrains.Text;
-using JetBrains.Util;
-
-namespace JetBrains.ReSharper.Psi.FSharp.Parsing
-{
- public partial class FSharpLexerGenerated : ILexer<FSharpLexerState>
- {
- private TokenNodeType currTokenType;
- protected static readonly Dictionary<string, TokenNodeType> keywords = new Dictionary<string, TokenNodeType>();
- protected static readonly Dictionary<NodeType, string> tokenTypesToText = new Dictionary<NodeType, string>();
- private static HashSet<string> bangKeywords = new HashSet<string>();
-
- static FSharpLexerGenerated()
- {
- Action<string, TokenNodeType> add = (k, v) => keywords.Add(k.ToLowerInvariant(), v);
- Action<string, TokenNodeType> addBang = (k, v) =>
- {
- add(k, v);
- bangKeywords.Add(k.ToLowerInvariant().Substring(0, k.Length - 1));
- };
-
- // Computation expression keywords
- addBang("LET!", FSharpTokenType.LET_BANG_KEYWORD);
- addBang("USE!", FSharpTokenType.USE_BANG_KEYWORD);
- addBang("DO!", FSharpTokenType.DO_BANG_KEYWORD);
- addBang("YIELD!", FSharpTokenType.YIELD_BANG_KEYWORD);
- addBang("RETURN!", FSharpTokenType.RETURN_BANG_KEYWORD);
-
- add("ABSTRACT", FSharpTokenType.ABSTRACT_KEYWORD);
- add("AND", FSharpTokenType.AND_KEYWORD);
- add("AS", FSharpTokenType.AS_KEYWORD);
- add("ASSERT", FSharpTokenType.ASSERT_KEYWORD);
- add("BASE", FSharpTokenType.BASE_KEYWORD);
- add("BEGIN", FSharpTokenType.BEGIN_KEYWORD);
- add("CLASS", FSharpTokenType.CLASS_KEYWORD);
- add("DEFAULT", FSharpTokenType.DEFAULT_KEYWORD);
- add("DELEGATE", FSharpTokenType.DELEGATE_KEYWORD);
- add("DO", FSharpTokenType.DO_KEYWORD);
- add("DONE", FSharpTokenType.DONE_KEYWORD);
- add("DOWNCAST", FSharpTokenType.DOWNCAST_KEYWORD);
- add("DOWNTO", FSharpTokenType.DOWNTO_KEYWORD);
- add("ELIF", FSharpTokenType.ELIF_KEYWORD);
- add("ELSE", FSharpTokenType.ELSE_KEYWORD);
- add("END", FSharpTokenType.END_KEYWORD);
- add("EXCEPTION", FSharpTokenType.EXCEPTION_KEYWORD);
- add("EXTERN", FSharpTokenType.EXTERN_KEYWORD);
- add("FINALLY", FSharpTokenType.FINALLY_KEYWORD);
- add("FOR", FSharpTokenType.FOR_KEYWORD);
- add("FUN", FSharpTokenType.FUN_KEYWORD);
- add("FUNCTION", FSharpTokenType.FUNCTION_KEYWORD);
- add("GLOBAL", FSharpTokenType.GLOBAL_KEYWORD);
- add("IF", FSharpTokenType.IF_KEYWORD);
- add("IN", FSharpTokenType.IN_KEYWORD);
- add("INHERIT", FSharpTokenType.INHERIT_KEYWORD);
- add("INLINE", FSharpTokenType.INLINE_KEYWORD);
- add("INTERFACE", FSharpTokenType.INTERFACE_KEYWORD);
- add("INTERNAL", FSharpTokenType.INTERNAL_KEYWORD);
- add("LAZY", FSharpTokenType.LAZY_KEYWORD);
- add("LET", FSharpTokenType.LET_KEYWORD);
- add("MATCH", FSharpTokenType.MATCH_KEYWORD);
- add("MEMBER", FSharpTokenType.MEMBER_KEYWORD);
- add("MODULE", FSharpTokenType.MODULE_KEYWORD);
- add("MUTABLE", FSharpTokenType.MUTABLE_KEYWORD);
- add("NAMESPACE", FSharpTokenType.NAMESPACE_KEYWORD);
- add("NEW", FSharpTokenType.NEW_KEYWORD);
- add("NOT", FSharpTokenType.NOT_KEYWORD);
- add("NULL", FSharpTokenType.NULL_KEYWORD);
- add("OF", FSharpTokenType.OF_KEYWORD);
- add("OPEN", FSharpTokenType.OPEN_KEYWORD);
- add("OR", FSharpTokenType.OR_KEYWORD);
- add("OVERRIDE", FSharpTokenType.OVERRIDE_KEYWORD);
- add("PRIVATE", FSharpTokenType.PRIVATE_KEYWORD);
- add("PUBLIC", FSharpTokenType.PUBLIC_KEYWORD);
- add("REC", FSharpTokenType.REC_KEYWORD);
- add("RETURN", FSharpTokenType.RETURN_KEYWORD);
- add("STATIC", FSharpTokenType.STATIC_KEYWORD);
- add("STRUCT", FSharpTokenType.STRUCT_KEYWORD);
- add("THEN", FSharpTokenType.THEN_KEYWORD);
- add("TO", FSharpTokenType.TO_KEYWORD);
- add("TRUE", FSharpTokenType.TRUE_KEYWORD);
- add("TRY", FSharpTokenType.TRY_KEYWORD);
- add("TYPE", FSharpTokenType.TYPE_KEYWORD);
- add("UPCAST", FSharpTokenType.UPCAST_KEYWORD);
- add("USE", FSharpTokenType.USE_KEYWORD);
- add("VAL", FSharpTokenType.VAL_KEYWORD);
- add("VOID", FSharpTokenType.VOID_KEYWORD);
- add("WHEN", FSharpTokenType.WHEN_KEYWORD);
- add("WHILE", FSharpTokenType.WHILE_KEYWORD);
- add("WITH", FSharpTokenType.WITH_KEYWORD);
- add("YIELD", FSharpTokenType.YIELD_KEYWORD);
-
- // ML keywords
- add("ASR", FSharpTokenType.ASR_ML_KEYWORD);
- add("LAND", FSharpTokenType.LAND_ML_KEYWORD);
- add("LOR", FSharpTokenType.LOR_ML_KEYWORD);
- add("LSL", FSharpTokenType.LSL_ML_KEYWORD);
- add("LSR", FSharpTokenType.LSR_ML_KEYWORD);
- add("LXOR", FSharpTokenType.LXOR_ML_KEYWORD);
- add("MOD", FSharpTokenType.MOD_ML_KEYWORD);
- add("SIG", FSharpTokenType.SIG_ML_KEYWORD);
-
- // reserved
- add("ATOMIC", FSharpTokenType.ATOMIC_RESERVED_KEYWORD);
- add("BREAK", FSharpTokenType.BREAK_RESERVED_KEYWORD);
- add("CHECKED", FSharpTokenType.CHECKED_RESERVED_KEYWORD);
- add("COMPONENT", FSharpTokenType.COMPONENT_RESERVED_KEYWORD);
- add("CONST", FSharpTokenType.CONST_RESERVED_KEYWORD);
- add("CONSTRAINT", FSharpTokenType.CONSTRAINT_RESERVED_KEYWORD);
- add("CONSTRUCTOR", FSharpTokenType.CONSTRUCTOR_RESERVED_KEYWORD);
- add("CONTINUE", FSharpTokenType.CONTINUE_RESERVED_KEYWORD);
- add("EAGER", FSharpTokenType.EAGER_RESERVED_KEYWORD);
- add("EVENT", FSharpTokenType.EVENT_RESERVED_KEYWORD);
- add("EXTERNAL", FSharpTokenType.EXTERNAL_RESERVED_KEYWORD);
- add("FIXED", FSharpTokenType.FIXED_RESERVED_KEYWORD);
- add("FUNCTOR", FSharpTokenType.FUNCTOR_RESERVED_KEYWORD);
- add("INCLUDE", FSharpTokenType.INCLUDE_RESERVED_KEYWORD);
- add("METHOD", FSharpTokenType.METHOD_RESERVED_KEYWORD);
- add("MIXIN", FSharpTokenType.MIXIN_RESERVED_KEYWORD);
- add("OBJECT", FSharpTokenType.OBJECT_RESERVED_KEYWORD);
- add("PARALLEL", FSharpTokenType.PARALLEL_RESERVED_KEYWORD);
- add("PROCESS", FSharpTokenType.PROCESS_RESERVED_KEYWORD);
- add("PROTECTED", FSharpTokenType.PROTECTED_RESERVED_KEYWORD);
- add("PURE", FSharpTokenType.PURE_RESERVED_KEYWORD);
- add("SEALED", FSharpTokenType.SEALED_RESERVED_KEYWORD);
- add("TAILCALL", FSharpTokenType.TAILCALL_RESERVED_KEYWORD);
- add("TRAIT", FSharpTokenType.TRAIT_RESERVED_KEYWORD);
- add("VIRTUAL", FSharpTokenType.VIRTUAL_RESERVED_KEYWORD);
- add("VOLATILE", FSharpTokenType.VOLATILE_RESERVED_KEYWORD);
-
- // object transformation ops (postfixed by OP because they are just too weird)
- add("BOX", FSharpTokenType.BOX_OP);
- add("HASH", FSharpTokenType.HASH_OP);
- add("SIZEOF", FSharpTokenType.SIZEOF_OP);
- add("TYPEOF", FSharpTokenType.TYPEOF_OP);
- add("TYPEDEFOF", FSharpTokenType.TYPEDEFOF_OP);
- add("UNBOX", FSharpTokenType.UNBOX_OP);
- add("REF", FSharpTokenType.REF_OP);
- }
-
- private TokenNodeType makeToken(TokenNodeType type)
- {
- return currTokenType = type;
- }
-
- public void Start()
- {
- Start(0, yy_buffer.Length, YYINITIAL);
- }
-
- private void Start(int startOffset, int endOffset, uint state)
- {
- yy_buffer_index = startOffset;
- yy_buffer_start = startOffset;
- yy_buffer_end = startOffset;
- yy_eof_pos = endOffset;
- yy_lexical_state = (int)state;
- currTokenType = null;
- }
-
- public void Advance()
- {
- locateToken();
- currTokenType = null;
- }
-
- public FSharpLexerState CurrentPosition
- {
- get
- {
- FSharpLexerState tokenPosition;
- tokenPosition.currTokenType = currTokenType;
- tokenPosition.yy_buffer_index = yy_buffer_index;
- tokenPosition.yy_buffer_start = yy_buffer_start;
- tokenPosition.yy_buffer_end = yy_buffer_end;
- tokenPosition.yy_lexical_state = yy_lexical_state;
- return tokenPosition;
- }
- set
- {
- currTokenType = value.currTokenType;
- yy_buffer_index = value.yy_buffer_index;
- yy_buffer_start = value.yy_buffer_start;
- yy_buffer_end = value.yy_buffer_end;
- yy_lexical_state = value.yy_lexical_state;
- }
- }
-
- object ILexer.CurrentPosition
- {
- get { return CurrentPosition; }
- set { CurrentPosition = (FSharpLexerState)value; }
- }
-
- public TokenNodeType TokenType
- {
- get
- {
- locateToken();
- return currTokenType;
- }
- }
-
- public int TokenStart
- {
- get
- {
- locateToken();
- return yy_buffer_start;
- }
- }
-
- public int TokenEnd
- {
- get
- {
- locateToken();
- return yy_buffer_end;
- }
- }
-
- public IBuffer Buffer { get { return yy_buffer; } }
-
- private void locateToken()
- {
- if (currTokenType == null)
- currTokenType = _locateToken();
- }
-
- internal TokenNodeType getKeyword()
- {
- var text = yytext();
-
- // if it's not a bang keyword, just yield it
- if (bangKeywords.Contains(text) &&
- yy_buffer_end < yy_buffer.Length &&
- yy_buffer[yy_buffer_end ] == '!')
- {
- yy_buffer_end++;
- yy_buffer_index++;
- return keywords.GetValue(text + '!');
- }
- return keywords.GetValueSafe(text);
- }
- }
+using System;
+using System.Collections.Generic;
+using JetBrains.ReSharper.Psi.ExtensionsAPI.Tree;
+using JetBrains.ReSharper.Psi.Parsing;
+using JetBrains.Text;
+using JetBrains.Util;
+
+namespace JetBrains.ReSharper.Psi.FSharp.Parsing
+{
+ public partial class FSharpLexerGenerated : ILexer<FSharpLexerState>
+ {
+ private TokenNodeType currTokenType;
+ protected static readonly Dictionary<string, TokenNodeType> keywords = new Dictionary<string, TokenNodeType>();
+ protected static readonly Dictionary<NodeType, string> tokenTypesToText = new Dictionary<NodeType, string>();
+ private static HashSet<string> bangKeywords = new HashSet<string>();
+
+ static FSharpLexerGenerated()
+ {
+ Action<string, TokenNodeType> add = (k, v) => keywords.Add(k.ToLowerInvariant(), v);
+ Action<string, TokenNodeType> addBang = (k, v) =>
+ {
+ add(k, v);
+ bangKeywords.Add(k.ToLowerInvariant().Substring(0, k.Length - 1));
+ };
+
+ // Computation expression keywords
+ addBang("LET!", FSharpTokenType.LET_BANG_KEYWORD);
+ addBang("USE!", FSharpTokenType.USE_BANG_KEYWORD);
+ addBang("DO!", FSharpTokenType.DO_BANG_KEYWORD);
+ addBang("YIELD!", FSharpTokenType.YIELD_BANG_KEYWORD);
+ addBang("RETURN!", FSharpTokenType.RETURN_BANG_KEYWORD);
+
+ add("ABSTRACT", FSharpTokenType.ABSTRACT_KEYWORD);
+ add("AND", FSharpTokenType.AND_KEYWORD);
+ add("AS", FSharpTokenType.AS_KEYWORD);
+ add("ASSERT", FSharpTokenType.ASSERT_KEYWORD);
+ add("BASE", FSharpTokenType.BASE_KEYWORD);
+ add("BEGIN", FSharpTokenType.BEGIN_KEYWORD);
+ add("CLASS", FSharpTokenType.CLASS_KEYWORD);
+ add("DEFAULT", FSharpTokenType.DEFAULT_KEYWORD);
+ add("DELEGATE", FSharpTokenType.DELEGATE_KEYWORD);
+ add("DO", FSharpTokenType.DO_KEYWORD);
+ add("DONE", FSharpTokenType.DONE_KEYWORD);