From: Mart Lubbers Date: Wed, 17 Feb 2016 14:25:27 +0000 (+0100) Subject: cleaned up lex X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=e82c306fc0f6401a09d3d180e20070664935a390;p=cc1516.git cleaned up lex --- diff --git a/.gitignore b/.gitignore index 490b9f4..b1b84c1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ Clean System Files -lex +main sapl diff --git a/lex.icl b/lex.icl index 0b6272c..6966cde 100644 --- a/lex.icl +++ b/lex.icl @@ -8,8 +8,6 @@ import StdString import StdBool import StdList import StdChar -import StdFile -import System.CommandLine import qualified Text SingleCharTokens :: Map Char Token @@ -34,11 +32,9 @@ lexer x = case lex x of lex :: [Char] -> (Either String Token, [Char]) lex [] = (Right EndOfFileToken, []) -//Comments lex ['/':'/':x:rest] = if (x == '\n') (lex rest) (lex ['/':'/':rest]) lex ['/':'*':x1:x2:rest] = if (x1 == '*' && x2 == '/') (lex rest) (lex ['/':'*':rest]) -//Keyword tokens lex ['v':'a':'r':rest] = (Right VarToken, rest) lex ['V':'o':'i':'d':rest] = (Right VoidToken, rest) lex ['r':'e':'t':'u':'r':'n':rest] = (Right ReturnToken, rest) @@ -50,7 +46,6 @@ lex ['F':'a':'l':'s':'e':rest] = (Right FalseToken, rest) lex ['I':'n':'t':rest] = (Right IntTypeToken, rest) lex ['C':'h':'a':'r':rest] = (Right CharTypeToken, rest) lex ['B':'o':'o':'l':rest] = (Right BoolTypeToken, rest) -//Two character tokens lex [':':':':rest] = (Right DoubleColonToken, rest) lex ['!':'=':rest] = (Right NotEqualToken, rest) lex ['<':'=':rest] = (Right LesserEqToken, rest) @@ -59,8 +54,6 @@ lex ['=':'=':rest] = (Right EqualsToken, rest) lex ['&':'&':rest] = (Right AmpersandsToken, rest) lex ['|':'|':rest] = (Right PipesToken, rest) lex ['-':'>':rest] = (Right ArrowToken, rest) -//One character tokens -//Value tokens lex ['\'':x:'\'':rest] = (Right (CharToken x), rest) lex ['\'':'\\':x:'\'':rest] = case get x EscapeMap of Just t = (Right (CharToken t), rest) diff --git a/main.prj b/main.prj index 5ed68bd..537dca6 100644 --- a/main.prj +++ b/main.prj @@ -574,20 +574,6 @@ OtherModules ReadableABC: False ReuseUniqueNodes: True Fusion: False - Module - Name: System.CommandLine - Dir: {Application}/lib/iTasks-SDK/Dependencies/clean-platform/src/libraries/OS-Independent - Compiler - NeverMemoryProfile: False - NeverTimeProfile: False - StrictnessAnalysis: True - ListTypes: StrictExportTypes - ListAttributes: True - Warnings: True - Verbose: True - ReadableABC: False - ReuseUniqueNodes: True - Fusion: False Module Name: System.IO Dir: {Application}/lib/iTasks-SDK/Dependencies/clean-platform/src/libraries/OS-Independent @@ -602,20 +588,6 @@ OtherModules ReadableABC: False ReuseUniqueNodes: True Fusion: False - Module - Name: System._Pointer - Dir: {Application}/lib/iTasks-SDK/Dependencies/clean-platform/src/libraries/OS-Independent - Compiler - NeverMemoryProfile: False - NeverTimeProfile: False - StrictnessAnalysis: True - ListTypes: StrictExportTypes - ListAttributes: True - Warnings: True - Verbose: True - ReadableABC: False - ReuseUniqueNodes: True - Fusion: False Module Name: Text Dir: {Application}/lib/iTasks-SDK/Dependencies/clean-platform/src/libraries/OS-Independent @@ -658,20 +630,6 @@ OtherModules ReadableABC: False ReuseUniqueNodes: True Fusion: False - Module - Name: System.OS - Dir: {Application}/lib/iTasks-SDK/Dependencies/clean-platform/src/libraries/OS-Linux-64 - Compiler - NeverMemoryProfile: False - NeverTimeProfile: False - StrictnessAnalysis: True - ListTypes: StrictExportTypes - ListAttributes: True - Warnings: True - Verbose: True - ReadableABC: False - ReuseUniqueNodes: True - Fusion: False Module Name: _SystemDynamic Dir: {Application}/lib/iTasks-SDK/Patches/Dynamics