Skip to content

Ctags regex parser for the Karel programming language

License

Notifications You must be signed in to change notification settings

HerrSubset/karel-ctags

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Karel-ctags

A regex parser for ctags that allows you to generate tags for Karel source files. To get it working, copy the karel.ctags file to one of the directories specified in Universal ctags' Preload option file documentation.

This setup was only tested with Universal ctags, and generates tags for the following items.

Programs

Instances of PROGRAM programName generate a tag.

Routines

All types of routine definitions should be supported, but routine import statements are excluded.

-- * These generate tags
ROUTINE basicRoutine
ROUTINE routineWithReturnType : STRING
ROUTINE routineWithArgument(i: INTEGER)
ROUTINE routineWithArgumentAndReturnType(s : STRING) : INTEGER
ROUTINE routineWithMultipleArguments(s : STRING; i : INTEGER)
ROUTINE routineWithMultipleArgumentsAndReturnType(s : STRING; i : INTEGER) : STRING

-- * These do not generate tags
ROUTINE firstImport FROM otherFile
ROUTINE secondImport(s : STRING) FROM otherFile
ROUTINE thirdImport(i: INTEGER; s : STRING) FROM otherFile

Structures

The name of a structure definition gets tagged.

MyType FROM SomeProgram = STRUCTURE
	myVar : INTEGER
ENDSTRUCTURE

Constants

This is a hacky one, but variable assignments where the variable name only contains upper case letters and underscores gets tagged as a constant definition.

-- * A constant
	MY_NEW_VALUE = 3

-- * Not a constant
	my_old_value = 26

About

Ctags regex parser for the Karel programming language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published