当前位置: 首页>>代码示例>>Java>>正文


Java ParserState类代码示例

本文整理汇总了Java中org.commonmark.parser.block.ParserState的典型用法代码示例。如果您正苦于以下问题:Java ParserState类的具体用法?Java ParserState怎么用?Java ParserState使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ParserState类属于org.commonmark.parser.block包,在下文中一共展示了ParserState类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: tryContinue

import org.commonmark.parser.block.ParserState; //导入依赖的package包/类
@Override
public BlockContinue tryContinue(ParserState parserState) {

    final BlockContinue blockContinue;

    final String line = line(parserState);

    final int currentIndent = parserState.getIndent();
    if (currentIndent > indent) {
        indent += 2;
    } else if (currentIndent < indent && indent > 1) {
        indent -= 2;
    }

    if (line != null
            && line.length() > 0
            && PATTERN.matcher(line).matches()) {
        blockContinue = BlockContinue.atIndex(parserState.getIndex());
    } else {
        blockContinue = BlockContinue.finished();
    }

    return blockContinue;
}
 
开发者ID:noties,项目名称:Markwon,代码行数:25,代码来源:TaskListBlockParser.java

示例2: tryContinue

import org.commonmark.parser.block.ParserState; //导入依赖的package包/类
@Override
public BlockContinue tryContinue(ParserState state) {
    if (state.isBlank()) {
        if (block.getFirstChild() == null) {
            // Blank line after empty list item
            return BlockContinue.none();
        } else {
            return BlockContinue.atIndex(state.getNextNonSpaceIndex());
        }
    }

    if (state.getIndent() >= contentIndent) {
        return BlockContinue.atColumn(state.getColumn() + contentIndent);
    } else {
        return BlockContinue.none();
    }
}
 
开发者ID:atlassian,项目名称:commonmark-java,代码行数:18,代码来源:ListItemParser.java

示例3: tryStart

import org.commonmark.parser.block.ParserState; //导入依赖的package包/类
@Override
public BlockStart tryStart(ParserState state, MatchedBlockParser matchedBlockParser) {
  CharSequence line = state.getLine();
  CharSequence previousLine = matchedBlockParser.getParagraphContent();
  if (previousLine != null && previousLine.toString().contains("|")) {
    line = line.subSequence(state.getIndex(), line.length());
    ImmutableList<Alignment> columnAlignments = parseHeaderDivider(line);
    if (!columnAlignments.isEmpty()) {
      return BlockStart.of(new TableBlockParser(previousLine, columnAlignments))
          .atIndex(state.getIndex())
          .replaceActiveBlockParser();
    }
  }

  return BlockStart.none();
}
 
开发者ID:jleyba,项目名称:js-dossier,代码行数:17,代码来源:TableBlockParser.java

示例4: line

import org.commonmark.parser.block.ParserState; //导入依赖的package包/类
@Nullable
private static String line(@NonNull ParserState state) {
    final CharSequence lineRaw = state.getLine();
    return lineRaw != null
            ? lineRaw.toString()
            : null;
}
 
开发者ID:noties,项目名称:Markwon,代码行数:8,代码来源:TaskListBlockParser.java

示例5: tryContinue

import org.commonmark.parser.block.ParserState; //导入依赖的package包/类
@Override
public BlockContinue tryContinue(ParserState state) {
    if (!state.isBlank()) {
        return BlockContinue.atIndex(state.getIndex());
    } else {
        return BlockContinue.none();
    }
}
 
开发者ID:atlassian,项目名称:commonmark-java,代码行数:9,代码来源:ParagraphParser.java

示例6: tryContinue

import org.commonmark.parser.block.ParserState; //导入依赖的package包/类
@Override
public BlockContinue tryContinue(ParserState state) {
  if (state.getLine().toString().contains("|")
      || CAPTION_LINE.matcher(state.getLine()).matches()) {
    return BlockContinue.atIndex(state.getIndex());
  } else {
    return BlockContinue.none();
  }
}
 
开发者ID:jleyba,项目名称:js-dossier,代码行数:10,代码来源:TableBlockParser.java

示例7: tryContinue

import org.commonmark.parser.block.ParserState; //导入依赖的package包/类
@Override
public BlockContinue tryContinue(ParserState state) {
    return BlockContinue.atIndex(state.getIndex());
}
 
开发者ID:atlassian,项目名称:commonmark-java,代码行数:5,代码来源:DocumentBlockParser.java


注:本文中的org.commonmark.parser.block.ParserState类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。