1# org.ctags regex parser for org-mode files 2# Copyright (c) 2022 Universite Rennes 2 3# Copyright (c) 2022 Pierre-Andre CORNILLON 4# 5## Author: Pierre-Andre Cornillon pierre-andre.cornillon@univ-rennes2.fr 6# 7# This program is free software; you can redistribute it and/or 8# modify it under the terms of the GNU General Public License 9# as published by the Free Software Foundation; either version 2 10# of the License, or (at your option) any later version. 11# 12# This program is distributed in the hope that it will be useful, 13# but WITHOUT ANY WARRANTY; without even the implied warranty of 14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15# GNU General Public License for more details. 16# 17# You should have received a copy of the GNU General Public License 18# along with this program; if not, write to the Free Software 19# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 20# USA. 21# 22# References: 23# - https://orgmode.org/ 24# 25--langdef=Org 26--map-Org=+.org 27# definitions 28--kinddef-Org=d,definition,definitions 29--kinddef-Org=p,part,parts 30--kinddef-Org=c,chapter,chapters 31--kinddef-Org=s,section,sections 32--kinddef-Org=u,subsection,subsections 33--kinddef-Org=b,subsubsection,subsubsections 34--kinddef-Org=P,paragraph,paragraphs 35--kinddef-Org=G,subparagraph,subparagraphs 36# definition of levels 37--_tabledef-Org=toplevel 38--_tabledef-Org=srcblock 39################################ 40# beginning of toplevel 41################################ 42# if encounter a src block do language identify languge and defer 43--_mtable-regex-Org=toplevel/[:blank:]*#\+begin_src[ ]+([a-zA-Z0-9][-#+a-zA-Z0-9]*)//{tenter=srcblock}{_guest=\1,0end,} 44# sections stuff 45--_mtable-regex-Org=toplevel/\*\*\*\*\*\*\*[ \t]+([[:graph:][:blank:]]+)([\n])?/\1/G/ 46--_mtable-regex-Org=toplevel/\*\*\*\*\*\*[ \t]+([[:graph:][:blank:]]+)([\n])?/\1/P/ 47--_mtable-regex-Org=toplevel/\*\*\*\*\*[ \t]+([[:graph:][:blank:]]+)([\n])?/\1/b/ 48--_mtable-regex-Org=toplevel/\*\*\*\*[ \t]+([[:graph:][:blank:]]+)([\n])?/\1/u/ 49--_mtable-regex-Org=toplevel/\*\*\*[ \t]+([[:graph:][:blank:]]+)([\n])?/\1/s/ 50--_mtable-regex-Org=toplevel/\*\*[ \t]+([[:graph:][:blank:]]+)([\n])?/\1/c/ 51--_mtable-regex-Org=toplevel/\*[ \t]+([[:graph:][:blank:]]+)([\n])?/\1/p/ 52# labels 53--_mtable-regex-Org=toplevel/<<([^>]+)>>/\1/d/ 54--_mtable-regex-Org=toplevel/#\+(NAME|name):[[:blank:]]+([[:graph:][:blank:]]+)([\n])?/\2/d/ 55## else do nothing (end of toplevel) 56--_mtable-regex-Org=toplevel/.// 57 58################################ 59# beginning of src block 60################################ 61# if end of src block exit 62--_mtable-regex-Org=srcblock/[:blank:]*#\+end_src//{tleave}{_guest=,,0end} 63# else do nothing 64--_mtable-regex-Org=srcblock/.// 65