Skip to content

Commit ec1fe7b

Browse files
committed
[[ Cleanup ]] Remove compile methods and methodinfo globals
This patch removes the compile methods and methodinfo globals as there is a better way to implement this functionality using templates, thus avoiding hand-coding.
1 parent 0c6d117 commit ec1fe7b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+106
-9469
lines changed

engine/engine-sources.gypi

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -584,10 +584,6 @@
584584
'src/mblandroid-theme.cpp',
585585
'src/mbliphone-theme.mm',
586586
'src/windows-theme.cpp',
587-
588-
# Group "Syntax"
589-
'src/syntax.h',
590-
'src/syntax.cpp',
591587

592588
# Other files
593589
'src/socket_resolve.cpp',

engine/src/answer.cpp

Lines changed: 0 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
4343
#include "printer.h"
4444

4545
#include "exec.h"
46-
#include "syntax.h"
4746

4847
#include "platform.h"
4948
#include "osspec.h"
@@ -436,150 +435,3 @@ void MCAnswer::exec_ctxt(MCExecContext& ctxt)
436435
}
437436
}
438437

439-
void MCAnswer::compile(MCSyntaxFactoryRef ctxt)
440-
{
441-
MCSyntaxFactoryBeginStatement(ctxt, line, pos);
442-
443-
switch(mode)
444-
{
445-
case AT_PAGESETUP:
446-
case AT_PRINTER:
447-
if (title != nil)
448-
title -> compile(ctxt);
449-
else
450-
MCSyntaxFactoryEvalConstantNil(ctxt);
451-
452-
MCSyntaxFactoryEvalConstantBool(ctxt, sheet == True);
453-
454-
if (mode == AT_PAGESETUP)
455-
MCSyntaxFactoryExecMethodWithArgs(ctxt, kMCPrintingExecAnswerPageSetupMethodInfo, 1);
456-
else
457-
MCSyntaxFactoryExecMethodWithArgs(ctxt, kMCPrintingExecAnswerPrinterMethodInfo, 1);
458-
break;
459-
460-
case AT_EFFECT:
461-
if (title != nil)
462-
title -> compile(ctxt);
463-
else
464-
MCSyntaxFactoryEvalConstantNil(ctxt);
465-
466-
MCSyntaxFactoryExecMethod(ctxt, kMCMultimediaExecAnswerEffectMethodInfo);
467-
break;
468-
469-
case AT_RECORD:
470-
if (title != nil)
471-
title -> compile(ctxt);
472-
else
473-
MCSyntaxFactoryEvalConstantNil(ctxt);
474-
475-
MCSyntaxFactoryExecMethod(ctxt, kMCMultimediaExecAnswerRecordMethodInfo);
476-
break;
477-
478-
case AT_COLOR:
479-
if (colour . initial != nil)
480-
colour . initial -> compile(ctxt);
481-
else
482-
MCSyntaxFactoryEvalConstantNil(ctxt);
483-
484-
if (title != nil)
485-
title -> compile(ctxt);
486-
else
487-
MCSyntaxFactoryEvalConstantNil(ctxt);
488-
489-
MCSyntaxFactoryEvalConstantBool(ctxt, sheet == True);
490-
491-
MCSyntaxFactoryExecMethod(ctxt, kMCDialogExecAnswerColorMethodInfo);
492-
break;
493-
494-
case AT_FILE:
495-
case AT_FILES:
496-
MCSyntaxFactoryEvalConstantBool(ctxt, mode == AT_FILES);
497-
498-
if (file . prompt != nil)
499-
file . prompt -> compile(ctxt);
500-
else
501-
MCSyntaxFactoryEvalConstantNil(ctxt);
502-
503-
if (file . initial != nil)
504-
file . initial -> compile(ctxt);
505-
else
506-
MCSyntaxFactoryEvalConstantNil(ctxt);
507-
508-
if (file . filter != nil)
509-
file . filter -> compile(ctxt);
510-
else if (file . type_count > 0)
511-
{
512-
for (uindex_t i = 0; i < file . type_count; i++)
513-
file . types[i] -> compile(ctxt);
514-
515-
MCSyntaxFactoryEvalList(ctxt, file . type_count);
516-
}
517-
518-
if (title != nil)
519-
title -> compile(ctxt);
520-
else
521-
MCSyntaxFactoryEvalConstantNil(ctxt);
522-
523-
MCSyntaxFactoryEvalConstantBool(ctxt, sheet == True);
524-
525-
if (file . type_count > 0)
526-
MCSyntaxFactoryExecMethod(ctxt, kMCDialogExecAnswerFileWithTypesMethodInfo);
527-
else if (file . filter != nil)
528-
MCSyntaxFactoryExecMethod(ctxt, kMCDialogExecAnswerFileWithFilterMethodInfo);
529-
else
530-
MCSyntaxFactoryExecMethod(ctxt, kMCDialogExecAnswerFileMethodInfo);
531-
break;
532-
533-
case AT_FOLDER:
534-
case AT_FOLDERS:
535-
MCSyntaxFactoryEvalConstantBool(ctxt, mode == AT_FOLDERS);
536-
537-
if (file . prompt != nil)
538-
file . prompt -> compile(ctxt);
539-
else
540-
MCSyntaxFactoryEvalConstantNil(ctxt);
541-
542-
if (file . initial != nil)
543-
file . initial -> compile(ctxt);
544-
else
545-
MCSyntaxFactoryEvalConstantNil(ctxt);
546-
547-
if (title != nil)
548-
title -> compile(ctxt);
549-
else
550-
MCSyntaxFactoryEvalConstantNil(ctxt);
551-
552-
MCSyntaxFactoryEvalConstantBool(ctxt, sheet == True);
553-
554-
MCSyntaxFactoryExecMethod(ctxt, kMCDialogExecAnswerFolderMethodInfo);
555-
break;
556-
557-
default:
558-
MCSyntaxFactoryEvalConstantInt(ctxt, mode);
559-
560-
if (notify . prompt != nil)
561-
notify . prompt -> compile(ctxt);
562-
else
563-
MCSyntaxFactoryEvalConstantNil(ctxt);
564-
565-
if (notify . button_count > 0)
566-
{
567-
for (uindex_t i = 0; i < notify . button_count; i++)
568-
notify . buttons[i] -> compile(ctxt);
569-
570-
MCSyntaxFactoryEvalList(ctxt, notify . button_count);
571-
}
572-
573-
if (title != nil)
574-
title -> compile(ctxt);
575-
else
576-
MCSyntaxFactoryEvalConstantNil(ctxt);
577-
578-
MCSyntaxFactoryEvalConstantBool(ctxt, sheet == True);
579-
580-
MCSyntaxFactoryExecMethod(ctxt, kMCDialogExecAnswerNotifyMethodInfo);
581-
break;
582-
}
583-
584-
MCSyntaxFactoryEndStatement(ctxt);
585-
}

engine/src/answer.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ class MCAnswer : public MCStatement
8080

8181
virtual Parse_stat parse(MCScriptPoint &);
8282
virtual void exec_ctxt(MCExecContext &);
83-
virtual void compile(MCSyntaxFactoryRef);
8483

8584
private:
8685
Parse_errors parse_pagesetup(MCScriptPoint& sp);

engine/src/ask.cpp

Lines changed: 0 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
4545
#include "meta.h"
4646
#include "ask.h"
4747

48-
#include "syntax.h"
49-
50-
51-
5248
MCAsk::~MCAsk(void)
5349
{
5450
delete title;
@@ -315,100 +311,3 @@ void MCAsk::exec_ctxt(class MCExecContext& ctxt)
315311
break;
316312
}
317313
}
318-
319-
void MCAsk::compile(MCSyntaxFactoryRef ctxt)
320-
{
321-
MCSyntaxFactoryBeginStatement(ctxt, line, pos);
322-
323-
switch(mode)
324-
{
325-
case AT_PASSWORD:
326-
case AT_CLEAR:
327-
MCSyntaxFactoryEvalConstantBool(ctxt, mode == AT_CLEAR);
328-
329-
if (password . prompt != nil)
330-
password . prompt -> compile(ctxt);
331-
else
332-
MCSyntaxFactoryEvalConstantNil(ctxt);
333-
334-
if (password . answer != nil)
335-
password . answer -> compile(ctxt);
336-
else
337-
MCSyntaxFactoryEvalConstantNil(ctxt);
338-
339-
MCSyntaxFactoryEvalConstantBool(ctxt, password . hint);
340-
341-
if (title != nil)
342-
title -> compile(ctxt);
343-
else
344-
MCSyntaxFactoryEvalConstantNil(ctxt);
345-
346-
MCSyntaxFactoryEvalConstantBool(ctxt, sheet == True);
347-
348-
MCSyntaxFactoryExecMethod(ctxt, kMCDialogExecAskPasswordMethodInfo);
349-
break;
350-
351-
case AT_FILE:
352-
if (file . prompt != nil)
353-
file . prompt -> compile(ctxt);
354-
else
355-
MCSyntaxFactoryEvalConstantNil(ctxt);
356-
357-
if (file . initial != nil)
358-
file . initial -> compile(ctxt);
359-
else
360-
MCSyntaxFactoryEvalConstantNil(ctxt);
361-
362-
if (file . filter != nil)
363-
file . filter -> compile(ctxt);
364-
else if (file . type_count > 0)
365-
{
366-
for (uindex_t i = 0; i < file . type_count; i++)
367-
file . types[i] -> compile(ctxt);
368-
369-
MCSyntaxFactoryEvalList(ctxt, file . type_count);
370-
}
371-
372-
if (title != nil)
373-
title -> compile(ctxt);
374-
else
375-
MCSyntaxFactoryEvalConstantNil(ctxt);
376-
377-
MCSyntaxFactoryEvalConstantBool(ctxt, sheet == True);
378-
379-
if (file . type_count > 0)
380-
MCSyntaxFactoryExecMethod(ctxt, kMCDialogExecAskFileWithTypesMethodInfo);
381-
else if (file . filter != nil)
382-
MCSyntaxFactoryExecMethod(ctxt, kMCDialogExecAskFileWithFilterMethodInfo);
383-
else
384-
MCSyntaxFactoryExecMethod(ctxt, kMCDialogExecAskFileMethodInfo);
385-
break;
386-
387-
default:
388-
MCSyntaxFactoryEvalConstantBool(ctxt, mode == AT_CLEAR);
389-
390-
if (question . prompt != nil)
391-
question . prompt -> compile(ctxt);
392-
else
393-
MCSyntaxFactoryEvalConstantNil(ctxt);
394-
395-
if (question . answer != nil)
396-
question . answer -> compile(ctxt);
397-
else
398-
MCSyntaxFactoryEvalConstantNil(ctxt);
399-
400-
MCSyntaxFactoryEvalConstantBool(ctxt, question . hint);
401-
402-
if (title != nil)
403-
title -> compile(ctxt);
404-
else
405-
MCSyntaxFactoryEvalConstantNil(ctxt);
406-
407-
MCSyntaxFactoryEvalConstantBool(ctxt, sheet == True);
408-
409-
MCSyntaxFactoryExecMethod(ctxt, kMCDialogExecAskQuestionMethodInfo);
410-
break;
411-
}
412-
413-
MCSyntaxFactoryEndStatement(ctxt);
414-
}

engine/src/ask.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ class MCAsk : public MCStatement
7777

7878
virtual Parse_stat parse(MCScriptPoint &);
7979
virtual void exec_ctxt(MCExecContext &);
80-
virtual void compile(MCSyntaxFactoryRef);
8180

8281
private:
8382
Parse_errors parse_question(MCScriptPoint& sp);

0 commit comments

Comments
 (0)