From 4505f798844949021d529670dde91dcd0d22f9cd Mon Sep 17 00:00:00 2001 From: alimarin Date: Mon, 3 Jun 2002 09:49:30 +0000 Subject: added constructor/type/field information to generics git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1079 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d --- frontend/scanner.icl | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'frontend/scanner.icl') diff --git a/frontend/scanner.icl b/frontend/scanner.icl index bdd168e..5930c1e 100644 --- a/frontend/scanner.icl +++ b/frontend/scanner.icl @@ -196,6 +196,7 @@ ScanOptionNoNewOffsideForSeqLetBit:==4; | DeriveToken // derive | GenericOpenToken // {| | GenericCloseToken // |} + | GenericOfToken // of | ExistsToken // E. | ForAllToken // A. @@ -206,6 +207,7 @@ ScanOptionNoNewOffsideForSeqLetBit:==4; | TypeContext | FunctionContext | CodeContext + | GenericContext instance == ScanContext where @@ -794,6 +796,7 @@ CheckReserved GeneralContext s i = CheckGeneralContext s i CheckReserved TypeContext s i = CheckTypeContext s i CheckReserved FunctionContext s i = CheckFunctContext s i CheckReserved CodeContext s i = CheckCodeContext s i +CheckReserved GenericContext s i = CheckGenericContext s i CheckGeneralContext :: !String !Input -> (!Token, !Input) CheckGeneralContext s input @@ -846,6 +849,7 @@ CheckTypeContext s input "Dynamic" -> (DynamicTypeToken , input) "special" -> (SpecialToken , input) "from" -> (FromToken , input) + "of" -> (GenericOfToken , input) // AA s -> CheckEveryContext s input CheckFunctContext :: !String !Input -> (!Token, !Input) @@ -873,6 +877,12 @@ CheckCodeContext s input "inline" -> (InlineToken , input) s -> CheckEveryContext s input +CheckGenericContext :: !String !Input -> (!Token, !Input) +CheckGenericContext s input + = case s of + "of" -> (GenericOfToken , input) + s -> CheckEveryContext s input + GetPrio :: !Input -> (!Optional String, !Int, !Input) GetPrio input # (error, c, input) = SkipWhites input -- cgit v1.2.3