Commit af9b4495 authored by Diederik van Arkel's avatar Diederik van Arkel

convert to 2.0 import syntax + minor extensions

parent a6e0ebd7
...@@ -21,16 +21,11 @@ definition module EdAction ...@@ -21,16 +21,11 @@ definition module EdAction
* EdAction.dcl: performing editor Actions * EdAction.dcl: performing editor Actions
*/ */
from EdSelection import Position, ColumnNr, LineNr import EdMonad, EdMovement
from EdText import TextFragment, StrictList import EdCommon
from EdSelection import :: Position
//1.3 from EdText import :: TextFragment
from EdText import String from EdActionType import :: Action
//3.1
import EdMonad, EdMovement
import EdCommon
from EdActionType import Action
performAction :: Action -> EditMonad (PSt PLocState) nothing performAction :: Action -> EditMonad (PSt PLocState) nothing
......
...@@ -17,9 +17,9 @@ definition module EdActionType ...@@ -17,9 +17,9 @@ definition module EdActionType
// permission. // permission.
//********************************************************************************* //*********************************************************************************
import StdOverloaded import StdOverloaded
import EdMovement import EdMovement
from EdText import TextFragment from EdText import :: TextFragment
:: Action :: Action
= Move Movement = Move Movement
......
...@@ -20,7 +20,7 @@ implementation module EdActionType ...@@ -20,7 +20,7 @@ implementation module EdActionType
import StdOverloaded, StdArray, StdInt, StdString, StdChar, StdList import StdOverloaded, StdArray, StdInt, StdString, StdChar, StdList
import StrictList import StrictList
import EdMovement import EdMovement
from EdText import TextFragment from EdText import :: TextFragment
:: Action :: Action
= Move Movement = Move Movement
......
...@@ -4,13 +4,10 @@ ...@@ -4,13 +4,10 @@
definition module EdFile definition module EdFile
from StdFile import FileSystem, Files from StdFile import class FileSystem
//1.3 from EdText import :: Text
from StdString import String
//3.1
from EdText import Text
import StdError, StdMaybe import StdError, StdMaybe
from UtilNewlinesFile import NewlineConvention from UtilNewlinesFile import :: NewlineConvention
readText :: !String !*env -> ((Error Text,NewlineConvention,Bool), !*env) | FileSystem env readText :: !String !*env -> ((Error Text,NewlineConvention,Bool), !*env) | FileSystem env
writeText :: !String !NewlineConvention !Text !*env -> (Maybe String, !*env) | FileSystem env writeText :: !String !NewlineConvention !Text !*env -> (Maybe String, !*env) | FileSystem env
......
definition module EdFind definition module EdFind
import StdString, StdMaybe import StdMaybe
from StrictList import StrictList from StrictList import :: StrictList
import EdSelection import EdSelection
simpleLineSearch :: simpleLineSearch ::
......
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
definition module EdKeyMapping definition module EdKeyMapping
from StdFile import Files from StdFile import :: Files
from StdPSt import PSt, IOSt from StdPSt import :: PSt
from StdIOCommon import KeyboardState, SpecialKey, KeyState, Modifiers from StdIOCommon import :: KeyboardState, :: SpecialKey
from StdMaybe import Maybe from StdMaybe import :: Maybe
from StdOverloaded import ==, toString, fromString from StdOverloaded import class ==, class toString, class fromString
from EdActionType import Action from EdActionType import :: Action
from EdMonad import EditMonad, EditState, StateM //from EdMonad import EditMonad, EditState, StateM
:: KeyMapping :: KeyMapping
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
definition module EdKeyboard definition module EdKeyboard
from StdIOCommon import KeyboardState, KeyState, SpecialKey, Modifiers, IsRepeatKey, IdFun from StdIOCommon import :: KeyboardState
from StdPSt import PSt, IOSt from StdPSt import :: PSt
from EdState import EditorState //from EdState import EditorState
from EdKeyMapping import KeyMapping from EdKeyMapping import :: KeyMapping
import EdMonad, StdMaybe import EdMonad, StdMaybe
import EdCommon import EdCommon
......
...@@ -6,7 +6,7 @@ implementation module EdKeyboard ...@@ -6,7 +6,7 @@ implementation module EdKeyboard
import StdClass, StdBool, StdArray, StdInt, StdChar, StdTuple, StdList, StdMisc import StdClass, StdBool, StdArray, StdInt, StdChar, StdTuple, StdList, StdMisc
import StdIOCommon, StdWindow, StdPSt import StdIOCommon, StdWindow, StdPSt
import EdVisualText, EdVisualCursor, import EdVisualText, EdVisualCursor, EdSelection,
EdAction, EdKeyMapping, EdState, StrictList EdAction, EdKeyMapping, EdState, StrictList
import EdActionType import EdActionType
......
...@@ -4,12 +4,8 @@ ...@@ -4,12 +4,8 @@
definition module EdLineText definition module EdLineText
from StrictList import StrictList from StrictList import :: StrictList
from EdPosition import LineNr from EdPosition import :: LineNr
//1.3
from StdString import String
//3.1
:: Text :: Text
:: TextFragment :: TextFragment
......
...@@ -6,7 +6,7 @@ implementation module EdLineText ...@@ -6,7 +6,7 @@ implementation module EdLineText
import StdString, StdClass, StdInt, StdList, StdBool, StdFunc, StdArray, StdTuple import StdString, StdClass, StdInt, StdList, StdBool, StdFunc, StdArray, StdTuple
import StrictList import StrictList
from EdPosition import LineNr from EdPosition import :: LineNr
import syncol import syncol
import Platform import Platform
......
...@@ -4,15 +4,8 @@ ...@@ -4,15 +4,8 @@
definition module EdLook definition module EdLook
from StdPicture import Picture from StdPicture import :: Picture
from StdIOCommon import SelectState, UpdateState, ViewFrame, UpdateArea, from StdIOCommon import :: SelectState, :: UpdateState
Rectangle, Point2
from StdPicture import FontName, FontSize, FontStyle,
FontDef, FontMetrics, Font
//1.3
from StdString import String
//3.1
from StdPSt import PSt, IOSt
import EdMonad import EdMonad
editWindowLook :: EditState SelectState !UpdateState -> (!*Picture -> *Picture) editWindowLook :: EditState SelectState !UpdateState -> (!*Picture -> *Picture)
......
...@@ -7,7 +7,7 @@ implementation module EdLook ...@@ -7,7 +7,7 @@ implementation module EdLook
import StdInt, StdBool, StdClass import StdInt, StdBool, StdClass
import StdIOCommon import StdIOCommon
import StdPicture import StdPicture
import EdVisualText, EdVisualCursor, EdVisualLineNr import EdVisualText, EdVisualCursor, EdVisualLineNr, EdSelection
// editWindowLook: updating the affected areas is done by updating // editWindowLook: updating the affected areas is done by updating
// each of the rectangles. // each of the rectangles.
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
definition module EdMessage definition module EdMessage
from StdId import Id,RId,Ids from StdId import class Ids
from StdPSt import PSt, IOSt from StdPSt import :: PSt
from StdReceiver import Receiver2, R2Id, Receiver2Function, ReceiverAttribute from StdReceiver import :: Receiver2
from EdMonad import EditState, EditMonad, StateM from EdMonad import :: EditState, :: EditMonad, :: StateM
:: EditId :: EditId
:: Message :: Message
......
...@@ -4,22 +4,19 @@ ...@@ -4,22 +4,19 @@
definition module EdMonad definition module EdMonad
//1.3 from StdPicture import :: Font, :: FontMetrics, :: Colour
from StdString import String from StdPSt import :: PSt, :: IOSt
//3.1 from StdId import :: Id
from StdPicture import Font, FontMetrics, Colour from StdPicture import :: Picture
from StdPSt import PSt, IOSt from StdClipboard import :: ClipboardItem
from StdId import Id from StdOverloaded import class ==, class toString
from StdPicture import Picture from StdMaybe import :: Maybe
from StdClipboard import ClipboardItem
from StdOverloaded import ==, toString
from StdMaybe import Maybe
import StateMonad import StateMonad
from UtilNewlinesFile import NewlineConvention from UtilNewlinesFile import :: NewlineConvention
from EdText import Text, StrictList, TextFragment from EdText import :: Text, :: StrictList, :: TextFragment
from EdSelection import Selection, Position, ColumnNr, LineNr from EdSelection import :: Selection, :: Position, :: ColumnNr, :: LineNr
:: TabSize :== Int :: TabSize :== Int
...@@ -135,7 +132,7 @@ pathNameToWindowTitle :: !String -> String ...@@ -135,7 +132,7 @@ pathNameToWindowTitle :: !String -> String
pathNameToWindowTitle` :: !String -> String pathNameToWindowTitle` :: !String -> String
//-- P4 //-- P4
from StdIOBasic import Point2 from StdIOBasic import :: Point2
getTimerId :: EditMonad .env Id getTimerId :: EditMonad .env Id
getToolPt :: EditMonad .env Point2 getToolPt :: EditMonad .env Point2
......
...@@ -21,8 +21,8 @@ definition module EdMouse ...@@ -21,8 +21,8 @@ definition module EdMouse
* EdMouse.dcl: handling mouse events * EdMouse.dcl: handling mouse events
*/ */
from StdIOCommon import MouseState, Point2, Modifiers from StdIOCommon import :: MouseState
from StdPSt import PSt, IOSt from StdPSt import :: PSt
import EdMonad, EdCommon import EdMonad, EdCommon
editWindowMouse :: MouseState (!EditState, !PSt PLocState) -> (EditState, PSt PLocState) editWindowMouse :: MouseState (!EditState, !PSt PLocState) -> (EditState, PSt PLocState)
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
definition module EdMovement definition module EdMovement
from StdClass import ==, toString, fromString from StdClass import class ==, class toString, class fromString
from EdSelection import Position, ColumnNr, LineNr from EdSelection import :: Position, :: ColumnNr, :: LineNr
import EdMonad import EdMonad
:: Movement :: Movement
......
...@@ -6,7 +6,7 @@ implementation module EdMovement ...@@ -6,7 +6,7 @@ implementation module EdMovement
import StdMisc, StdInt, StdTuple, StdArray, StdChar, StdBool, StdList, StdFunc import StdMisc, StdInt, StdTuple, StdArray, StdChar, StdBool, StdList, StdFunc
import StdIOCommon, StdPSt import StdIOCommon, StdPSt
import EdMonad, EdVisualText import EdMonad, EdVisualText, EdSelection
:: Movement :: Movement
= LineUp = LineUp
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
definition module EdPosition definition module EdPosition
from StdClass import <, == from StdClass import class <, class ==
:: Position :: Position
= { col :: ColumnNr = { col :: ColumnNr
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
definition module EdSelection definition module EdSelection
import EdPosition import EdPosition
from EdLineText import Text from EdLineText import :: Text
:: Selection :: Selection
= { start :: Position = { start :: Position
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
definition module EdState definition module EdState
from StdId import Id from StdId import :: Id
from StdPSt import PSt, IOSt from StdPSt import :: PSt
from StdMaybe import Maybe from StdMaybe import :: Maybe
from EdKeyMapping import KeyMapping from EdKeyMapping import :: KeyMapping
from EdMonad import EditState //from EdMonad import EditState
from EdMessage import EditId from EdMessage import :: EditId
class Editor env class Editor env
where where
......
...@@ -4,13 +4,9 @@ ...@@ -4,13 +4,9 @@
definition module EdTab definition module EdTab
//1.3 from StdIOCommon import :: Point2
from StdString import String from StdPicture import :: Picture
//3.1 from EdMonad import :: FontInfo
from StdIOCommon import Point2
from StdPicture import Picture
from StdPicture import Font, FontMetrics, FontName, FontSize, FontStyle, FontDef
from EdMonad import FontInfo, TabSize, NewTabSize, SyntaxColours, Colour
splitAtTabs :: !String -> .[String] splitAtTabs :: !String -> .[String]
// splitAtTabs: splits a string into several strings that were // splitAtTabs: splits a string into several strings that were
......
...@@ -4,11 +4,9 @@ ...@@ -4,11 +4,9 @@
definition module EdText definition module EdText
//1.3
from StdString import String
//3.1
import StdMaybe import StdMaybe
from EdSelection import Selection, Position, ColumnNr, LineNr from EdSelection import :: Selection, :: Position, :: ColumnNr, :: LineNr
import EdLineText import EdLineText
getTextFragment :: !Selection !Text -> (!TextFragment, !Text) getTextFragment :: !Selection !Text -> (!TextFragment, !Text)
......
...@@ -21,9 +21,10 @@ definition module EdVisualCursor ...@@ -21,9 +21,10 @@ definition module EdVisualCursor
* EdVisualCursor.dcl: visual operations on the cursor and selections * EdVisualCursor.dcl: visual operations on the cursor and selections
*/ */
from StdIOCommon import ViewFrame, Rectangle, Point2 from StdIOCommon import :: ViewFrame, :: Rectangle, :: Point2
import EdMonad, EdMovement import EdMonad, EdMovement
vUpdateCursor :: !Bool !Position !Int !FontInfo !Text !ViewFrame ![Rectangle] vUpdateCursor :: !Bool !Position !Int !FontInfo !Text !ViewFrame ![Rectangle]
-> (*Picture -> *Picture) -> (*Picture -> *Picture)
// vUpdateCursor: updates the cursor // vUpdateCursor: updates the cursor
......
...@@ -2,15 +2,13 @@ definition module EdVisualText ...@@ -2,15 +2,13 @@ definition module EdVisualText
// EdVisualText.dcl: visual operations on texts // EdVisualText.dcl: visual operations on texts
from StdIOCommon import ViewFrame, Rectangle, Point2, ViewDomain from StdIOCommon import :: ViewFrame, :: Rectangle, :: Point2, :: ViewDomain
from EdText import TextFragment, StrictList, stringsToString, from EdText import :: TextFragment, :: StrictList, stringsToString,
getTextFragment, stringToStrings, getLine, textLength, getTextFragment, stringToStrings, getLine, textLength,
newText, emptyText, stringsToText, updateLine, lastLineNr newText, emptyText, stringsToText, updateLine, lastLineNr
from StdPicture import Picture, FontName, FontSize, FontStyle, FontDef from StdPicture import :: Picture, :: FontName
import EdMonad import EdMonad
//1.3
from StdString import String
//3.1
vUpdateText :: !FontInfo !Text !ViewFrame ![Rectangle] -> (*Picture -> *Picture) vUpdateText :: !FontInfo !Text !ViewFrame ![Rectangle] -> (*Picture -> *Picture)
// vUpdateText: updates the text in the rectangles within // vUpdateText: updates the text in the rectangles within
......
...@@ -6,7 +6,7 @@ implementation module EdVisualText ...@@ -6,7 +6,7 @@ implementation module EdVisualText
import StdClass, StdFunc, StdArray, StdInt, StdMisc, StdList import StdClass, StdFunc, StdArray, StdInt, StdMisc, StdList
import StdIOCommon, StdPicture, StdPSt, StdWindow import StdIOCommon, StdPicture, StdPSt, StdWindow
import EdText, EdTab, StrictList, EdMonad import EdText, EdTab, StrictList, EdMonad, EdSelection
//-- util //-- util
......
...@@ -4,16 +4,12 @@ ...@@ -4,16 +4,12 @@
definition module EdWindow definition module EdWindow
//1.3 from StdWindow import :: Title, :: WindowAttribute
from StdString import String from StdPSt import :: PSt
//3.1 from StdId import :: Id
from StdWindow import Title, WindowAttribute from StdPicture import :: Font
from StdPSt import PSt, IOSt from EdText import :: Text
from StdId import Id from EdState import class Editor
from StdPicture import Font
from StdIOCommon import MouseState
from EdText import Text
from EdState import EditorState,Editor
import EdMonad, StdIOBasic, StdMaybe import EdMonad, StdIOBasic, StdMaybe
......
...@@ -22,12 +22,12 @@ definition module EdClient ...@@ -22,12 +22,12 @@ definition module EdClient
*/ */
import StdMaybe, StdId, StdPSt, StdPicture, StdPrint import StdMaybe, StdId, StdPSt, StdPicture, StdPrint
from EdState import Editor, EditorState from EdState import class Editor, :: EditorState
from EdMessage import EditId, EditAction from EdMessage import :: EditId, :: EditAction
from EdLineText import Text from EdLineText import :: Text
import EdPosition import EdPosition
from EdSelection import Selection, emptySelection, lineSelection from EdSelection import :: Selection, emptySelection, lineSelection
from EdMonad import UndoState, EditMonad, EditState, StateM, getPathName from EdMonad import :: UndoState, :: EditMonad, :: EditState, :: StateM, getPathName
import IdeState import IdeState
isEditWin :: Id *(PSt *l) -> *(Bool,*PSt *l) | Editor l isEditWin :: Id *(PSt *l) -> *(Bool,*PSt *l) | Editor l
......
definition module EdCommon definition module EdCommon
import EdMonad import EdMonad
from IdeState import General from IdeState import :: General
:: *PLocState :== General :: *PLocState :== General
......
...@@ -5,10 +5,7 @@ import StrictList ...@@ -5,10 +5,7 @@ import StrictList
import IdeState import IdeState
import PmParse, PmPath import PmParse, PmPath
import StdMenuElement import StdMenuElement
import search, EdMovement, EdVisualCursor
from search import sr_find_def_imp_sel,FindBoxInfo,Pathname,SearchType,ExtListBoxId,MessageIn,MessageOut,SearchImports
from EdMovement import selectWordAt
from EdVisualCursor import vChangeSelectionTo
:: *PLocState :== General :: *PLocState :== General
......
...@@ -18,10 +18,10 @@ definition module IDE ...@@ -18,10 +18,10 @@ definition module IDE
//********************************************************************************* //*********************************************************************************
import StdPSt import StdPSt
from PmTypes import Modulename