mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-05 23:22:25 +00:00
add ctags
This commit is contained in:
parent
812b3a56d6
commit
c4f3792047
3 changed files with 37 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -39,3 +39,4 @@
|
||||||
/triage/BasicTypeSize.md
|
/triage/BasicTypeSize.md
|
||||||
/triage/Roadmap.md
|
/triage/Roadmap.md
|
||||||
triage/system/*
|
triage/system/*
|
||||||
|
tags
|
||||||
|
|
|
||||||
6
makefile
6
makefile
|
|
@ -91,8 +91,10 @@ usage:
|
||||||
@echo " make bootstrap - Update bootstrap C source directories."
|
@echo " make bootstrap - Update bootstrap C source directories."
|
||||||
@echo " make revertbootstrap - Use git checkout to restore bootstrap C source directories"
|
@echo " make revertbootstrap - Use git checkout to restore bootstrap C source directories"
|
||||||
|
|
||||||
|
# Code navigation helper
|
||||||
|
.PHONY: tags
|
||||||
|
tags:
|
||||||
|
ctags -R --options=oberon.ctags --extras=+q
|
||||||
|
|
||||||
# Generate config files Configuration.Make and Configuration.Mod
|
# Generate config files Configuration.Make and Configuration.Mod
|
||||||
FORCE:
|
FORCE:
|
||||||
|
|
|
||||||
32
oberon.ctags
Normal file
32
oberon.ctags
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
# ctags -R --options=oberon.ctags --extras=+q
|
||||||
|
|
||||||
|
--langdef=Oberon{_autoFQTag}
|
||||||
|
|
||||||
|
--map-Oberon=+.mod
|
||||||
|
--map-Oberon=+.Mod
|
||||||
|
|
||||||
|
--kinddef-Oberon=m,module,modules
|
||||||
|
--kinddef-Oberon=p,procedure,procedures
|
||||||
|
|
||||||
|
--regex-Oberon=/^\s*MODULE\s+([a-zA-Z][a-zA-Z0-9]*)\s*;/\1/m/{scope=push}
|
||||||
|
--regex-Oberon=/^\s*END\s+([a-zA-Z][a-zA-Z0-9]*)\s*\./\1/m/{scope=pop}
|
||||||
|
--regex-Oberon=/^\s*PROCEDURE(\s*\^|-)?\s*([a-zA-Z][a-zA-Z0-9]*)/\2/p/{scope=ref}
|
||||||
|
# NOTE Oberon-2 receiver procedures not supported
|
||||||
|
|
||||||
|
### using ctags with vim
|
||||||
|
# examples:
|
||||||
|
# vim -t "Compiler"
|
||||||
|
# vim -t "OPS.Get"
|
||||||
|
# vim -c ":ts Platform.Read"
|
||||||
|
#
|
||||||
|
# when inside the editor you need to jump to the fully qualified tag,
|
||||||
|
# not just procedure name e.g. when you have Platform.Write, you
|
||||||
|
# can't just place cursor on W then <C-]> and expect it to resolve
|
||||||
|
# correctly all the time.
|
||||||
|
# your better options are
|
||||||
|
# autocmd FileType oberon setlocal iskeyword+=.
|
||||||
|
# autocmd FileType modula2 setlocal iskeyword+=.
|
||||||
|
# :ta Platform.Write
|
||||||
|
# v 3e <C-]>
|
||||||
|
# :ts Platform.Write
|
||||||
|
# g <C-]>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue